Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/prims/jvmtiEnv.xsl
32285 views
<?xml version="1.0"?>1<!--2Copyright (c) 2002, 2012, 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// Threads_lock NOT held, java_thread not protected by lock113// java_thread - pre-checked</xsl:text>114</xsl:when>115<xsl:otherwise>116<xsl:text>117// Threads_lock NOT held118// </xsl:text>119<xsl:value-of select="$name"/>120<xsl:text> - NOT pre-checked</xsl:text>121</xsl:otherwise>122</xsl:choose>123</xsl:template>124125<xsl:template match="jrawMonitorID" mode="advice">126<xsl:param name="name"/>127<xsl:text>128// rmonitor - pre-checked for validity</xsl:text>129</xsl:template>130131<xsl:template match="jframeID" mode="advice">132<xsl:param name="name"/>133<xsl:text>134// java_thread - unchecked135// depth - pre-checked as non-negative</xsl:text>136</xsl:template>137138<xsl:template match="jmethodID" mode="advice">139<xsl:param name="name"/>140<xsl:text>141// method_oop - pre-checked for validity, but may be NULL meaning obsolete method</xsl:text>142</xsl:template>143144<xsl:template match="jfieldID" mode="advice">145<xsl:param name="name"/>146</xsl:template>147148<xsl:template match="jclass" mode="advice">149<xsl:param name="name"/>150<!--151classes passed as part of a class/method or class/field pair are used152by the wrapper to get the internal type but are not needed by nor153passed to the implementation layer.154-->155<xsl:if test="count(@method|@field)=0">156<xsl:text>157// k_mirror - may be primitive, this must be checked</xsl:text>158</xsl:if>159</xsl:template>160161<xsl:template match="nullok" mode="advice">162</xsl:template>163164<xsl:template match="outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="advice">165<xsl:param name="name"/>166<xsl:choose>167<xsl:when test="count(nullok)=0">168<xsl:text>169// </xsl:text>170<xsl:value-of select="$name"/>171<xsl:text> - pre-checked for NULL</xsl:text>172</xsl:when>173<xsl:otherwise>174<xsl:text>175// </xsl:text>176<xsl:value-of select="$name"/>177<xsl:text> - NULL is a valid value, must be checked</xsl:text>178</xsl:otherwise>179</xsl:choose>180</xsl:template>181182<xsl:template match="jint" mode="advice">183<xsl:param name="name"/>184<xsl:if test="count(@min)=1">185<xsl:text>186// </xsl:text>187<xsl:value-of select="$name"/>188<xsl:text> - pre-checked to be greater than or equal to </xsl:text>189<xsl:value-of select="@min"/>190</xsl:if>191</xsl:template>192193<xsl:template match="jobject|jvalue|jthreadGroup|enum|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct" mode="advice">194<xsl:param name="name"/>195</xsl:template>196197</xsl:stylesheet>198199200