Path: blob/master/src/hotspot/share/prims/jvmtiLib.xsl
41144 views
<?xml version="1.0" encoding="utf-8"?>1<!--23Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.4DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.56This code is free software; you can redistribute it and/or modify it7under the terms of the GNU General Public License version 2 only, as8published by the Free Software Foundation.910This code is distributed in the hope that it will be useful, but WITHOUT11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13version 2 for more details (a copy is included in the LICENSE file that14accompanied this code).1516You should have received a copy of the GNU General Public License version172 along with this work; if not, write to the Free Software Foundation,18Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.1920Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21or visit www.oracle.com if you need additional information or have any22questions.2324-->2526<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"27version="1.0">2829<xsl:param name="majorversion"></xsl:param>3031<xsl:template name="microversion">32<!-- Now microversion is always 0 -->33<xsl:text>0</xsl:text>34</xsl:template>3536<xsl:template name="showbasicversion">37<xsl:value-of select="$majorversion"/>38<!-- Now minorversion is always 0 -->39<xsl:text>.0</xsl:text>40</xsl:template>4142<xsl:template name="showversion">43<xsl:call-template name="showbasicversion"/>44<xsl:text>.</xsl:text>45<xsl:call-template name="microversion"/>46</xsl:template>4748<xsl:variable name="GPL_header">49<!-- The Copyright comment from jvmti.xml -->50<xsl:value-of select="/comment()[position()=1]"/>51</xsl:variable>5253<xsl:variable name="GPL_CP_header_body">54<xsl:text> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
</xsl:text>55<xsl:text> *
</xsl:text>56<xsl:text> * This code is free software; you can redistribute it and/or modify it
</xsl:text>57<xsl:text> * under the terms of the GNU General Public License version 2 only, as
</xsl:text>58<xsl:text> * published by the Free Software Foundation. Oracle designates this
</xsl:text>59<xsl:text> * particular file as subject to the "Classpath" exception as provided
</xsl:text>60<xsl:text> * by Oracle in the LICENSE file that accompanied this code.
</xsl:text>61<xsl:text> *
</xsl:text>62<xsl:text> * This code is distributed in the hope that it will be useful, but WITHOUT
</xsl:text>63<xsl:text> * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
</xsl:text>64<xsl:text> * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
</xsl:text>65<xsl:text> * version 2 for more details (a copy is included in the LICENSE file that
</xsl:text>66<xsl:text> * accompanied this code).
</xsl:text>67<xsl:text> *
</xsl:text>68<xsl:text> * You should have received a copy of the GNU General Public License version
</xsl:text>69<xsl:text> * 2 along with this work; if not, write to the Free Software Foundation,
</xsl:text>70<xsl:text> * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
</xsl:text>71<xsl:text> *
</xsl:text>72<xsl:text> * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
</xsl:text>73<xsl:text> * or visit www.oracle.com if you need additional information or have any
</xsl:text>74<xsl:text> * questions.
</xsl:text>75</xsl:variable>7677<xsl:template name="copyrightComment">78<xsl:text>/*</xsl:text>79<!-- The Copyright comment from jvmti.xml -->80<xsl:value-of select="$GPL_header"/>81<xsl:text> */

</xsl:text>82</xsl:template>8384<xsl:template name="GPL_CP_copyrightComment">85<xsl:text>/*
 *</xsl:text>86<!-- The Copyright year from jvmti.xml -->87<xsl:value-of select="substring-after(substring-before($GPL_header, ' DO NOT ALTER'), '
')"/>88<!-- The GPL+CP Copyright header body -->89<xsl:value-of select="$GPL_CP_header_body"/>90<xsl:text> */

</xsl:text>91</xsl:template>9293<xsl:template name="include_GPL_CP_Header">94<xsl:call-template name="GPL_CP_copyrightComment"/>95<xsl:text> /* AUTOMATICALLY GENERATED FILE - DO NOT EDIT */
</xsl:text>96</xsl:template>9798<xsl:template name="includeHeader">99<xsl:call-template name="copyrightComment"/>100<xsl:text> /* AUTOMATICALLY GENERATED FILE - DO NOT EDIT */
</xsl:text>101</xsl:template>102103<xsl:template name="sourceHeader">104<xsl:call-template name="copyrightComment"/>105<xsl:text> // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
</xsl:text>106</xsl:template>107108109<xsl:template match="parameters" mode="signature">110<xsl:param name="comma">111<xsl:text>,112</xsl:text>113</xsl:param>114<xsl:if test="count(param) != 0">115<xsl:value-of select="$comma"/>116</xsl:if>117<xsl:apply-templates select="." mode="signaturenoleadcomma">118<xsl:with-param name="comma" select="$comma"/>119</xsl:apply-templates>120</xsl:template>121122123<xsl:template match="parameters" mode="signaturenoleadcomma">124<xsl:param name="comma">125<xsl:text>,126</xsl:text>127</xsl:param>128<xsl:variable name="length" select="count(param)"/>129<xsl:for-each select="param">130<xsl:variable name="separator">131<xsl:choose>132<xsl:when test="position()=$length">133<xsl:text></xsl:text>134</xsl:when>135<xsl:otherwise>136<xsl:value-of select="$comma"/>137</xsl:otherwise>138</xsl:choose>139</xsl:variable>140<xsl:apply-templates select="." mode="signature">141<xsl:with-param name="comma" select="$separator"/>142</xsl:apply-templates>143</xsl:for-each>144</xsl:template>145146147<!-- remove jclass parameters that are jclass/jmethodID pairs.148since the jclass was removed in JVMTI.149-->150<xsl:template match="param" mode="signature">151<xsl:param name="comma"/>152<xsl:variable name="id" select="@id"/>153<xsl:for-each select="child::*[position()=1]">154<xsl:if test="count(@method)=0">155<xsl:apply-templates select="." mode="signature"/>156<xsl:text> </xsl:text>157<xsl:value-of select="$id"/>158<xsl:value-of select="$comma"/>159</xsl:if>160</xsl:for-each>161</xsl:template>162163164<xsl:template match="field" mode="signature">165<xsl:text> </xsl:text>166<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>167<xsl:text> </xsl:text>168<xsl:value-of select="@id"/>169<xsl:text>;170</xsl:text>171</xsl:template>172173<xsl:template match="nullok" mode="funcdescription">174If175<code>176<xsl:value-of select="../../@id"/>177</code>178is179<code>NULL</code>, <xsl:apply-templates/>.180</xsl:template>181182<xsl:template match="vmbuf|allocfieldbuf|struct" mode="funcdescription">183<xsl:message terminate="yes">184vmbuf|allocfieldbuf|struct as type of function parameter185</xsl:message>186</xsl:template>187188<xsl:template match="ptrtype" mode="funcdescription">189<div class="sep"/>190<xsl:apply-templates select="nullok" mode="funcdescription"/>191</xsl:template>192193<xsl:template match="inptr" mode="funcdescription">194<div class="sep"/>195<xsl:variable name="child" select="child::*[position()=1]"/>196<xsl:text>Agent passes in a pointer</xsl:text>197<xsl:if test="name($child)!='void'">198<xsl:text> to </xsl:text>199<code>200<xsl:apply-templates select="$child" mode="signature"/>201</code>202</xsl:if>203<xsl:text>. </xsl:text>204<xsl:apply-templates select="nullok" mode="funcdescription"/>205</xsl:template>206207<xsl:template match="inbuf" mode="funcdescription">208<div class="sep"/>209<xsl:variable name="child" select="child::*[position()=1]"/>210<xsl:text>Agent passes in </xsl:text>211<xsl:choose>212<xsl:when test="name($child)='void'">213<xsl:text> a pointer</xsl:text>214</xsl:when>215<xsl:otherwise>216<xsl:text> an array of </xsl:text>217<xsl:if test="count(@incount)=1 and @incount!=''">218<code>219<xsl:value-of select="@incount"/>220</code>221<xsl:text> elements of </xsl:text>222</xsl:if>223<code>224<xsl:apply-templates select="$child" mode="signature"/>225</code>226</xsl:otherwise>227</xsl:choose>228<xsl:text>. </xsl:text>229<xsl:apply-templates select="nullok" mode="funcdescription"/>230</xsl:template>231232<xsl:template match="outptr" mode="funcdescription">233<div class="sep"/>234<xsl:text>Agent passes a pointer to a </xsl:text>235<code>236<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>237</code>238<xsl:text>. </xsl:text>239<xsl:text>On return, the </xsl:text>240<code>241<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>242</code>243<xsl:text> has been set. </xsl:text>244<xsl:apply-templates select="nullok" mode="funcdescription"/>245<xsl:apply-templates select="child::*[position()=1]" mode="returndescription"/>246</xsl:template>247248<xsl:template match="allocbuf" mode="funcdescription">249<div class="sep"/>250<xsl:text>Agent passes a pointer to a </xsl:text>251<code>252<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>253<xsl:text>*</xsl:text>254</code>255<xsl:text>. </xsl:text>256<xsl:text>On return, the </xsl:text>257<code>258<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>259<xsl:text>*</xsl:text>260</code>261<xsl:text> points to a newly allocated array</xsl:text>262<xsl:choose>263<xsl:when test="count(@outcount)=1 and @outcount!=''">264<xsl:text> of size </xsl:text>265<code>266<xsl:text>*</xsl:text>267<xsl:value-of select="@outcount"/>268</code>269</xsl:when>270<xsl:otherwise>271<xsl:if test="count(@incount)=1 and @incount!=''">272<xsl:text> of size </xsl:text>273<code>274<xsl:value-of select="@incount"/>275</code>276</xsl:if>277</xsl:otherwise>278</xsl:choose>279<xsl:text>. The array should be freed with </xsl:text>280<a href="#Deallocate"><code>Deallocate</code></a>281<xsl:text>. </xsl:text>282<xsl:apply-templates select="nullok" mode="funcdescription"/>283<xsl:apply-templates select="child::*[position()=1]" mode="returndescription">284<xsl:with-param name="plural" select="'plural'"/>285</xsl:apply-templates>286</xsl:template>287288<xsl:template match="allocallocbuf" mode="funcdescription">289<div class="sep"/>290<xsl:text>Agent passes a pointer to a </xsl:text>291<code>292<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>293<xsl:text>**</xsl:text>294</code>295<xsl:text>. </xsl:text>296<xsl:text>On return, the </xsl:text>297<code>298<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>299<xsl:text>**</xsl:text>300</code>301<xsl:text> points to a newly allocated array</xsl:text>302<xsl:choose>303<xsl:when test="count(@outcount)=1 and @outcount!=''">304<xsl:text> of size </xsl:text>305<code>306<xsl:text>*</xsl:text>307<xsl:value-of select="@outcount"/>308</code>309</xsl:when>310<xsl:otherwise>311<xsl:if test="count(@incount)=1 and @incount!=''">312<xsl:text> of size </xsl:text>313<code>314<xsl:value-of select="@incount"/>315</code>316</xsl:if>317</xsl:otherwise>318</xsl:choose>319<xsl:text>, each element of which is also newly allocated.320The array should be freed with </xsl:text>321<a href="#Deallocate"><code>Deallocate</code></a>322<xsl:text>.323Each of the elements should be freed with </xsl:text>324<a href="#Deallocate"><code>Deallocate</code></a>325<xsl:text>. </xsl:text>326<xsl:apply-templates select="nullok" mode="funcdescription"/>327<xsl:apply-templates select="child::*[position()=1]" mode="returndescription">328<xsl:with-param name="plural" select="'plural'"/>329</xsl:apply-templates>330</xsl:template>331332<xsl:template match="outbuf" mode="funcdescription">333<div class="sep"/>334<xsl:text>Agent passes an array </xsl:text>335<xsl:if test="count(@incount)=1 and @incount!=''">336<xsl:text>large enough to hold </xsl:text>337<code>338<xsl:value-of select="@incount"/>339</code>340<xsl:text> elements </xsl:text>341</xsl:if>342<xsl:text>of </xsl:text>343<code>344<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>345</code>346<xsl:text>. The incoming values of the elements of the array are ignored. </xsl:text>347<xsl:text>On return, </xsl:text>348<xsl:if test="count(@outcount)=1 and @outcount!=''">349<code>350<xsl:text>*</xsl:text>351<xsl:value-of select="@outcount"/>352</code>353<xsl:text> of </xsl:text>354</xsl:if>355<xsl:text>the elements are set. </xsl:text>356<xsl:apply-templates select="nullok" mode="funcdescription"/>357<xsl:apply-templates select="child::*[position()=1]" mode="returndescription">358<xsl:with-param name="plural" select="'plural'"/>359</xsl:apply-templates>360</xsl:template>361362<xsl:template match="agentbuf" mode="funcdescription">363<div class="sep"/>364<xsl:apply-templates select="nullok" mode="funcdescription"/>365<xsl:apply-templates select="child::*[position()=1]" mode="returndescription">366<xsl:with-param name="plural" select="'plural'"/>367</xsl:apply-templates>368</xsl:template>369370<xsl:template match="jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jobject|jvalue|jthreadGroup|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct" mode="funcdescription">371</xsl:template>372373<xsl:template match="jthread" mode="funcdescription">374<xsl:if test="count(@null)!=0">375If376<code>377<xsl:value-of select="../@id"/>378</code>379is380<code>NULL</code>, the current thread is used.381</xsl:if>382</xsl:template>383384<xsl:template match="jmethodID|jfieldID|jframeID|jrawMonitorID|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs" mode="returndescription">385</xsl:template>386387<xsl:template match="struct" mode="returndescription">388<xsl:param name="plural"/>389<xsl:variable name="structname" select="."/>390<xsl:for-each select="//typedef[@id=$structname]|//uniontypedef[@id=$structname]">391<xsl:for-each select="field">392<xsl:apply-templates select="child::*[position()=1]" mode="fieldreturndescription">393<xsl:with-param name="plural" select="$plural"/>394</xsl:apply-templates>395</xsl:for-each>396</xsl:for-each>397</xsl:template>398399<xsl:template match="jclass|jthread|jobject|jvalue|jthreadGroup" mode="returndescription">400<xsl:param name="plural"/>401<xsl:text>The object</xsl:text>402<xsl:if test="$plural='plural'">403<xsl:text>s</xsl:text>404</xsl:if>405<xsl:text> returned by </xsl:text>406<code>407<xsl:value-of select="../../@id"/>408</code>409<xsl:choose>410<xsl:when test="$plural='plural'">411<xsl:text> are JNI local references and must be </xsl:text>412</xsl:when>413<xsl:otherwise>414<xsl:text> is a JNI local reference and must be </xsl:text>415</xsl:otherwise>416</xsl:choose>417<a href="#refs">managed</a>.418</xsl:template>419420<xsl:template match="outptr|inptr|inbuf|agentbuf|allocbuf|allocallocbuf" mode="fieldreturndescription">421<xsl:variable name="field" select="ancestor::field"/>422<xsl:message terminate="yes">423outptr, allocallocbuf, outbuf, vmbuf, allocbuf, inptr, inbuf or agentbuf as type of returned field:424<xsl:value-of select="$field/@id"/> of <xsl:value-of select="$field/../@id"/>425</xsl:message>426</xsl:template>427428<xsl:template match="outbuf" mode="fieldreturndescription">429<!-- hand document this special case.430-->431</xsl:template>432433<xsl:template match="struct" mode="fieldreturndescription">434<xsl:param name="plural"/>435<xsl:variable name="structname" select="."/>436<xsl:for-each select="//typedef[@id=$structname]|//uniontypedef[@id=$structname]">437<xsl:for-each select="field">438<xsl:apply-templates select="child::*[position()=1]" mode="fieldreturndescription">439<xsl:with-param name="plural" select="$plural"/>440</xsl:apply-templates>441</xsl:for-each>442</xsl:for-each>443</xsl:template>444445<xsl:template match="allocfieldbuf" mode="fieldreturndescription">446<xsl:param name="plural"/>447<xsl:variable name="field" select="ancestor::field"/>448<xsl:text>The pointer</xsl:text>449<xsl:if test="$plural='plural'">450<xsl:text>s</xsl:text>451</xsl:if>452<xsl:text> returned in the field </xsl:text>453<code>454<xsl:value-of select="$field/@id"/>455</code>456<xsl:text> of </xsl:text>457<code>458<xsl:value-of select="$field/../@id"/>459</code>460<xsl:choose>461<xsl:when test="$plural='plural'">462<xsl:text> are newly allocated arrays. The arrays</xsl:text>463</xsl:when>464<xsl:otherwise>465<xsl:text> is a newly allocated array. The array</xsl:text>466</xsl:otherwise>467</xsl:choose>468<xsl:text> should be freed with </xsl:text>469<a href="#Deallocate"><code>Deallocate</code></a>470<xsl:text>. </xsl:text>471472<xsl:apply-templates select="child::*[position()=1]" mode="fieldreturndescription">473<xsl:with-param name="plural" select="'plural'"/>474</xsl:apply-templates>475</xsl:template>476477<xsl:template match="ptrtype|vmbuf|jmethodID|jfieldID|jframeID|jrawMonitorID|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void" mode="fieldreturndescription">478</xsl:template>479480<xsl:template match="jclass|jthread|jobject|jvalue|jthreadGroup" mode="fieldreturndescription">481<xsl:param name="plural"/>482<xsl:variable name="field" select="ancestor::field"/>483<xsl:text>The object</xsl:text>484<xsl:if test="$plural='plural'">485<xsl:text>s</xsl:text>486</xsl:if>487<xsl:text> returned in the field </xsl:text>488<code>489<xsl:value-of select="$field/@id"/>490</code>491<xsl:text> of </xsl:text>492<code>493<xsl:value-of select="$field/../@id"/>494</code>495<xsl:choose>496<xsl:when test="$plural='plural'">497<xsl:text> are JNI local references and must be </xsl:text>498</xsl:when>499<xsl:otherwise>500<xsl:text> is a JNI local reference and must be </xsl:text>501</xsl:otherwise>502</xsl:choose>503<a href="#refs">managed</a>.504</xsl:template>505506<xsl:template match="nullok" mode="signature">507</xsl:template>508509<xsl:template match="jmethodID|jfieldID|jrawMonitorID|jclass|jthread|jobject|jvalue|jthreadGroup|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|size_t|void" mode="signature">510<xsl:value-of select="name()"/>511</xsl:template>512513<xsl:template match="jframeID" mode="signature">514<xsl:text>jint</xsl:text>515</xsl:template>516517<xsl:template match="uchar" mode="signature">518<xsl:text>unsigned char</xsl:text>519</xsl:template>520521<xsl:template match="enum|struct" mode="signature">522<xsl:value-of select="."/>523</xsl:template>524525<xsl:template match="varargs" mode="signature">526</xsl:template>527528<xsl:template match="outptr|outbuf|allocfieldbuf" mode="signature">529<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>530<xsl:text>*</xsl:text>531</xsl:template>532533<xsl:template match="ptrtype" mode="signature">534<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>535</xsl:template>536537<xsl:template match="inptr|inbuf|vmbuf" mode="signature">538<xsl:text>const </xsl:text>539<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>540<xsl:text>*</xsl:text>541</xsl:template>542543<xsl:template match="allocbuf|agentbuf" mode="signature">544<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>545<xsl:text>**</xsl:text>546</xsl:template>547548<xsl:template match="allocallocbuf" mode="signature">549<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>550<xsl:text>***</xsl:text>551</xsl:template>552553<xsl:template match="nullok" mode="link">554</xsl:template>555556<xsl:template match="jmethodID|jfieldID|jrawMonitorID|jclass|jthread|jobject|jvalue|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|jthreadGroup" mode="link">557<a>558<xsl:attribute name="href">559<xsl:text>#</xsl:text><xsl:value-of select="name()"/>560</xsl:attribute>561<xsl:value-of select="name()"/>562</a>563</xsl:template>564565<xsl:template match="jframeID" mode="link">566<a>567<xsl:attribute name="href">568<xsl:text>#jint</xsl:text>569</xsl:attribute>570<xsl:text>jint</xsl:text>571</a>572</xsl:template>573574<xsl:template match="enum|struct" mode="link">575<a>576<xsl:attribute name="href">577<xsl:text>#</xsl:text>578<xsl:value-of select="."/>579</xsl:attribute>580<xsl:value-of select="."/>581</a>582</xsl:template>583584<xsl:template match="char|size_t|void" mode="link">585<xsl:value-of select="name()"/>586</xsl:template>587588<xsl:template match="uchar" mode="link">589<xsl:text>unsigned char</xsl:text>590</xsl:template>591592<xsl:template match="varargs" mode="link">593<xsl:text>...</xsl:text>594</xsl:template>595596<xsl:template match="ptrtype" mode="link">597<xsl:apply-templates mode="link"/>598</xsl:template>599600<xsl:template match="outptr|outbuf|allocfieldbuf" mode="link">601<xsl:apply-templates mode="link"/>602<xsl:text>*</xsl:text>603</xsl:template>604605<xsl:template match="inptr|inbuf|vmbuf" mode="link">606<xsl:text>const </xsl:text>607<xsl:apply-templates mode="link"/>608<xsl:text>*</xsl:text>609</xsl:template>610611<xsl:template match="allocbuf|agentbuf" mode="link">612<xsl:apply-templates mode="link"/>613<xsl:text>**</xsl:text>614</xsl:template>615616<xsl:template match="allocallocbuf" mode="link">617<xsl:apply-templates mode="link"/>618<xsl:text>***</xsl:text>619</xsl:template>620621<xsl:template match="jmethodID|jfieldID|jframeID|jrawMonitorID|jclass|jobject|jvalue|jthreadGroup|jthread|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|size_t|void" mode="btsig">622<xsl:value-of select="name()"/>623</xsl:template>624625<xsl:template match="uchar" mode="btsig">626<xsl:text>unsigned char</xsl:text>627</xsl:template>628629<xsl:template match="enum|struct" mode="btsig">630<xsl:value-of select="."/>631</xsl:template>632633<xsl:template match="outbuf" mode="btsig">634<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>635<xsl:text>*</xsl:text>636</xsl:template>637638<xsl:template name="gentypedef">639<xsl:param name="tdef"/>640<xsl:text>typedef struct {641</xsl:text>642<xsl:apply-templates select="$tdef/field" mode="signature"/>643<xsl:text>} </xsl:text>644<xsl:value-of select="$tdef/@id"/>645<xsl:text>;</xsl:text>646</xsl:template>647648<xsl:template name="genuniontypedef">649<xsl:param name="tdef"/>650<xsl:text>typedef union {651</xsl:text>652<xsl:apply-templates select="$tdef/field" mode="signature"/>653<xsl:text>} </xsl:text>654<xsl:value-of select="$tdef/@id"/>655<xsl:text>;</xsl:text>656</xsl:template>657658659<xsl:template match="capabilitiestypedef" mode="genstruct">660<xsl:variable name="caps" select="count(capabilityfield)"/>661<xsl:text>typedef struct {662</xsl:text>663<xsl:apply-templates select="capabilityfield" mode="signature"/>664<xsl:variable name="rem" select="$caps mod 16"/>665<xsl:if test="$rem != 0">666<xsl:text> unsigned int : </xsl:text>667<xsl:value-of select="16 - $rem"/>668<xsl:text>;669</xsl:text>670</xsl:if>671<xsl:if test="$caps <= 32">672<xsl:text> unsigned int : 16;673</xsl:text>674</xsl:if>675<xsl:if test="$caps <= 48">676<xsl:text> unsigned int : 16;677</xsl:text>678</xsl:if>679<xsl:if test="$caps <= 64">680<xsl:text> unsigned int : 16;681</xsl:text>682</xsl:if>683<xsl:if test="$caps <= 80">684<xsl:text> unsigned int : 16;685</xsl:text>686</xsl:if>687<xsl:if test="$caps <= 96">688<xsl:text> unsigned int : 16;689</xsl:text>690</xsl:if>691<xsl:if test="$caps <= 112">692<xsl:text> unsigned int : 16;693</xsl:text>694</xsl:if>695<xsl:text>} </xsl:text>696<xsl:value-of select="@id"/>697<xsl:text>;</xsl:text>698</xsl:template>699700<xsl:template match="capabilityfield" mode="signature">701<xsl:text> unsigned int </xsl:text>702<xsl:value-of select="@id"/>703<xsl:text> : 1;704</xsl:text>705</xsl:template>706707<xsl:template match="constants" mode="enum">708<xsl:text>709typedef </xsl:text>710<xsl:apply-templates select="." mode="enumcore"/>711<xsl:text> </xsl:text>712<xsl:value-of select="@id"/>713<xsl:text>;</xsl:text>714</xsl:template>715716<xsl:template match="constants" mode="constants">717<xsl:text>718</xsl:text>719<xsl:apply-templates select="." mode="enumcore"/>720<xsl:text>;</xsl:text>721</xsl:template>722723<xsl:template match="constants" mode="enumcore">724<xsl:text>enum {725</xsl:text>726<xsl:for-each select="constant">727<xsl:if test="position() > 1">728<xsl:text>,729</xsl:text>730</xsl:if>731<xsl:apply-templates select="." mode="enum"/>732</xsl:for-each>733<xsl:text>734}</xsl:text>735</xsl:template>736737<xsl:template match="event" mode="enum">738<xsl:text> </xsl:text>739<xsl:value-of select="@const"/>740<xsl:text> = </xsl:text>741<xsl:value-of select="@num"/>742</xsl:template>743744<xsl:template match="constant|errorid" mode="enum">745<xsl:text> </xsl:text>746<xsl:value-of select="@id"/>747<xsl:text> = </xsl:text>748<xsl:value-of select="@num"/>749</xsl:template>750751752<xsl:template name="eventStruct">753<xsl:param name="events"/>754<xsl:param name="index"/>755<xsl:param name="started"/>756<xsl:param name="comment"/>757<xsl:variable name="thisEvent" select="$events[@num=$index]"/>758<xsl:choose>759<xsl:when test="count($thisEvent)=1">760<xsl:if test="$comment='Yes'">761<xsl:text> /* </xsl:text>762<xsl:number value="$index" format=" 1"/>763<xsl:text> : </xsl:text>764<xsl:value-of select="$thisEvent/@label"/>765<xsl:text> */766</xsl:text>767</xsl:if>768<xsl:text> jvmtiEvent</xsl:text>769<xsl:value-of select="$thisEvent/@id"/>770<xsl:text> </xsl:text>771<xsl:value-of select="$thisEvent/@id"/>772<xsl:text>;773</xsl:text>774</xsl:when>775<xsl:otherwise>776<xsl:if test="$started">777<xsl:if test="$comment='Yes'">778<xsl:text> /* </xsl:text>779<xsl:number value="$index" format=" 1"/>780<xsl:text> */781</xsl:text>782</xsl:if>783<xsl:text> jvmtiEventReserved reserved</xsl:text>784<xsl:value-of select="$index"/>785<xsl:text>;786</xsl:text>787</xsl:if>788</xsl:otherwise>789</xsl:choose>790<xsl:if test="count($events[@num > $index]) > 0">791<xsl:call-template name="eventStruct">792<xsl:with-param name="events" select="$events"/>793<xsl:with-param name="index" select="1+$index"/>794<xsl:with-param name="started" select="$started or count($thisEvent)=1"/>795<xsl:with-param name="comment" select="$comment"/>796</xsl:call-template>797</xsl:if>798</xsl:template>799800801<!-- ======== HotSpotType ======== -->802803<xsl:template match="parameters" mode="HotSpotSig">804<xsl:variable name="length" select="count(param)"/>805<xsl:for-each select="param">806<xsl:variable name="separator">807<xsl:choose>808<xsl:when test="position()=$length">809<xsl:text></xsl:text>810</xsl:when>811<xsl:otherwise>812<xsl:text>, </xsl:text>813</xsl:otherwise>814</xsl:choose>815</xsl:variable>816<xsl:apply-templates select="." mode="HotSpotSig">817<xsl:with-param name="comma" select="$separator"/>818</xsl:apply-templates>819</xsl:for-each>820</xsl:template>821822<xsl:template match="param" mode="HotSpotSig">823<xsl:param name="comma"/>824<xsl:variable name="result">825<xsl:apply-templates select="child::*[position()=1]" mode="HotSpotType"/>826</xsl:variable>827<xsl:if test="string-length($result)!=0">828<xsl:value-of select="$result"/>829<xsl:text> </xsl:text>830<xsl:apply-templates select="child::*[position()=1]" mode="HotSpotName">831<xsl:with-param name="name" select="@id"/>832</xsl:apply-templates>833<xsl:value-of select="$comma"/>834</xsl:if>835</xsl:template>836837<xsl:template match="jthread" mode="HotSpotType">838<xsl:choose>839<xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))">840<xsl:text>JavaThread*</xsl:text>841</xsl:when>842<xsl:otherwise>843<xsl:value-of select="name()"/>844</xsl:otherwise>845</xsl:choose>846</xsl:template>847848<xsl:template match="jrawMonitorID" mode="HotSpotType">849<xsl:text>JvmtiRawMonitor *</xsl:text>850</xsl:template>851852<xsl:template match="jframeID" mode="HotSpotType">853<xsl:text>jint</xsl:text>854</xsl:template>855856<xsl:template match="jmethodID" mode="HotSpotType">857<xsl:text>Method*</xsl:text>858</xsl:template>859860<xsl:template match="jfieldID" mode="HotSpotType">861<xsl:text>fieldDescriptor*</xsl:text>862</xsl:template>863864<xsl:template match="jclass" mode="HotSpotType">865<!--866classes passed as part of a class/method or class/field pair are used867by the wrapper to get the internal type but are not needed by nor868passed to the implementation layer.869-->870<xsl:if test="count(@method|@field)=0">871<xsl:text>oop</xsl:text>872</xsl:if>873</xsl:template>874875<xsl:template match="nullok" mode="HotSpotType">876</xsl:template>877878<xsl:template match="jobject|jvalue|jthreadGroup|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|struct" mode="HotSpotType">879<xsl:apply-templates select="." mode="btsig"/>880</xsl:template>881882<xsl:template match="varargs" mode="HotSpotType">883<xsl:text> </xsl:text>884</xsl:template>885886<xsl:template match="outptr|outbuf|allocfieldbuf" mode="HotSpotType">887<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>888<xsl:text>*</xsl:text>889</xsl:template>890891<xsl:template match="ptrtype" mode="HotSpotType">892<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>893</xsl:template>894895<xsl:template match="inptr|inbuf|vmbuf" mode="HotSpotType">896<xsl:text>const </xsl:text>897<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>898<xsl:text>*</xsl:text>899</xsl:template>900901<xsl:template match="allocbuf|agentbuf" mode="HotSpotType">902<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>903<xsl:text>**</xsl:text>904</xsl:template>905906<xsl:template match="allocallocbuf" mode="HotSpotType">907<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>908<xsl:text>***</xsl:text>909</xsl:template>910911<!-- ======== HotSpotName ======== -->912913<xsl:template match="jthread" mode="HotSpotName">914<xsl:param name="name"/>915<xsl:choose>916<xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))">917<xsl:text>java_thread</xsl:text>918</xsl:when>919<xsl:otherwise>920<xsl:value-of select="$name"/>921</xsl:otherwise>922</xsl:choose>923</xsl:template>924925<xsl:template match="jrawMonitorID" mode="HotSpotName">926<xsl:text>rmonitor</xsl:text>927</xsl:template>928929<xsl:template match="jframeID" mode="HotSpotName">930<xsl:text>depth</xsl:text>931</xsl:template>932933<xsl:template match="jmethodID" mode="HotSpotName">934<xsl:text>checked_method</xsl:text>935</xsl:template>936937<xsl:template match="jfieldID" mode="HotSpotName">938<xsl:text>fdesc_ptr</xsl:text>939</xsl:template>940941<xsl:template match="jclass" mode="HotSpotName">942<!--943classes passed as part of a class/method or class/field pair are used944by the wrapper to get the internal type but are not needed by nor945passed to the implementation layer. This value is checked for empty.946-->947<xsl:if test="count(@method|@field)=0">948<xsl:text>k_mirror</xsl:text>949</xsl:if>950</xsl:template>951952<xsl:template match="nullok" mode="HotSpotName">953</xsl:template>954955<xsl:template match="jobject|jvalue|jthreadGroup|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct|outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="HotSpotName">956<xsl:param name="name"/>957<xsl:value-of select="$name"/>958</xsl:template>959960<!-- ======== HotSpotValue ======== -->961962963<xsl:template match="parameters" mode="HotSpotValue">964<xsl:variable name="length" select="count(param)"/>965<xsl:for-each select="param">966<xsl:variable name="separator">967<xsl:choose>968<xsl:when test="position()=$length">969<xsl:text></xsl:text>970</xsl:when>971<xsl:otherwise>972<xsl:text>, </xsl:text>973</xsl:otherwise>974</xsl:choose>975</xsl:variable>976<xsl:apply-templates select="." mode="HotSpotValue">977<xsl:with-param name="comma" select="$separator"/>978</xsl:apply-templates>979</xsl:for-each>980</xsl:template>981982<xsl:template match="param" mode="HotSpotValue">983<xsl:param name="comma"/>984<xsl:variable name="result">985<xsl:apply-templates select="child::*[position()=1]" mode="HotSpotValue">986<xsl:with-param name="name" select="@id"/>987</xsl:apply-templates>988</xsl:variable>989<xsl:if test="string-length($result)!=0">990<xsl:value-of select="$result"/>991<xsl:value-of select="$comma"/>992</xsl:if>993</xsl:template>994995<xsl:template match="jframeID|jmethodID|jrawMonitorID|jthread|jclass|nullok" mode="HotSpotValue">996<xsl:param name="name"/>997<xsl:apply-templates select="." mode="HotSpotName">998<xsl:with-param name="name" select="$name"/>999</xsl:apply-templates>1000</xsl:template>10011002<xsl:template match="jfieldID" mode="HotSpotValue">1003<xsl:text>&fdesc</xsl:text>1004</xsl:template>10051006<xsl:template match="jobject|jvalue|jthreadGroup|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|struct|outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="HotSpotValue">1007<xsl:param name="name"/>1008<xsl:value-of select="$name"/>1009</xsl:template>10101011<xsl:template match="varargs" mode="HotSpotValue">1012<xsl:text>NULL</xsl:text>1013</xsl:template>10141015</xsl:stylesheet>1016101710181019