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

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

</xsl:text>
94
<xsl:template name="include_GPL_CP_Header">
95
<xsl:call-template name="GPL_CP_copyrightComment"/>
96
<xsl:text> /* AUTOMATICALLY GENERATED FILE - DO NOT EDIT */
</xsl:text>
99
<xsl:template name="includeHeader">
100
<xsl:call-template name="copyrightComment"/>
101
<xsl:text> /* AUTOMATICALLY GENERATED FILE - DO NOT EDIT */
</xsl:text>
104
<xsl:template name="sourceHeader">
105
<xsl:call-template name="copyrightComment"/>
106
<xsl:text> // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
</xsl:text>
110
<xsl:template match="parameters" mode="signature">
111
<xsl:param name="comma">
115
<xsl:if test="count(param) != 0">
116
<xsl:value-of select="$comma"/>
118
<xsl:apply-templates select="." mode="signaturenoleadcomma">
119
<xsl:with-param name="comma" select="$comma"/>
120
</xsl:apply-templates>
124
<xsl:template match="parameters" mode="signaturenoleadcomma">
125
<xsl:param name="comma">
129
<xsl:variable name="length" select="count(param)"/>
130
<xsl:for-each select="param">
131
<xsl:variable name="separator">
133
<xsl:when test="position()=$length">
134
<xsl:text></xsl:text>
137
<xsl:value-of select="$comma"/>
141
<xsl:apply-templates select="." mode="signature">
142
<xsl:with-param name="comma" select="$separator"/>
143
</xsl:apply-templates>
148
<!-- remove jclass parameters that are jclass/jmethodID pairs.
149
since the jclass was removed in JVMTI.
151
<xsl:template match="param" mode="signature">
152
<xsl:param name="comma"/>
153
<xsl:variable name="id" select="@id"/>
154
<xsl:for-each select="child::*[position()=1]">
155
<xsl:if test="count(@method)=0">
156
<xsl:apply-templates select="." mode="signature"/>
157
<xsl:text> </xsl:text>
158
<xsl:value-of select="$id"/>
159
<xsl:value-of select="$comma"/>
165
<xsl:template match="field" mode="signature">
166
<xsl:text> </xsl:text>
167
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
168
<xsl:text> </xsl:text>
169
<xsl:value-of select="@id"/>
174
<xsl:template match="nullok" mode="funcdescription">
177
<xsl:value-of select="../../@id"/>
180
<code>null</code> pointer, <xsl:apply-templates/>.
183
<xsl:template match="vmbuf|allocfieldbuf|struct" mode="funcdescription">
184
<xsl:message terminate="yes">
185
vmbuf|allocfieldbuf|struct as type of function parameter
189
<xsl:template match="ptrtype" mode="funcdescription">
191
<xsl:apply-templates select="nullok" mode="funcdescription"/>
194
<xsl:template match="inptr" mode="funcdescription">
196
<xsl:variable name="child" select="child::*[position()=1]"/>
197
<xsl:text>Agent passes in a pointer</xsl:text>
198
<xsl:if test="name($child)!='void'">
199
<xsl:text> to </xsl:text>
201
<xsl:apply-templates select="$child" mode="signature"/>
204
<xsl:text>. </xsl:text>
205
<xsl:apply-templates select="nullok" mode="funcdescription"/>
208
<xsl:template match="inbuf" mode="funcdescription">
210
<xsl:variable name="child" select="child::*[position()=1]"/>
211
<xsl:text>Agent passes in </xsl:text>
213
<xsl:when test="name($child)='void'">
214
<xsl:text> a pointer</xsl:text>
217
<xsl:text> an array of </xsl:text>
218
<xsl:if test="count(@incount)=1 and @incount!=''">
220
<xsl:value-of select="@incount"/>
222
<xsl:text> elements of </xsl:text>
225
<xsl:apply-templates select="$child" mode="signature"/>
229
<xsl:text>. </xsl:text>
230
<xsl:apply-templates select="nullok" mode="funcdescription"/>
233
<xsl:template match="outptr" mode="funcdescription">
235
<xsl:text>Agent passes a pointer to a </xsl:text>
237
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
239
<xsl:text>. </xsl:text>
240
<xsl:text>On return, the </xsl:text>
242
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
244
<xsl:text> has been set. </xsl:text>
245
<xsl:apply-templates select="nullok" mode="funcdescription"/>
246
<xsl:apply-templates select="child::*[position()=1]" mode="returndescription"/>
249
<xsl:template match="allocbuf" mode="funcdescription">
251
<xsl:text>Agent passes a pointer to a </xsl:text>
253
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
254
<xsl:text>*</xsl:text>
256
<xsl:text>. </xsl:text>
257
<xsl:text>On return, the </xsl:text>
259
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
260
<xsl:text>*</xsl:text>
262
<xsl:text> points to a newly allocated array</xsl:text>
264
<xsl:when test="count(@outcount)=1 and @outcount!=''">
265
<xsl:text> of size </xsl:text>
267
<xsl:text>*</xsl:text>
268
<xsl:value-of select="@outcount"/>
272
<xsl:if test="count(@incount)=1 and @incount!=''">
273
<xsl:text> of size </xsl:text>
275
<xsl:value-of select="@incount"/>
280
<xsl:text>. The array should be freed with </xsl:text>
281
<a href="#Deallocate"><code>Deallocate</code></a>
282
<xsl:text>. </xsl:text>
283
<xsl:apply-templates select="nullok" mode="funcdescription"/>
284
<xsl:apply-templates select="child::*[position()=1]" mode="returndescription">
285
<xsl:with-param name="plural" select="'plural'"/>
286
</xsl:apply-templates>
289
<xsl:template match="allocallocbuf" mode="funcdescription">
291
<xsl:text>Agent passes a pointer to a </xsl:text>
293
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
294
<xsl:text>**</xsl:text>
296
<xsl:text>. </xsl:text>
297
<xsl:text>On return, the </xsl:text>
299
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
300
<xsl:text>**</xsl:text>
302
<xsl:text> points to a newly allocated array</xsl:text>
304
<xsl:when test="count(@outcount)=1 and @outcount!=''">
305
<xsl:text> of size </xsl:text>
307
<xsl:text>*</xsl:text>
308
<xsl:value-of select="@outcount"/>
312
<xsl:if test="count(@incount)=1 and @incount!=''">
313
<xsl:text> of size </xsl:text>
315
<xsl:value-of select="@incount"/>
320
<xsl:text>, each element of which is also newly allocated.
321
The array should be freed with </xsl:text>
322
<a href="#Deallocate"><code>Deallocate</code></a>
324
Each of the elements should be freed with </xsl:text>
325
<a href="#Deallocate"><code>Deallocate</code></a>
326
<xsl:text>. </xsl:text>
327
<xsl:apply-templates select="nullok" mode="funcdescription"/>
328
<xsl:apply-templates select="child::*[position()=1]" mode="returndescription">
329
<xsl:with-param name="plural" select="'plural'"/>
330
</xsl:apply-templates>
333
<xsl:template match="outbuf" mode="funcdescription">
335
<xsl:text>Agent passes an array </xsl:text>
336
<xsl:if test="count(@incount)=1 and @incount!=''">
337
<xsl:text>large enough to hold </xsl:text>
339
<xsl:value-of select="@incount"/>
341
<xsl:text> elements </xsl:text>
343
<xsl:text>of </xsl:text>
345
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
347
<xsl:text>. The incoming values of the elements of the array are ignored. </xsl:text>
348
<xsl:text>On return, </xsl:text>
349
<xsl:if test="count(@outcount)=1 and @outcount!=''">
351
<xsl:text>*</xsl:text>
352
<xsl:value-of select="@outcount"/>
354
<xsl:text> of </xsl:text>
356
<xsl:text>the elements are set. </xsl:text>
357
<xsl:apply-templates select="nullok" mode="funcdescription"/>
358
<xsl:apply-templates select="child::*[position()=1]" mode="returndescription">
359
<xsl:with-param name="plural" select="'plural'"/>
360
</xsl:apply-templates>
363
<xsl:template match="agentbuf" mode="funcdescription">
365
<xsl:apply-templates select="nullok" mode="funcdescription"/>
366
<xsl:apply-templates select="child::*[position()=1]" mode="returndescription">
367
<xsl:with-param name="plural" select="'plural'"/>
368
</xsl:apply-templates>
371
<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">
374
<xsl:template match="jthread" mode="funcdescription">
375
<xsl:if test="count(@null)!=0">
378
<xsl:value-of select="../@id"/>
381
null, the current thread is used.
385
<xsl:template match="jmethodID|jfieldID|jframeID|jrawMonitorID|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs" mode="returndescription">
388
<xsl:template match="struct" mode="returndescription">
389
<xsl:param name="plural"/>
390
<xsl:variable name="structname" select="."/>
391
<xsl:for-each select="//typedef[@id=$structname]|//uniontypedef[@id=$structname]">
392
<xsl:for-each select="field">
393
<xsl:apply-templates select="child::*[position()=1]" mode="fieldreturndescription">
394
<xsl:with-param name="plural" select="$plural"/>
395
</xsl:apply-templates>
400
<xsl:template match="jclass|jthread|jobject|jvalue|jthreadGroup" mode="returndescription">
401
<xsl:param name="plural"/>
402
<xsl:text>The object</xsl:text>
403
<xsl:if test="$plural='plural'">
404
<xsl:text>s</xsl:text>
406
<xsl:text> returned by </xsl:text>
408
<xsl:value-of select="../../@id"/>
411
<xsl:when test="$plural='plural'">
412
<xsl:text> are JNI local references and must be </xsl:text>
415
<xsl:text> is a JNI local reference and must be </xsl:text>
418
<a href="#refs">managed</a>.
421
<xsl:template match="outptr|inptr|inbuf|agentbuf|allocbuf|allocallocbuf" mode="fieldreturndescription">
422
<xsl:variable name="field" select="ancestor::field"/>
423
<xsl:message terminate="yes">
424
outptr, allocallocbuf, outbuf, vmbuf, allocbuf, inptr, inbuf or agentbuf as type of returned field:
425
<xsl:value-of select="$field/@id"/> of <xsl:value-of select="$field/../@id"/>
429
<xsl:template match="outbuf" mode="fieldreturndescription">
430
<!-- hand document this special case.
434
<xsl:template match="struct" mode="fieldreturndescription">
435
<xsl:param name="plural"/>
436
<xsl:variable name="structname" select="."/>
437
<xsl:for-each select="//typedef[@id=$structname]|//uniontypedef[@id=$structname]">
438
<xsl:for-each select="field">
439
<xsl:apply-templates select="child::*[position()=1]" mode="fieldreturndescription">
440
<xsl:with-param name="plural" select="$plural"/>
441
</xsl:apply-templates>
446
<xsl:template match="allocfieldbuf" mode="fieldreturndescription">
447
<xsl:param name="plural"/>
448
<xsl:variable name="field" select="ancestor::field"/>
449
<xsl:text>The pointer</xsl:text>
450
<xsl:if test="$plural='plural'">
451
<xsl:text>s</xsl:text>
453
<xsl:text> returned in the field </xsl:text>
455
<xsl:value-of select="$field/@id"/>
457
<xsl:text> of </xsl:text>
459
<xsl:value-of select="$field/../@id"/>
462
<xsl:when test="$plural='plural'">
463
<xsl:text> are newly allocated arrays. The arrays</xsl:text>
466
<xsl:text> is a newly allocated array. The array</xsl:text>
469
<xsl:text> should be freed with </xsl:text>
470
<a href="#Deallocate"><code>Deallocate</code></a>
471
<xsl:text>. </xsl:text>
473
<xsl:apply-templates select="child::*[position()=1]" mode="fieldreturndescription">
474
<xsl:with-param name="plural" select="'plural'"/>
475
</xsl:apply-templates>
478
<xsl:template match="ptrtype|vmbuf|jmethodID|jfieldID|jframeID|jrawMonitorID|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void" mode="fieldreturndescription">
481
<xsl:template match="jclass|jthread|jobject|jvalue|jthreadGroup" mode="fieldreturndescription">
482
<xsl:param name="plural"/>
483
<xsl:variable name="field" select="ancestor::field"/>
484
<xsl:text>The object</xsl:text>
485
<xsl:if test="$plural='plural'">
486
<xsl:text>s</xsl:text>
488
<xsl:text> returned in the field </xsl:text>
490
<xsl:value-of select="$field/@id"/>
492
<xsl:text> of </xsl:text>
494
<xsl:value-of select="$field/../@id"/>
497
<xsl:when test="$plural='plural'">
498
<xsl:text> are JNI local references and must be </xsl:text>
501
<xsl:text> is a JNI local reference and must be </xsl:text>
504
<a href="#refs">managed</a>.
507
<xsl:template match="nullok" mode="signature">
510
<xsl:template match="jmethodID|jfieldID|jrawMonitorID|jclass|jthread|jobject|jvalue|jthreadGroup|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|size_t|void" mode="signature">
511
<xsl:value-of select="name()"/>
514
<xsl:template match="jframeID" mode="signature">
515
<xsl:text>jint</xsl:text>
518
<xsl:template match="uchar" mode="signature">
519
<xsl:text>unsigned char</xsl:text>
522
<xsl:template match="enum|struct" mode="signature">
523
<xsl:value-of select="."/>
526
<xsl:template match="varargs" mode="signature">
529
<xsl:template match="outptr|outbuf|allocfieldbuf" mode="signature">
530
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
531
<xsl:text>*</xsl:text>
534
<xsl:template match="ptrtype" mode="signature">
535
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
538
<xsl:template match="inptr|inbuf|vmbuf" mode="signature">
539
<xsl:text>const </xsl:text>
540
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
541
<xsl:text>*</xsl:text>
544
<xsl:template match="allocbuf|agentbuf" mode="signature">
545
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
546
<xsl:text>**</xsl:text>
549
<xsl:template match="allocallocbuf" mode="signature">
550
<xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
551
<xsl:text>***</xsl:text>
554
<xsl:template match="nullok" mode="link">
557
<xsl:template match="jmethodID|jfieldID|jrawMonitorID|jclass|jthread|jobject|jvalue|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|jthreadGroup" mode="link">
559
<xsl:attribute name="href">
560
<xsl:text>#</xsl:text><xsl:value-of select="name()"/>
562
<xsl:value-of select="name()"/>
566
<xsl:template match="jframeID" mode="link">
568
<xsl:attribute name="href">
569
<xsl:text>#jint</xsl:text>
571
<xsl:text>jint</xsl:text>
575
<xsl:template match="enum|struct" mode="link">
577
<xsl:attribute name="href">
578
<xsl:text>#</xsl:text>
579
<xsl:value-of select="."/>
581
<xsl:value-of select="."/>
585
<xsl:template match="char|size_t|void" mode="link">
586
<xsl:value-of select="name()"/>
589
<xsl:template match="uchar" mode="link">
590
<xsl:text>unsigned char</xsl:text>
593
<xsl:template match="varargs" mode="link">
594
<xsl:text>...</xsl:text>
597
<xsl:template match="ptrtype" mode="link">
598
<xsl:apply-templates mode="link"/>
601
<xsl:template match="outptr|outbuf|allocfieldbuf" mode="link">
602
<xsl:apply-templates mode="link"/>
603
<xsl:text>*</xsl:text>
606
<xsl:template match="inptr|inbuf|vmbuf" mode="link">
607
<xsl:text>const </xsl:text>
608
<xsl:apply-templates mode="link"/>
609
<xsl:text>*</xsl:text>
612
<xsl:template match="allocbuf|agentbuf" mode="link">
613
<xsl:apply-templates mode="link"/>
614
<xsl:text>**</xsl:text>
617
<xsl:template match="allocallocbuf" mode="link">
618
<xsl:apply-templates mode="link"/>
619
<xsl:text>***</xsl:text>
622
<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">
623
<xsl:value-of select="name()"/>
626
<xsl:template match="uchar" mode="btsig">
627
<xsl:text>unsigned char</xsl:text>
630
<xsl:template match="enum|struct" mode="btsig">
631
<xsl:value-of select="."/>
634
<xsl:template match="outbuf" mode="btsig">
635
<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>
636
<xsl:text>*</xsl:text>
639
<xsl:template name="gentypedef">
640
<xsl:param name="tdef"/>
641
<xsl:text>typedef struct {
643
<xsl:apply-templates select="$tdef/field" mode="signature"/>
644
<xsl:text>} </xsl:text>
645
<xsl:value-of select="$tdef/@id"/>
646
<xsl:text>;</xsl:text>
649
<xsl:template name="genuniontypedef">
650
<xsl:param name="tdef"/>
651
<xsl:text>typedef union {
653
<xsl:apply-templates select="$tdef/field" mode="signature"/>
654
<xsl:text>} </xsl:text>
655
<xsl:value-of select="$tdef/@id"/>
656
<xsl:text>;</xsl:text>
660
<xsl:template match="capabilitiestypedef" mode="genstruct">
661
<xsl:variable name="caps" select="count(capabilityfield)"/>
662
<xsl:text>typedef struct {
664
<xsl:apply-templates select="capabilityfield" mode="signature"/>
665
<xsl:variable name="rem" select="$caps mod 16"/>
666
<xsl:if test="$rem != 0">
667
<xsl:text> unsigned int : </xsl:text>
668
<xsl:value-of select="16 - $rem"/>
672
<xsl:if test="$caps <= 32">
673
<xsl:text> unsigned int : 16;
676
<xsl:if test="$caps <= 48">
677
<xsl:text> unsigned int : 16;
680
<xsl:if test="$caps <= 64">
681
<xsl:text> unsigned int : 16;
684
<xsl:if test="$caps <= 80">
685
<xsl:text> unsigned int : 16;
688
<xsl:if test="$caps <= 96">
689
<xsl:text> unsigned int : 16;
692
<xsl:if test="$caps <= 112">
693
<xsl:text> unsigned int : 16;
696
<xsl:text>} </xsl:text>
697
<xsl:value-of select="@id"/>
698
<xsl:text>;</xsl:text>
701
<xsl:template match="capabilityfield" mode="signature">
702
<xsl:text> unsigned int </xsl:text>
703
<xsl:value-of select="@id"/>
708
<xsl:template match="constants" mode="enum">
711
<xsl:apply-templates select="." mode="enumcore"/>
712
<xsl:text> </xsl:text>
713
<xsl:value-of select="@id"/>
714
<xsl:text>;</xsl:text>
717
<xsl:template match="constants" mode="constants">
720
<xsl:apply-templates select="." mode="enumcore"/>
721
<xsl:text>;</xsl:text>
724
<xsl:template match="constants" mode="enumcore">
727
<xsl:for-each select="constant">
728
<xsl:if test="position() > 1">
732
<xsl:apply-templates select="." mode="enum"/>
738
<xsl:template match="event" mode="enum">
739
<xsl:text> </xsl:text>
740
<xsl:value-of select="@const"/>
741
<xsl:text> = </xsl:text>
742
<xsl:value-of select="@num"/>
745
<xsl:template match="constant|errorid" mode="enum">
746
<xsl:text> </xsl:text>
747
<xsl:value-of select="@id"/>
748
<xsl:text> = </xsl:text>
749
<xsl:value-of select="@num"/>
753
<xsl:template name="eventStruct">
754
<xsl:param name="events"/>
755
<xsl:param name="index"/>
756
<xsl:param name="started"/>
757
<xsl:param name="comment"/>
758
<xsl:variable name="thisEvent" select="$events[@num=$index]"/>
760
<xsl:when test="count($thisEvent)=1">
761
<xsl:if test="$comment='Yes'">
762
<xsl:text> /* </xsl:text>
763
<xsl:number value="$index" format=" 1"/>
764
<xsl:text> : </xsl:text>
765
<xsl:value-of select="$thisEvent/@label"/>
769
<xsl:text> jvmtiEvent</xsl:text>
770
<xsl:value-of select="$thisEvent/@id"/>
771
<xsl:text> </xsl:text>
772
<xsl:value-of select="$thisEvent/@id"/>
777
<xsl:if test="$started">
778
<xsl:if test="$comment='Yes'">
779
<xsl:text> /* </xsl:text>
780
<xsl:number value="$index" format=" 1"/>
784
<xsl:text> jvmtiEventReserved reserved</xsl:text>
785
<xsl:value-of select="$index"/>
791
<xsl:if test="count($events[@num > $index]) > 0">
792
<xsl:call-template name="eventStruct">
793
<xsl:with-param name="events" select="$events"/>
794
<xsl:with-param name="index" select="1+$index"/>
795
<xsl:with-param name="started" select="$started or count($thisEvent)=1"/>
796
<xsl:with-param name="comment" select="$comment"/>
802
<!-- ======== HotSpotType ======== -->
804
<xsl:template match="parameters" mode="HotSpotSig">
805
<xsl:variable name="length" select="count(param)"/>
806
<xsl:for-each select="param">
807
<xsl:variable name="separator">
809
<xsl:when test="position()=$length">
810
<xsl:text></xsl:text>
813
<xsl:text>, </xsl:text>
817
<xsl:apply-templates select="." mode="HotSpotSig">
818
<xsl:with-param name="comma" select="$separator"/>
819
</xsl:apply-templates>
823
<xsl:template match="param" mode="HotSpotSig">
824
<xsl:param name="comma"/>
825
<xsl:variable name="result">
826
<xsl:apply-templates select="child::*[position()=1]" mode="HotSpotType"/>
828
<xsl:if test="string-length($result)!=0">
829
<xsl:value-of select="$result"/>
830
<xsl:text> </xsl:text>
831
<xsl:apply-templates select="child::*[position()=1]" mode="HotSpotName">
832
<xsl:with-param name="name" select="@id"/>
833
</xsl:apply-templates>
834
<xsl:value-of select="$comma"/>
838
<xsl:template match="jthread" mode="HotSpotType">
840
<xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))">
841
<xsl:text>JavaThread*</xsl:text>
844
<xsl:value-of select="name()"/>
849
<xsl:template match="jrawMonitorID" mode="HotSpotType">
850
<xsl:text>JvmtiRawMonitor *</xsl:text>
853
<xsl:template match="jframeID" mode="HotSpotType">
854
<xsl:text>jint</xsl:text>
857
<xsl:template match="jmethodID" mode="HotSpotType">
858
<xsl:text>Method*</xsl:text>
861
<xsl:template match="jfieldID" mode="HotSpotType">
862
<xsl:text>fieldDescriptor*</xsl:text>
865
<xsl:template match="jclass" mode="HotSpotType">
867
classes passed as part of a class/method or class/field pair are used
868
by the wrapper to get the internal type but are not needed by nor
869
passed to the implementation layer.
871
<xsl:if test="count(@method|@field)=0">
872
<xsl:text>oop</xsl:text>
876
<xsl:template match="nullok" mode="HotSpotType">
879
<xsl:template match="jobject|jvalue|jthreadGroup|enum|jint|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|struct" mode="HotSpotType">
880
<xsl:apply-templates select="." mode="btsig"/>
883
<xsl:template match="varargs" mode="HotSpotType">
884
<xsl:text> </xsl:text>
887
<xsl:template match="outptr|outbuf|allocfieldbuf" mode="HotSpotType">
888
<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>
889
<xsl:text>*</xsl:text>
892
<xsl:template match="ptrtype" mode="HotSpotType">
893
<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>
896
<xsl:template match="inptr|inbuf|vmbuf" mode="HotSpotType">
897
<xsl:text>const </xsl:text>
898
<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>
899
<xsl:text>*</xsl:text>
902
<xsl:template match="allocbuf|agentbuf" mode="HotSpotType">
903
<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>
904
<xsl:text>**</xsl:text>
907
<xsl:template match="allocallocbuf" mode="HotSpotType">
908
<xsl:apply-templates select="child::*[position()=1]" mode="btsig"/>
909
<xsl:text>***</xsl:text>
912
<!-- ======== HotSpotName ======== -->
914
<xsl:template match="jthread" mode="HotSpotName">
915
<xsl:param name="name"/>
917
<xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))">
918
<xsl:text>java_thread</xsl:text>
921
<xsl:value-of select="$name"/>
926
<xsl:template match="jrawMonitorID" mode="HotSpotName">
927
<xsl:text>rmonitor</xsl:text>
930
<xsl:template match="jframeID" mode="HotSpotName">
931
<xsl:text>depth</xsl:text>
934
<xsl:template match="jmethodID" mode="HotSpotName">
935
<xsl:text>checked_method</xsl:text>
938
<xsl:template match="jfieldID" mode="HotSpotName">
939
<xsl:text>fdesc_ptr</xsl:text>
942
<xsl:template match="jclass" mode="HotSpotName">
944
classes passed as part of a class/method or class/field pair are used
945
by the wrapper to get the internal type but are not needed by nor
946
passed to the implementation layer. This value is checked for empty.
948
<xsl:if test="count(@method|@field)=0">
949
<xsl:text>k_mirror</xsl:text>
953
<xsl:template match="nullok" mode="HotSpotName">
956
<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">
957
<xsl:param name="name"/>
958
<xsl:value-of select="$name"/>
961
<!-- ======== HotSpotValue ======== -->
964
<xsl:template match="parameters" mode="HotSpotValue">
965
<xsl:variable name="length" select="count(param)"/>
966
<xsl:for-each select="param">
967
<xsl:variable name="separator">
969
<xsl:when test="position()=$length">
970
<xsl:text></xsl:text>
973
<xsl:text>, </xsl:text>
977
<xsl:apply-templates select="." mode="HotSpotValue">
978
<xsl:with-param name="comma" select="$separator"/>
979
</xsl:apply-templates>
983
<xsl:template match="param" mode="HotSpotValue">
984
<xsl:param name="comma"/>
985
<xsl:variable name="result">
986
<xsl:apply-templates select="child::*[position()=1]" mode="HotSpotValue">
987
<xsl:with-param name="name" select="@id"/>
988
</xsl:apply-templates>
990
<xsl:if test="string-length($result)!=0">
991
<xsl:value-of select="$result"/>
992
<xsl:value-of select="$comma"/>
996
<xsl:template match="jframeID|jmethodID|jrawMonitorID|jthread|jclass|nullok" mode="HotSpotValue">
997
<xsl:param name="name"/>
998
<xsl:apply-templates select="." mode="HotSpotName">
999
<xsl:with-param name="name" select="$name"/>
1000
</xsl:apply-templates>
1003
<xsl:template match="jfieldID" mode="HotSpotValue">
1004
<xsl:text>&fdesc</xsl:text>
1007
<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">
1008
<xsl:param name="name"/>
1009
<xsl:value-of select="$name"/>
1012
<xsl:template match="varargs" mode="HotSpotValue">
1013
<xsl:text>nullptr</xsl:text>