1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/prims/jvmtiEnv.xsl Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,200 @@ 1.4 +<?xml version="1.0"?> 1.5 +<!-- 1.6 + Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. 1.7 + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 + 1.9 + This code is free software; you can redistribute it and/or modify it 1.10 + under the terms of the GNU General Public License version 2 only, as 1.11 + published by the Free Software Foundation. 1.12 + 1.13 + This code is distributed in the hope that it will be useful, but WITHOUT 1.14 + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.15 + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.16 + version 2 for more details (a copy is included in the LICENSE file that 1.17 + accompanied this code). 1.18 + 1.19 + You should have received a copy of the GNU General Public License version 1.20 + 2 along with this work; if not, write to the Free Software Foundation, 1.21 + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.22 + 1.23 + Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.24 + CA 95054 USA or visit www.sun.com if you need additional information or 1.25 + have any questions. 1.26 + 1.27 +--> 1.28 + 1.29 +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 1.30 + 1.31 +<xsl:import href="jvmtiLib.xsl"/> 1.32 + 1.33 +<xsl:output method="text" indent="no" omit-xml-declaration="yes"/> 1.34 + 1.35 +<xsl:template match="/"> 1.36 + <xsl:apply-templates select="specification"/> 1.37 +</xsl:template> 1.38 + 1.39 +<xsl:template match="specification"> 1.40 + <xsl:call-template name="sourceHeader"/> 1.41 + <xsl:text> 1.42 +# include "incls/_precompiled.incl" 1.43 +# include "incls/_jvmtiEnv.cpp.incl" 1.44 + 1.45 +// end file prefix - do not modify or remove this line 1.46 +</xsl:text> 1.47 + <xsl:apply-templates select="functionsection"/> 1.48 +</xsl:template> 1.49 + 1.50 +<xsl:template match="functionsection"> 1.51 + <xsl:apply-templates select="category"/> 1.52 +</xsl:template> 1.53 + 1.54 +<xsl:template match="category"> 1.55 + <xsl:text> 1.56 + // 1.57 + // </xsl:text><xsl:value-of select="@label"/><xsl:text> functions 1.58 + // 1.59 +</xsl:text> 1.60 + <xsl:apply-templates select="function[not(contains(@impl,'unimpl'))]"/> 1.61 +</xsl:template> 1.62 + 1.63 +<xsl:template match="function"> 1.64 + <xsl:apply-templates select="parameters" mode="advice"/> 1.65 + <xsl:text> 1.66 +jvmtiError 1.67 +JvmtiEnv::</xsl:text> 1.68 + <xsl:if test="count(@hide)=1"> 1.69 + <xsl:value-of select="@hide"/> 1.70 + </xsl:if> 1.71 + <xsl:value-of select="@id"/> 1.72 + <xsl:text>(</xsl:text> 1.73 + <xsl:apply-templates select="parameters" mode="HotSpotSig"/> 1.74 + <xsl:text>) {</xsl:text> 1.75 + <xsl:for-each select="parameters/param/jclass"> 1.76 + <xsl:if test="count(@method|@field)=0"> 1.77 +<xsl:text> 1.78 + if (java_lang_Class::is_primitive(k_mirror)) { 1.79 + // DO PRIMITIVE CLASS PROCESSING 1.80 + return JVMTI_ERROR_MUST_POSSESS_CAPABILITY; 1.81 + } 1.82 + klassOop k_oop = java_lang_Class::as_klassOop(k_mirror); 1.83 + if (k_oop == NULL) { 1.84 + return JVMTI_ERROR_INVALID_CLASS; 1.85 + }</xsl:text> 1.86 + </xsl:if> 1.87 + </xsl:for-each> 1.88 +<xsl:text> 1.89 + return JVMTI_ERROR_MUST_POSSESS_CAPABILITY; 1.90 +} /* end </xsl:text> 1.91 + <xsl:if test="count(@hide)=1"> 1.92 + <xsl:value-of select="@hide"/> 1.93 + </xsl:if> 1.94 + <xsl:value-of select="@id"/> 1.95 + <xsl:text> */ 1.96 + 1.97 +</xsl:text> 1.98 +</xsl:template> 1.99 + 1.100 + 1.101 +<!-- ======== ADVICE ======== --> 1.102 + 1.103 +<xsl:template match="parameters" mode="advice"> 1.104 + <xsl:apply-templates select="param" mode="advice"/> 1.105 +</xsl:template> 1.106 + 1.107 +<xsl:template match="param" mode="advice"> 1.108 + <xsl:apply-templates select="child::*[position()=1]" mode="advice"> 1.109 + <xsl:with-param name="name" select="@id"/> 1.110 + </xsl:apply-templates> 1.111 +</xsl:template> 1.112 + 1.113 +<xsl:template match="jthread" mode="advice"> 1.114 + <xsl:param name="name"/> 1.115 + <xsl:choose> 1.116 + <xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))"> 1.117 + <xsl:text> 1.118 +// Threads_lock NOT held, java_thread not protected by lock 1.119 +// java_thread - pre-checked</xsl:text> 1.120 + </xsl:when> 1.121 + <xsl:otherwise> 1.122 + <xsl:text> 1.123 +// Threads_lock NOT held 1.124 +// </xsl:text> 1.125 + <xsl:value-of select="$name"/> 1.126 + <xsl:text> - NOT pre-checked</xsl:text> 1.127 + </xsl:otherwise> 1.128 + </xsl:choose> 1.129 +</xsl:template> 1.130 + 1.131 +<xsl:template match="jrawMonitorID" mode="advice"> 1.132 + <xsl:param name="name"/> 1.133 + <xsl:text> 1.134 +// rmonitor - pre-checked for validity</xsl:text> 1.135 +</xsl:template> 1.136 + 1.137 +<xsl:template match="jframeID" mode="advice"> 1.138 + <xsl:param name="name"/> 1.139 + <xsl:text> 1.140 +// java_thread - unchecked 1.141 +// depth - pre-checked as non-negative</xsl:text> 1.142 +</xsl:template> 1.143 + 1.144 +<xsl:template match="jmethodID" mode="advice"> 1.145 + <xsl:param name="name"/> 1.146 + <xsl:text> 1.147 +// method_oop - pre-checked for validity, but may be NULL meaning obsolete method</xsl:text> 1.148 +</xsl:template> 1.149 + 1.150 +<xsl:template match="jfieldID" mode="advice"> 1.151 + <xsl:param name="name"/> 1.152 +</xsl:template> 1.153 + 1.154 +<xsl:template match="jclass" mode="advice"> 1.155 + <xsl:param name="name"/> 1.156 + <!-- 1.157 + classes passed as part of a class/method or class/field pair are used 1.158 + by the wrapper to get the internal type but are not needed by nor 1.159 + passed to the implementation layer. 1.160 + --> 1.161 + <xsl:if test="count(@method|@field)=0"> 1.162 + <xsl:text> 1.163 +// k_mirror - may be primitive, this must be checked</xsl:text> 1.164 + </xsl:if> 1.165 +</xsl:template> 1.166 + 1.167 +<xsl:template match="nullok" mode="advice"> 1.168 +</xsl:template> 1.169 + 1.170 +<xsl:template match="outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="advice"> 1.171 + <xsl:param name="name"/> 1.172 + <xsl:choose> 1.173 + <xsl:when test="count(nullok)=0"> 1.174 + <xsl:text> 1.175 +// </xsl:text> 1.176 + <xsl:value-of select="$name"/> 1.177 + <xsl:text> - pre-checked for NULL</xsl:text> 1.178 + </xsl:when> 1.179 + <xsl:otherwise> 1.180 + <xsl:text> 1.181 +// </xsl:text> 1.182 + <xsl:value-of select="$name"/> 1.183 + <xsl:text> - NULL is a valid value, must be checked</xsl:text> 1.184 + </xsl:otherwise> 1.185 + </xsl:choose> 1.186 +</xsl:template> 1.187 + 1.188 +<xsl:template match="jint" mode="advice"> 1.189 + <xsl:param name="name"/> 1.190 + <xsl:if test="count(@min)=1"> 1.191 + <xsl:text> 1.192 +// </xsl:text> 1.193 + <xsl:value-of select="$name"/> 1.194 + <xsl:text> - pre-checked to be greater than or equal to </xsl:text> 1.195 + <xsl:value-of select="@min"/> 1.196 + </xsl:if> 1.197 +</xsl:template> 1.198 + 1.199 +<xsl:template match="jobject|jvalue|jthreadGroup|enum|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct" mode="advice"> 1.200 + <xsl:param name="name"/> 1.201 +</xsl:template> 1.202 + 1.203 +</xsl:stylesheet>