Path: blob/master/src/hotspot/share/prims/jvmtiEnv.xsl
41144 views
<?xml version="1.0"?>1<!--2Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.3DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.45This code is free software; you can redistribute it and/or modify it6under the terms of the GNU General Public License version 2 only, as7published by the Free Software Foundation.89This code is distributed in the hope that it will be useful, but WITHOUT10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12version 2 for more details (a copy is included in the LICENSE file that13accompanied this code).1415You should have received a copy of the GNU General Public License version162 along with this work; if not, write to the Free Software Foundation,17Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.1819Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20or visit www.oracle.com if you need additional information or have any21questions.2223-->2425<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">2627<xsl:import href="jvmtiLib.xsl"/>2829<xsl:output method="text" indent="no" omit-xml-declaration="yes"/>3031<xsl:template match="/">32<xsl:apply-templates select="specification"/>33</xsl:template>3435<xsl:template match="specification">36<xsl:call-template name="sourceHeader"/>37<xsl:text>3839// end file prefix - do not modify or remove this line40</xsl:text>41<xsl:apply-templates select="functionsection"/>42</xsl:template>4344<xsl:template match="functionsection">45<xsl:apply-templates select="category"/>46</xsl:template>4748<xsl:template match="category">49<xsl:text>50//51// </xsl:text><xsl:value-of select="@label"/><xsl:text> functions52//53</xsl:text>54<xsl:apply-templates select="function[not(contains(@impl,'unimpl'))]"/>55</xsl:template>5657<xsl:template match="function">58<xsl:apply-templates select="parameters" mode="advice"/>59<xsl:text>60jvmtiError61JvmtiEnv::</xsl:text>62<xsl:if test="count(@hide)=1">63<xsl:value-of select="@hide"/>64</xsl:if>65<xsl:value-of select="@id"/>66<xsl:text>(</xsl:text>67<xsl:apply-templates select="parameters" mode="HotSpotSig"/>68<xsl:text>) {</xsl:text>69<xsl:for-each select="parameters/param/jclass">70<xsl:if test="count(@method|@field)=0">71<xsl:text>72if (java_lang_Class::is_primitive(k_mirror)) {73// DO PRIMITIVE CLASS PROCESSING74return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;75}76Klass* k_oop = java_lang_Class::as_Klass(k_mirror);77if (k_oop == NULL) {78return JVMTI_ERROR_INVALID_CLASS;79}</xsl:text>80</xsl:if>81</xsl:for-each>82<xsl:text>83return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;84} /* end </xsl:text>85<xsl:if test="count(@hide)=1">86<xsl:value-of select="@hide"/>87</xsl:if>88<xsl:value-of select="@id"/>89<xsl:text> */9091</xsl:text>92</xsl:template>939495<!-- ======== ADVICE ======== -->9697<xsl:template match="parameters" mode="advice">98<xsl:apply-templates select="param" mode="advice"/>99</xsl:template>100101<xsl:template match="param" mode="advice">102<xsl:apply-templates select="child::*[position()=1]" mode="advice">103<xsl:with-param name="name" select="@id"/>104</xsl:apply-templates>105</xsl:template>106107<xsl:template match="jthread" mode="advice">108<xsl:param name="name"/>109<xsl:choose>110<xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))">111<xsl:text>112// java_thread - protected by ThreadsListHandle and pre-checked</xsl:text>113</xsl:when>114<xsl:otherwise>115<xsl:text>116// </xsl:text>117<xsl:value-of select="$name"/>118<xsl:text> - NOT protected by ThreadsListHandle and NOT pre-checked</xsl:text>119</xsl:otherwise>120</xsl:choose>121</xsl:template>122123<xsl:template match="jrawMonitorID" mode="advice">124<xsl:param name="name"/>125<xsl:text>126// rmonitor - pre-checked for validity</xsl:text>127</xsl:template>128129<xsl:template match="jframeID" mode="advice">130<xsl:param name="name"/>131<xsl:text>132// depth - pre-checked as non-negative</xsl:text>133</xsl:template>134135<xsl:template match="jmethodID" mode="advice">136<xsl:param name="name"/>137<xsl:text>138// method - pre-checked for validity, but may be NULL meaning obsolete method</xsl:text>139</xsl:template>140141<xsl:template match="jfieldID" mode="advice">142<xsl:param name="name"/>143</xsl:template>144145<xsl:template match="jclass" mode="advice">146<xsl:param name="name"/>147<!--148classes passed as part of a class/method or class/field pair are used149by the wrapper to get the internal type but are not needed by nor150passed to the implementation layer.151-->152<xsl:if test="count(@method|@field)=0">153<xsl:text>154// k_mirror - may be primitive, this must be checked</xsl:text>155</xsl:if>156</xsl:template>157158<xsl:template match="nullok" mode="advice">159</xsl:template>160161<xsl:template match="outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="advice">162<xsl:param name="name"/>163<xsl:choose>164<xsl:when test="count(nullok)=0">165<xsl:text>166// </xsl:text>167<xsl:value-of select="$name"/>168<xsl:text> - pre-checked for NULL</xsl:text>169</xsl:when>170<xsl:otherwise>171<xsl:text>172// </xsl:text>173<xsl:value-of select="$name"/>174<xsl:text> - NULL is a valid value, must be checked</xsl:text>175</xsl:otherwise>176</xsl:choose>177</xsl:template>178179<xsl:template match="jint" mode="advice">180<xsl:param name="name"/>181<xsl:if test="count(@min)=1">182<xsl:text>183// </xsl:text>184<xsl:value-of select="$name"/>185<xsl:text> - pre-checked to be greater than or equal to </xsl:text>186<xsl:value-of select="@min"/>187</xsl:if>188</xsl:template>189190<xsl:template match="jobject|jvalue|jthreadGroup|enum|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct" mode="advice">191<xsl:param name="name"/>192</xsl:template>193194</xsl:stylesheet>195196197