Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/prims/jvmtiEnter.xsl
32285 views
1
<?xml version="1.0"?>
2
<!--
3
Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
4
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
6
This code is free software; you can redistribute it and/or modify it
7
under the terms of the GNU General Public License version 2 only, as
8
published by the Free Software Foundation.
9
10
This code is distributed in the hope that it will be useful, but WITHOUT
11
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
version 2 for more details (a copy is included in the LICENSE file that
14
accompanied this code).
15
16
You should have received a copy of the GNU General Public License version
17
2 along with this work; if not, write to the Free Software Foundation,
18
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21
or visit www.oracle.com if you need additional information or have any
22
questions.
23
24
-->
25
26
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
27
28
<xsl:import href="jvmtiLib.xsl"/>
29
30
<xsl:output method="text" indent="no" omit-xml-declaration="yes"/>
31
32
<xsl:param name="trace"></xsl:param>
33
<xsl:param name="interface"></xsl:param>
34
35
36
<xsl:template match="specification">
37
<xsl:call-template name="sourceHeader"/>
38
<xsl:text>
39
# include "precompiled.hpp"
40
# include "utilities/macros.hpp"
41
#if INCLUDE_JVMTI
42
# include "prims/jvmtiEnter.hpp"
43
# include "prims/jvmtiRawMonitor.hpp"
44
# include "prims/jvmtiUtil.hpp"
45
46
// There are known-bad format/arg pairings in the code generated by this file.
47
PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
48
49
</xsl:text>
50
51
<xsl:if test="$trace = 'Trace'">
52
<xsl:text>
53
#ifdef JVMTI_TRACE
54
</xsl:text>
55
</xsl:if>
56
57
<xsl:if test="$trace != 'Trace'">
58
<xsl:text>
59
60
// Error names
61
const char* JvmtiUtil::_error_names[] = {
62
</xsl:text>
63
<xsl:call-template name="fillEntityName">
64
<xsl:with-param name="entities" select="errorsection/errorcategory/errorid"/>
65
</xsl:call-template>
66
<xsl:text>
67
};
68
69
70
// Event threaded
71
const bool JvmtiUtil::_event_threaded[] = {
72
</xsl:text>
73
<xsl:call-template name="fillEventThreaded">
74
<xsl:with-param name="entities" select="eventsection/event"/>
75
</xsl:call-template>
76
<xsl:text>
77
};
78
79
</xsl:text>
80
<xsl:call-template name="eventCapabilitiesTest"/>
81
</xsl:if>
82
83
<xsl:if test="$trace = 'Trace'">
84
85
<!-- all this just to return the highest event number -->
86
<xsl:variable name="maxEvent">
87
<xsl:for-each select="eventsection/event">
88
<xsl:variable name="mynum" select="@num"/>
89
<xsl:if test="count(../../eventsection/event[@num &gt; $mynum]) = 0">
90
<xsl:value-of select="@num"/>
91
</xsl:if>
92
</xsl:for-each>
93
</xsl:variable>
94
95
<xsl:text>jbyte JvmtiTrace::_event_trace_flags[</xsl:text>
96
<xsl:value-of select="1+$maxEvent"/>
97
<xsl:text>];
98
99
jint JvmtiTrace::_max_event_index = </xsl:text>
100
<xsl:value-of select="$maxEvent"/>
101
<xsl:text>;
102
103
// Event names
104
const char* JvmtiTrace::_event_names[] = {
105
</xsl:text>
106
<xsl:call-template name="fillEntityName">
107
<xsl:with-param name="entities" select="eventsection/event"/>
108
</xsl:call-template>
109
<xsl:text>
110
};
111
</xsl:text>
112
<xsl:apply-templates select="//constants[@kind='enum']"/>
113
</xsl:if>
114
<xsl:apply-templates select="functionsection"/>
115
116
<xsl:if test="$trace='Trace'">
117
<xsl:text>
118
#endif /*JVMTI_TRACE */
119
</xsl:text>
120
</xsl:if>
121
122
</xsl:template>
123
124
<xsl:template match="constants">
125
<xsl:text>
126
127
// </xsl:text>
128
<xsl:value-of select="@label"/>
129
<xsl:text> names
130
const char* </xsl:text>
131
<xsl:value-of select="@id"/>
132
<xsl:text>ConstantNames[] = {
133
</xsl:text>
134
<xsl:apply-templates select="constant" mode="constname"/>
135
<xsl:text> NULL
136
};
137
138
// </xsl:text>
139
<xsl:value-of select="@label"/>
140
<xsl:text> value
141
jint </xsl:text>
142
<xsl:value-of select="@id"/>
143
<xsl:text>ConstantValues[] = {
144
</xsl:text>
145
<xsl:apply-templates select="constant" mode="constvalue"/>
146
<xsl:text> 0
147
};
148
149
</xsl:text>
150
</xsl:template>
151
152
<xsl:template match="constant" mode="constname">
153
<xsl:text> "</xsl:text>
154
<xsl:value-of select="@id"/>
155
<xsl:text>",
156
</xsl:text>
157
</xsl:template>
158
159
<xsl:template match="constant" mode="constvalue">
160
<xsl:text> </xsl:text>
161
<xsl:value-of select="@num"/>
162
<xsl:text>,
163
</xsl:text>
164
</xsl:template>
165
166
<xsl:template name="eventCapabilitiesTest">
167
<xsl:text>
168
169
// Check Event Capabilities
170
const bool JvmtiUtil::has_event_capability(jvmtiEvent event_type, const jvmtiCapabilities* capabilities_ptr) {
171
switch (event_type) {
172
</xsl:text>
173
<xsl:for-each select="//eventsection/event">
174
<xsl:variable name="capa" select="capabilities/required"/>
175
<xsl:if test="count($capa)">
176
<xsl:text> case </xsl:text>
177
<xsl:value-of select="@const"/>
178
<xsl:text>:
179
return capabilities_ptr-&gt;</xsl:text>
180
<xsl:value-of select="$capa/@id"/>
181
<xsl:text> != 0;
182
</xsl:text>
183
</xsl:if>
184
</xsl:for-each>
185
<xsl:text> }
186
// if it does not have a capability it is required
187
return JNI_TRUE;
188
}
189
190
</xsl:text>
191
</xsl:template>
192
193
<xsl:template match="functionsection">
194
<xsl:if test="$trace='Trace'">
195
196
<!-- all this just to return the highest function number -->
197
<xsl:variable name="maxFunction">
198
<xsl:for-each select="category/function">
199
<xsl:variable name="mynum" select="@num"/>
200
<xsl:if test="count(../../category/function[@num &gt; $mynum]) = 0">
201
<xsl:value-of select="@num"/>
202
</xsl:if>
203
</xsl:for-each>
204
</xsl:variable>
205
206
<xsl:text>jbyte JvmtiTrace::_trace_flags[</xsl:text>
207
<xsl:value-of select="1+$maxFunction"/>
208
<xsl:text>];
209
210
jint JvmtiTrace::_max_function_index = </xsl:text>
211
<xsl:value-of select="$maxFunction"/>
212
<xsl:text>;
213
214
// Function names
215
const char* JvmtiTrace::_function_names[] = {
216
</xsl:text>
217
<xsl:call-template name="fillEntityName">
218
<xsl:with-param name="entities" select="category/function"/>
219
</xsl:call-template>
220
<xsl:text>
221
};
222
223
// Exclude list
224
short JvmtiTrace::_exclude_functions[] = {
225
</xsl:text>
226
<xsl:apply-templates select="category/function" mode="notrace">
227
<xsl:sort select="@num"/>
228
</xsl:apply-templates>
229
<xsl:text>0
230
};
231
232
</xsl:text>
233
</xsl:if>
234
235
<xsl:text>
236
extern "C" {
237
238
</xsl:text>
239
<xsl:apply-templates select="category" mode="wrapper"/>
240
<xsl:text>
241
} /* end extern "C" */
242
243
// JVMTI API functions
244
struct jvmtiInterface_1_ jvmti</xsl:text>
245
<xsl:value-of select="$trace"/>
246
<xsl:text>_Interface = {
247
</xsl:text>
248
249
<xsl:call-template name="fillFuncStruct">
250
<xsl:with-param name="funcs" select="category/function[count(@hide)=0]"/>
251
</xsl:call-template>
252
253
<xsl:text>
254
};
255
#endif // INCLUDE_JVMTI
256
</xsl:text>
257
</xsl:template>
258
259
<xsl:template match="function" mode="functionid">
260
<xsl:text>jvmti</xsl:text>
261
<xsl:value-of select="$trace"/>
262
<xsl:text>_</xsl:text>
263
<xsl:value-of select="@id"/>
264
</xsl:template>
265
266
<xsl:template name="fillFuncStructDoit">
267
<xsl:param name="func"/>
268
<xsl:param name="index"/>
269
<xsl:text> /* </xsl:text>
270
<xsl:number value="$index" format=" 1"/>
271
<xsl:text> : </xsl:text>
272
<xsl:choose>
273
<xsl:when test="count($func)=1">
274
<xsl:value-of select="$func/synopsis"/>
275
<xsl:text> */
276
</xsl:text>
277
<xsl:apply-templates select="$func" mode="functionid"/>
278
</xsl:when>
279
<xsl:otherwise>
280
<xsl:text> RESERVED */
281
NULL</xsl:text>
282
</xsl:otherwise>
283
</xsl:choose>
284
</xsl:template>
285
286
<!-- generic function iterator applied to the function structure -->
287
<xsl:template name="fillFuncStruct">
288
<xsl:param name="funcs"/>
289
<xsl:param name="index" select="1"/>
290
<xsl:call-template name="fillFuncStructDoit">
291
<xsl:with-param name="func" select="$funcs[@num=$index]"/>
292
<xsl:with-param name="index" select="$index"/>
293
</xsl:call-template>
294
<xsl:if test="count($funcs[@num &gt; $index]) &gt; 0">
295
<xsl:text>,
296
</xsl:text>
297
<xsl:call-template name="fillFuncStruct">
298
<xsl:with-param name="funcs" select="$funcs"/>
299
<xsl:with-param name="index" select="1+$index"/>
300
</xsl:call-template>
301
</xsl:if>
302
</xsl:template>
303
304
<xsl:template name="fillEntityNameDoit">
305
<xsl:param name="entity"/>
306
<xsl:param name="index"/>
307
<xsl:choose>
308
<xsl:when test="count($entity) &gt; 0">
309
<xsl:text> "</xsl:text>
310
<xsl:value-of select="$entity[position()=1]/@id"/>
311
<xsl:text>"</xsl:text>
312
</xsl:when>
313
<xsl:otherwise>
314
<xsl:text> NULL</xsl:text>
315
</xsl:otherwise>
316
</xsl:choose>
317
</xsl:template>
318
319
<!-- generic entity (with id and num) iterator applied to entity names -->
320
<xsl:template name="fillEntityName">
321
<xsl:param name="entities"/>
322
<xsl:param name="index" select="0"/>
323
<xsl:call-template name="fillEntityNameDoit">
324
<xsl:with-param name="entity" select="$entities[@num=$index]"/>
325
<xsl:with-param name="index" select="$index"/>
326
</xsl:call-template>
327
<xsl:if test="count($entities[@num &gt; $index]) &gt; 0">
328
<xsl:text>,
329
</xsl:text>
330
<xsl:call-template name="fillEntityName">
331
<xsl:with-param name="entities" select="$entities"/>
332
<xsl:with-param name="index" select="1+$index"/>
333
</xsl:call-template>
334
</xsl:if>
335
</xsl:template>
336
337
<xsl:template name="fillEventThreadedDoit">
338
<xsl:param name="entity"/>
339
<xsl:param name="index"/>
340
<xsl:choose>
341
<xsl:when test="count($entity) &gt; 0">
342
<xsl:choose>
343
<xsl:when test="count($entity[position()=1]/@filtered)=0">
344
<xsl:text> false</xsl:text>
345
</xsl:when>
346
<xsl:otherwise>
347
<xsl:text> true</xsl:text>
348
</xsl:otherwise>
349
</xsl:choose>
350
</xsl:when>
351
<xsl:otherwise>
352
<xsl:text> false</xsl:text>
353
</xsl:otherwise>
354
</xsl:choose>
355
</xsl:template>
356
357
358
<xsl:template name="fillEventThreaded">
359
<xsl:param name="entities"/>
360
<xsl:param name="index" select="0"/>
361
<xsl:call-template name="fillEventThreadedDoit">
362
<xsl:with-param name="entity" select="$entities[@num=$index]"/>
363
<xsl:with-param name="index" select="$index"/>
364
</xsl:call-template>
365
<xsl:if test="count($entities[@num &gt; $index]) &gt; 0">
366
<xsl:text>,
367
</xsl:text>
368
<xsl:call-template name="fillEventThreaded">
369
<xsl:with-param name="entities" select="$entities"/>
370
<xsl:with-param name="index" select="1+$index"/>
371
</xsl:call-template>
372
</xsl:if>
373
</xsl:template>
374
375
<xsl:template match="function" mode="notrace">
376
<xsl:if test="count(@impl)=1 and contains(@impl,'notrace')">
377
<xsl:value-of select="@num"/>
378
<xsl:text>,
379
</xsl:text>
380
</xsl:if>
381
</xsl:template>
382
383
<xsl:template match="category" mode="wrapper">
384
<xsl:text>
385
//
386
// </xsl:text><xsl:value-of select="@label"/><xsl:text> functions
387
//
388
</xsl:text>
389
<xsl:apply-templates select="function[count(@hide)=0]"/>
390
</xsl:template>
391
392
<xsl:template match="function" mode="transition">
393
<xsl:param name="space">
394
<xsl:text>
395
</xsl:text>
396
</xsl:param>
397
<xsl:value-of select="$space"/>
398
399
<xsl:choose>
400
<xsl:when test="count(@callbacksafe)=0 or not(contains(@callbacksafe,'safe'))">
401
<xsl:text>if (this_thread == NULL || !this_thread->is_Java_thread()) {</xsl:text>
402
</xsl:when>
403
<xsl:otherwise>
404
<xsl:choose>
405
<xsl:when test="count(@phase)=0 or contains(@phase,'live') or contains(@phase,'start')">
406
<xsl:text>if (this_thread == NULL || (!this_thread->is_Java_thread() &amp;&amp; !this_thread->is_VM_thread())) {</xsl:text>
407
</xsl:when>
408
<xsl:otherwise>
409
<xsl:text>if (!this_thread->is_Java_thread()) {</xsl:text>
410
</xsl:otherwise>
411
</xsl:choose>
412
</xsl:otherwise>
413
</xsl:choose>
414
415
<xsl:if test="$trace='Trace'">
416
<xsl:value-of select="$space"/>
417
<xsl:text> if (trace_flags) {</xsl:text>
418
<xsl:value-of select="$space"/>
419
<xsl:text> tty->print_cr("JVMTI [non-attached thread] %s %s", func_name,</xsl:text>
420
<xsl:value-of select="$space"/>
421
<xsl:text> JvmtiUtil::error_name(JVMTI_ERROR_UNATTACHED_THREAD));</xsl:text>
422
<xsl:value-of select="$space"/>
423
<xsl:text> }</xsl:text>
424
</xsl:if>
425
<xsl:value-of select="$space"/>
426
<xsl:text> return JVMTI_ERROR_UNATTACHED_THREAD;</xsl:text>
427
<xsl:value-of select="$space"/>
428
<xsl:text>}</xsl:text>
429
<xsl:value-of select="$space"/>
430
<xsl:if test="count(@impl)=0 or not(contains(@impl,'innative'))">
431
<xsl:text>JavaThread* current_thread = (JavaThread*)this_thread;</xsl:text>
432
<xsl:value-of select="$space"/>
433
<xsl:text>MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, current_thread));</xsl:text>
434
<xsl:value-of select="$space"/>
435
<xsl:text>ThreadInVMfromNative __tiv(current_thread);</xsl:text>
436
<xsl:value-of select="$space"/>
437
<xsl:text>VM_ENTRY_BASE(jvmtiError, </xsl:text>
438
<xsl:apply-templates select="." mode="functionid"/>
439
<xsl:text> , current_thread)</xsl:text>
440
<xsl:value-of select="$space"/>
441
<xsl:text>debug_only(VMNativeEntryWrapper __vew;)</xsl:text>
442
<xsl:if test="count(@callbacksafe)=0 or not(contains(@callbacksafe,'safe'))">
443
<xsl:value-of select="$space"/>
444
<xsl:text>CautiouslyPreserveExceptionMark __em(this_thread);</xsl:text>
445
</xsl:if>
446
</xsl:if>
447
</xsl:template>
448
449
450
<xsl:template match="required">
451
<xsl:text>
452
if (jvmti_env-&gt;get_capabilities()-&gt;</xsl:text>
453
<xsl:value-of select="@id"/>
454
<xsl:text> == 0) {
455
</xsl:text>
456
<xsl:if test="$trace='Trace'">
457
<xsl:text> if (trace_flags) {
458
tty->print_cr("JVMTI [%s] %s %s", curr_thread_name, func_name,
459
JvmtiUtil::error_name(JVMTI_ERROR_MUST_POSSESS_CAPABILITY));
460
}
461
</xsl:text>
462
</xsl:if>
463
<xsl:text> return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
464
}
465
</xsl:text>
466
</xsl:template>
467
468
469
<xsl:template match="function">
470
<xsl:text>
471
static jvmtiError JNICALL
472
</xsl:text>
473
<xsl:apply-templates select="." mode="functionid"/>
474
<xsl:text>(jvmtiEnv* env</xsl:text>
475
<xsl:apply-templates select="parameters" mode="signature"/>
476
<xsl:text>) {
477
</xsl:text>
478
479
<xsl:if test="not(contains(@jkernel,'yes'))">
480
<xsl:text>&#xA;#if !INCLUDE_JVMTI &#xA;</xsl:text>
481
<xsl:text> return JVMTI_ERROR_NOT_AVAILABLE; &#xA;</xsl:text>
482
<xsl:text>#else &#xA;</xsl:text>
483
</xsl:if>
484
485
<xsl:apply-templates select="." mode="traceSetUp"/>
486
<xsl:choose>
487
<xsl:when test="count(@phase)=0 or contains(@phase,'live')">
488
<xsl:text> if(!JvmtiEnv::is_vm_live()) {
489
</xsl:text>
490
<xsl:if test="$trace='Trace'">
491
<xsl:text> if (trace_flags) {
492
tty->print_cr("JVMTI [-] %s %s", func_name,
493
JvmtiUtil::error_name(JVMTI_ERROR_WRONG_PHASE));
494
}
495
</xsl:text>
496
</xsl:if>
497
<xsl:text> return JVMTI_ERROR_WRONG_PHASE;
498
}</xsl:text>
499
500
<xsl:text>
501
Thread* this_thread = (Thread*)ThreadLocalStorage::thread(); </xsl:text>
502
503
<xsl:apply-templates select="." mode="transition"/>
504
</xsl:when>
505
<xsl:otherwise>
506
<xsl:if test="contains(@phase,'onload')">
507
<xsl:text> if(JvmtiEnv::get_phase()!=JVMTI_PHASE_ONLOAD</xsl:text>
508
<xsl:if test="not(contains(@phase,'onloadOnly'))">
509
<xsl:text> &amp;&amp; JvmtiEnv::get_phase()!=JVMTI_PHASE_LIVE</xsl:text>
510
</xsl:if>
511
<xsl:text>) {
512
</xsl:text>
513
<xsl:if test="$trace='Trace'">
514
<xsl:text> if (trace_flags) {
515
tty->print_cr("JVMTI [-] %s %s", func_name,
516
JvmtiUtil::error_name(JVMTI_ERROR_WRONG_PHASE));
517
}
518
</xsl:text>
519
</xsl:if>
520
<xsl:text> return JVMTI_ERROR_WRONG_PHASE;
521
}</xsl:text>
522
</xsl:if>
523
<xsl:if test="contains(@phase,'start')">
524
<xsl:text> if(JvmtiEnv::get_phase()!=JVMTI_PHASE_START &amp;&amp; JvmtiEnv::get_phase()!=JVMTI_PHASE_LIVE) {
525
</xsl:text>
526
<xsl:if test="$trace='Trace'">
527
<xsl:text> if (trace_flags) {
528
tty->print_cr("JVMTI [-] %s %s", func_name,
529
JvmtiUtil::error_name(JVMTI_ERROR_WRONG_PHASE));
530
}
531
</xsl:text>
532
</xsl:if>
533
<xsl:text> return JVMTI_ERROR_WRONG_PHASE;
534
}
535
Thread* this_thread = (Thread*)ThreadLocalStorage::thread(); </xsl:text>
536
<xsl:apply-templates select="." mode="transition"/>
537
</xsl:if>
538
</xsl:otherwise>
539
</xsl:choose>
540
541
<xsl:text>
542
JvmtiEnv* jvmti_env = JvmtiEnv::JvmtiEnv_from_jvmti_env(env);
543
if (!jvmti_env->is_valid()) {
544
</xsl:text>
545
<xsl:if test="$trace='Trace'">
546
<xsl:text> if (trace_flags) {
547
tty->print_cr("JVMTI [%s] %s %s env=%d", curr_thread_name, func_name,
548
JvmtiUtil::error_name(JVMTI_ERROR_INVALID_ENVIRONMENT), env);
549
}
550
</xsl:text>
551
</xsl:if>
552
<xsl:text> return JVMTI_ERROR_INVALID_ENVIRONMENT;
553
}
554
</xsl:text>
555
556
<xsl:apply-templates select="capabilities/required"/>
557
558
<xsl:text> jvmtiError err;
559
</xsl:text>
560
<xsl:choose>
561
<xsl:when test="count(@phase)=1 and not(contains(@phase,'live')) and not(contains(@phase,'start'))">
562
<xsl:choose>
563
<xsl:when test="count(@callbacksafe)=0 or not(contains(@callbacksafe,'safe'))">
564
<xsl:text> if (Threads::number_of_threads() != 0) {
565
Thread* this_thread = (Thread*)ThreadLocalStorage::thread();</xsl:text>
566
</xsl:when>
567
<xsl:otherwise>
568
569
<xsl:text> Thread* this_thread = NULL;
570
bool transition;
571
if (Threads::number_of_threads() == 0) {
572
transition = false;
573
} else {
574
this_thread = (Thread*)ThreadLocalStorage::thread();
575
transition = ((this_thread != NULL) &amp;&amp; !this_thread->is_VM_thread() &amp;&amp; !this_thread->is_ConcurrentGC_thread());
576
}
577
if (transition) {</xsl:text>
578
</xsl:otherwise>
579
580
</xsl:choose>
581
<!-- we allow use in early phases but there are threads now, -->
582
<!-- so do thread transition -->
583
<xsl:apply-templates select="." mode="transition">
584
<xsl:with-param name="space">
585
<xsl:text>
586
</xsl:text>
587
</xsl:with-param>
588
</xsl:apply-templates>
589
<xsl:text>
590
</xsl:text>
591
<xsl:apply-templates select="." mode="doCall"/>
592
<xsl:text> } else {
593
</xsl:text>
594
<!-- we are pre-thread - no thread transition code -->
595
<xsl:apply-templates select="." mode="doCall"/>
596
<xsl:text> }
597
</xsl:text>
598
</xsl:when>
599
<xsl:otherwise>
600
<xsl:apply-templates select="." mode="doCall"/>
601
</xsl:otherwise>
602
</xsl:choose>
603
<xsl:text> return err;
604
</xsl:text>
605
606
<xsl:if test="not(contains(@jkernel,'yes'))">
607
<xsl:text>#endif // INCLUDE_JVMTI&#xA;</xsl:text>
608
</xsl:if>
609
610
<xsl:text>}&#xA;</xsl:text>
611
</xsl:template>
612
613
<xsl:template match="function" mode="doCall">
614
<xsl:apply-templates select="parameters" mode="dochecks"/>
615
<xsl:apply-templates select="." mode="traceBefore"/>
616
<xsl:apply-templates select="." mode="genCall"/>
617
<xsl:apply-templates select="." mode="traceAfter"/>
618
</xsl:template>
619
620
<xsl:template match="function" mode="genCall">
621
<xsl:text> err = jvmti_env-&gt;</xsl:text>
622
<xsl:value-of select="@id"/>
623
<xsl:text>(</xsl:text>
624
<xsl:apply-templates select="parameters" mode="HotSpotValue"/>
625
<xsl:text>);
626
</xsl:text>
627
</xsl:template>
628
629
630
<xsl:template match="function" mode="traceSetUp">
631
<xsl:if test="$trace='Trace'">
632
<xsl:text> SafeResourceMark rm;
633
jint trace_flags = JvmtiTrace::trace_flags(</xsl:text>
634
<xsl:value-of select="@num"/>
635
<xsl:text>);
636
const char *func_name = NULL;
637
const char *curr_thread_name = NULL;
638
if (trace_flags) {
639
func_name = JvmtiTrace::function_name(</xsl:text>
640
<xsl:value-of select="@num"/>
641
<xsl:text>);
642
curr_thread_name = JvmtiTrace::safe_get_current_thread_name();
643
}
644
</xsl:text>
645
</xsl:if>
646
</xsl:template>
647
648
649
<xsl:template match="function" mode="traceBefore">
650
<xsl:if test="$trace='Trace'">
651
<xsl:text>
652
if ((trace_flags &amp; JvmtiTrace::SHOW_IN) != 0) {
653
</xsl:text>
654
<xsl:apply-templates select="." mode="traceIn"/>
655
<xsl:text> }
656
</xsl:text>
657
</xsl:if>
658
</xsl:template>
659
660
661
<xsl:template match="param" mode="traceError">
662
<xsl:param name="err"/>
663
<xsl:param name="comment"></xsl:param>
664
<xsl:param name="extraValue"></xsl:param>
665
<xsl:if test="$trace='Trace'">
666
<xsl:text> if ((trace_flags &amp; JvmtiTrace::SHOW_ERROR) != 0) {
667
if ((trace_flags &amp; JvmtiTrace::SHOW_IN) == 0) {
668
</xsl:text>
669
<xsl:apply-templates select="../.." mode="traceIn">
670
<xsl:with-param name="endParam" select="."/>
671
</xsl:apply-templates>
672
<xsl:text> }
673
tty->print_cr("JVMTI [%s] %s } %s - erroneous arg is </xsl:text>
674
<xsl:value-of select="@id"/>
675
<xsl:value-of select="$comment"/>
676
<xsl:text>", curr_thread_name, func_name,
677
JvmtiUtil::error_name(</xsl:text>
678
<xsl:value-of select="$err"/>
679
<xsl:text>)</xsl:text>
680
<xsl:value-of select="$extraValue"/>
681
<xsl:text>);
682
}
683
</xsl:text>
684
</xsl:if>
685
<xsl:text> return </xsl:text>
686
<xsl:value-of select="$err"/>
687
<xsl:text>;</xsl:text>
688
</xsl:template>
689
690
691
<xsl:template match="function" mode="traceAfter">
692
<xsl:if test="$trace='Trace'">
693
<xsl:text> if ( err != JVMTI_ERROR_NONE &amp;&amp; (trace_flags &amp; JvmtiTrace::SHOW_ERROR) != 0) {
694
if ((trace_flags &amp; JvmtiTrace::SHOW_IN) == 0) {
695
</xsl:text>
696
<xsl:apply-templates select="." mode="traceIn"/>
697
<xsl:text> }
698
tty->print_cr("JVMTI [%s] %s } %s", curr_thread_name, func_name,
699
JvmtiUtil::error_name(err));
700
} else if ((trace_flags &amp; JvmtiTrace::SHOW_OUT) != 0) {
701
tty->print_cr("JVMTI [%s] %s }", curr_thread_name, func_name);
702
}
703
</xsl:text>
704
</xsl:if>
705
</xsl:template>
706
707
<xsl:template match="function" mode="traceIn">
708
<xsl:param name="endParam"></xsl:param>
709
<xsl:text> tty->print_cr("JVMTI [%s] %s { </xsl:text>
710
<xsl:apply-templates select="parameters" mode="traceInFormat">
711
<xsl:with-param name="endParam" select="$endParam"/>
712
</xsl:apply-templates>
713
<xsl:text>", curr_thread_name, func_name</xsl:text>
714
<xsl:apply-templates select="parameters" mode="traceInValue">
715
<xsl:with-param name="endParam" select="$endParam"/>
716
</xsl:apply-templates>
717
<xsl:text>);
718
</xsl:text>
719
</xsl:template>
720
721
<xsl:template match="parameters" mode="dochecks">
722
<xsl:apply-templates select="param" mode="dochecks"/>
723
</xsl:template>
724
725
<xsl:template match="param" mode="dochecks">
726
<xsl:apply-templates select="child::*[position()=1]" mode="dochecks">
727
<xsl:with-param name="name" select="@id"/>
728
</xsl:apply-templates>
729
</xsl:template>
730
731
<xsl:template match="outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="dochecks">
732
<xsl:param name="name"/>
733
<xsl:if test="count(nullok)=0">
734
<xsl:text> if (</xsl:text>
735
<xsl:value-of select="$name"/>
736
<xsl:text> == NULL) {
737
</xsl:text>
738
<xsl:apply-templates select=".." mode="traceError">
739
<xsl:with-param name="err">JVMTI_ERROR_NULL_POINTER</xsl:with-param>
740
</xsl:apply-templates>
741
<xsl:text>
742
}
743
</xsl:text>
744
</xsl:if>
745
</xsl:template>
746
747
<xsl:template match="jrawMonitorID" mode="dochecks">
748
<xsl:param name="name"/>
749
<xsl:text> JvmtiRawMonitor *rmonitor = (JvmtiRawMonitor *)</xsl:text>
750
<xsl:value-of select="$name"/>
751
<xsl:text>;
752
if (rmonitor == NULL) {
753
</xsl:text>
754
<xsl:apply-templates select=".." mode="traceError">
755
<xsl:with-param name="err">JVMTI_ERROR_INVALID_MONITOR</xsl:with-param>
756
<xsl:with-param name="comment"> - raw monitor is NULL</xsl:with-param>
757
</xsl:apply-templates>
758
<xsl:text>
759
}
760
if (!rmonitor->is_valid()) {
761
</xsl:text>
762
<xsl:apply-templates select=".." mode="traceError">
763
<xsl:with-param name="err">JVMTI_ERROR_INVALID_MONITOR</xsl:with-param>
764
<xsl:with-param name="comment"> - not a raw monitor 0x%x</xsl:with-param>
765
<xsl:with-param name="extraValue">, rmonitor</xsl:with-param>
766
</xsl:apply-templates>
767
<xsl:text>
768
}
769
</xsl:text>
770
</xsl:template>
771
772
<xsl:template match="jthread" mode="dochecksbody">
773
<xsl:param name="name"/>
774
<xsl:text> oop thread_oop = JNIHandles::resolve_external_guard(</xsl:text>
775
<xsl:value-of select="$name"/>
776
<xsl:text>);
777
if (thread_oop == NULL) {
778
</xsl:text>
779
<xsl:apply-templates select=".." mode="traceError">
780
<xsl:with-param name="err">JVMTI_ERROR_INVALID_THREAD</xsl:with-param>
781
<xsl:with-param name="comment"> - jthread resolved to NULL - jthread = 0x%x</xsl:with-param>
782
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
783
</xsl:apply-templates>
784
<xsl:text>
785
}
786
if (!thread_oop-&gt;is_a(SystemDictionary::Thread_klass())) {
787
</xsl:text>
788
<xsl:apply-templates select=".." mode="traceError">
789
<xsl:with-param name="err">JVMTI_ERROR_INVALID_THREAD</xsl:with-param>
790
<xsl:with-param name="comment"> - oop is not a thread - jthread = 0x%x</xsl:with-param>
791
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
792
</xsl:apply-templates>
793
<xsl:text>
794
}
795
java_thread = java_lang_Thread::thread(thread_oop);
796
if (java_thread == NULL) {
797
</xsl:text>
798
<xsl:apply-templates select=".." mode="traceError">
799
<xsl:with-param name="err">
800
<xsl:text>JVMTI_ERROR_THREAD_NOT_ALIVE</xsl:text>
801
</xsl:with-param>
802
<xsl:with-param name="comment"> - not a Java thread - jthread = 0x%x</xsl:with-param>
803
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
804
</xsl:apply-templates>
805
<xsl:text>
806
}
807
</xsl:text>
808
</xsl:template>
809
810
<xsl:template match="jthread" mode="dochecks">
811
<xsl:param name="name"/>
812
<!-- If we convert and test threads -->
813
<xsl:if test="count(@impl)=0 or not(contains(@impl,'noconvert'))">
814
<xsl:text> JavaThread* java_thread;
815
</xsl:text>
816
<xsl:choose>
817
<xsl:when test="count(@null)=0">
818
<xsl:apply-templates select="." mode="dochecksbody">
819
<xsl:with-param name="name" select="$name"/>
820
</xsl:apply-templates>
821
</xsl:when>
822
<xsl:otherwise>
823
<xsl:text> if (</xsl:text>
824
<xsl:value-of select="$name"/>
825
<xsl:text> == NULL) {
826
java_thread = current_thread;
827
} else {
828
</xsl:text>
829
<xsl:apply-templates select="." mode="dochecksbody">
830
<xsl:with-param name="name" select="$name"/>
831
</xsl:apply-templates>
832
<xsl:text> }
833
</xsl:text>
834
</xsl:otherwise>
835
</xsl:choose>
836
</xsl:if>
837
</xsl:template>
838
839
<xsl:template match="jframeID" mode="dochecks">
840
<xsl:param name="name"/>
841
<xsl:text>
842
if (depth &lt; 0) {
843
</xsl:text>
844
<xsl:apply-templates select=".." mode="traceError">
845
<xsl:with-param name="err">JVMTI_ERROR_ILLEGAL_ARGUMENT</xsl:with-param>
846
<xsl:with-param name="comment"> - negative depth - jthread = 0x%x</xsl:with-param>
847
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
848
</xsl:apply-templates>
849
<xsl:text>
850
}
851
</xsl:text>
852
</xsl:template>
853
854
<xsl:template match="jclass" mode="dochecks">
855
<xsl:param name="name"/>
856
<!-- for JVMTI a jclass/jmethodID becomes just jmethodID -->
857
<xsl:if test="count(@method)=0">
858
<xsl:text> oop k_mirror = JNIHandles::resolve_external_guard(</xsl:text>
859
<xsl:value-of select="$name"/>
860
<xsl:text>);
861
if (k_mirror == NULL) {
862
</xsl:text>
863
<xsl:apply-templates select=".." mode="traceError">
864
<xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
865
<xsl:with-param name="comment"> - resolved to NULL - jclass = 0x%x</xsl:with-param>
866
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
867
</xsl:apply-templates>
868
<xsl:text>
869
}
870
if (!k_mirror->is_a(SystemDictionary::Class_klass())) {
871
</xsl:text>
872
<xsl:apply-templates select=".." mode="traceError">
873
<xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
874
<xsl:with-param name="comment"> - not a class - jclass = 0x%x</xsl:with-param>
875
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
876
</xsl:apply-templates>
877
<xsl:text>
878
}
879
</xsl:text>
880
<xsl:if test="count(@method|@field)=1">
881
<xsl:text>
882
if (java_lang_Class::is_primitive(k_mirror)) {
883
</xsl:text>
884
<xsl:apply-templates select=".." mode="traceError">
885
<xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
886
<xsl:with-param name="comment"> - is a primitive class - jclass = 0x%x</xsl:with-param>
887
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
888
</xsl:apply-templates>
889
<xsl:text>
890
}
891
Klass* k_oop = java_lang_Class::as_Klass(k_mirror);
892
if (k_oop == NULL) {
893
</xsl:text>
894
<xsl:apply-templates select=".." mode="traceError">
895
<xsl:with-param name="err">JVMTI_ERROR_INVALID_CLASS</xsl:with-param>
896
<xsl:with-param name="comment"> - no Klass* - jclass = 0x%x</xsl:with-param>
897
<xsl:with-param name="extraValue">, <xsl:value-of select="$name"/></xsl:with-param>
898
</xsl:apply-templates>
899
<xsl:text>
900
}
901
</xsl:text>
902
</xsl:if>
903
</xsl:if>
904
</xsl:template>
905
906
907
<xsl:template match="jmethodID" mode="dochecks">
908
<xsl:param name="name"/>
909
<xsl:text> Method* method_oop = Method::checked_resolve_jmethod_id(</xsl:text>
910
<xsl:value-of select="$name"/>
911
<xsl:text>);&#xA;</xsl:text>
912
<xsl:text> if (method_oop == NULL) {&#xA;</xsl:text>
913
<xsl:apply-templates select=".." mode="traceError">
914
<xsl:with-param name="err">JVMTI_ERROR_INVALID_METHODID</xsl:with-param>
915
<xsl:with-param name="comment"></xsl:with-param>
916
<xsl:with-param name="extraValue"></xsl:with-param>
917
</xsl:apply-templates>
918
<xsl:text>&#xA;</xsl:text>
919
<xsl:text> }&#xA;</xsl:text>
920
<xsl:if test="count(@native)=1 and contains(@native,'error')">
921
<xsl:text> if (method_oop->is_native()) {&#xA;</xsl:text>
922
<xsl:text> return JVMTI_ERROR_NATIVE_METHOD;&#xA;</xsl:text>
923
<xsl:text> }&#xA;</xsl:text>
924
</xsl:if>
925
</xsl:template>
926
927
928
<xsl:template match="jfieldID" mode="dochecks">
929
<xsl:param name="name"/>
930
<xsl:text> ResourceMark rm_fdesc(current_thread);&#xA;</xsl:text>
931
<xsl:text> fieldDescriptor fdesc;&#xA;</xsl:text>
932
<xsl:text> if (!JvmtiEnv::get_field_descriptor(k_oop, </xsl:text>
933
<xsl:value-of select="$name"/>
934
<xsl:text>, &amp;fdesc)) {&#xA;</xsl:text>
935
<xsl:apply-templates select=".." mode="traceError">
936
<xsl:with-param name="err">JVMTI_ERROR_INVALID_FIELDID</xsl:with-param>
937
</xsl:apply-templates>
938
<xsl:text>&#xA;</xsl:text>
939
<xsl:text> }&#xA;</xsl:text>
940
</xsl:template>
941
942
943
<xsl:template match="jint" mode="dochecks">
944
<xsl:param name="name"/>
945
<xsl:if test="count(@min)=1">
946
<xsl:text> if (</xsl:text>
947
<xsl:value-of select="$name"/>
948
<xsl:text> &lt; </xsl:text>
949
<xsl:value-of select="@min"/>
950
<xsl:text>) {
951
</xsl:text>
952
<xsl:apply-templates select=".." mode="traceError">
953
<xsl:with-param name="err">JVMTI_ERROR_ILLEGAL_ARGUMENT</xsl:with-param>
954
</xsl:apply-templates>
955
<xsl:text>
956
}
957
</xsl:text>
958
</xsl:if>
959
</xsl:template>
960
961
<xsl:template match="jobject|jvalue|jthreadGroup|enum|jchar|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|struct" mode="dochecks">
962
</xsl:template>
963
964
<!-- iterate over parameters, stopping if specified is encountered -->
965
<xsl:template name="traceInValueParamsUpTo">
966
<xsl:param name="params"/>
967
<xsl:param name="endParam"></xsl:param>
968
<xsl:param name="index" select="1"/>
969
<xsl:variable name="cParam" select="$params[position()=$index]"/>
970
<xsl:if test="$cParam!=$endParam">
971
<xsl:apply-templates select="$cParam" mode="traceInValue"/>
972
<xsl:if test="count($params) &gt; $index">
973
<xsl:call-template name="traceInValueParamsUpTo">
974
<xsl:with-param name="params" select="$params"/>
975
<xsl:with-param name="endParam" select="$endParam"/>
976
<xsl:with-param name="index" select="1+$index"/>
977
</xsl:call-template>
978
</xsl:if>
979
</xsl:if>
980
</xsl:template>
981
982
<xsl:template name="traceInFormatParamsUpTo">
983
<xsl:param name="params"/>
984
<xsl:param name="endParam"></xsl:param>
985
<xsl:param name="index" select="1"/>
986
<xsl:variable name="cParam" select="$params[position()=$index]"/>
987
<xsl:if test="$cParam!=$endParam">
988
<xsl:apply-templates select="$cParam" mode="traceInFormat"/>
989
<xsl:if test="count($params) &gt; $index">
990
<xsl:call-template name="traceInFormatParamsUpTo">
991
<xsl:with-param name="params" select="$params"/>
992
<xsl:with-param name="endParam" select="$endParam"/>
993
<xsl:with-param name="index" select="1+$index"/>
994
</xsl:call-template>
995
</xsl:if>
996
</xsl:if>
997
</xsl:template>
998
999
<xsl:template match="parameters" mode="traceInFormat">
1000
<xsl:param name="endParam"></xsl:param>
1001
<xsl:call-template name="traceInFormatParamsUpTo">
1002
<xsl:with-param name="params" select="param"/>
1003
<xsl:with-param name="endParam" select="$endParam"/>
1004
</xsl:call-template>
1005
</xsl:template>
1006
1007
<xsl:template match="parameters" mode="traceInValue">
1008
<xsl:param name="endParam"></xsl:param>
1009
<xsl:call-template name="traceInValueParamsUpTo">
1010
<xsl:with-param name="params" select="param"/>
1011
<xsl:with-param name="endParam" select="$endParam"/>
1012
</xsl:call-template>
1013
</xsl:template>
1014
1015
<xsl:template match="param" mode="traceInFormat">
1016
<xsl:apply-templates select="child::*[position()=1]" mode="traceInFormat">
1017
<xsl:with-param name="name" select="@id"/>
1018
</xsl:apply-templates>
1019
</xsl:template>
1020
1021
<xsl:template match="param" mode="traceInValue">
1022
<xsl:apply-templates select="child::*[position()=1]" mode="traceInValue">
1023
<xsl:with-param name="name" select="@id"/>
1024
</xsl:apply-templates>
1025
</xsl:template>
1026
1027
<xsl:template match="outptr|outbuf|allocfieldbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="traceInFormat">
1028
</xsl:template>
1029
1030
<xsl:template match="outptr|outbuf|allocfieldbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="traceInValue">
1031
</xsl:template>
1032
1033
<xsl:template match="inbuf" mode="traceInFormat">
1034
<xsl:param name="name"/>
1035
<xsl:text> </xsl:text>
1036
<xsl:value-of select="$name"/>
1037
<xsl:variable name="child" select="child::*[position()=1]"/>
1038
<xsl:choose>
1039
<xsl:when test="name($child)='char'">
1040
<xsl:text>='%s'</xsl:text>
1041
</xsl:when>
1042
<xsl:otherwise>
1043
<xsl:text>=0x%x</xsl:text>
1044
</xsl:otherwise>
1045
</xsl:choose>
1046
</xsl:template>
1047
1048
<xsl:template match="inbuf" mode="traceInValue">
1049
<xsl:param name="name"/>
1050
<xsl:text>, </xsl:text>
1051
<xsl:value-of select="$name"/>
1052
</xsl:template>
1053
1054
<xsl:template match="ptrtype" mode="traceInFormat">
1055
<xsl:param name="name"/>
1056
<xsl:variable name="child" select="child::*[position()=1]"/>
1057
<xsl:choose>
1058
<xsl:when test="name($child)='jclass'">
1059
<xsl:text> </xsl:text>
1060
<xsl:value-of select="$name"/>
1061
<xsl:text>=0x%x</xsl:text>
1062
</xsl:when>
1063
<xsl:otherwise>
1064
<xsl:apply-templates select="$child" mode="traceInFormat"/>
1065
</xsl:otherwise>
1066
</xsl:choose>
1067
</xsl:template>
1068
1069
<xsl:template match="ptrtype" mode="traceInValue">
1070
<xsl:param name="name"/>
1071
<xsl:variable name="child" select="child::*[position()=1]"/>
1072
<xsl:choose>
1073
<xsl:when test="name($child)='jclass'">
1074
<xsl:text>, </xsl:text>
1075
<xsl:value-of select="$name"/>
1076
</xsl:when>
1077
<xsl:otherwise>
1078
<xsl:apply-templates select="$child" mode="traceInValue"/>
1079
</xsl:otherwise>
1080
</xsl:choose>
1081
</xsl:template>
1082
1083
<xsl:template match="inptr" mode="traceInFormat">
1084
<xsl:param name="name"/>
1085
<xsl:text> </xsl:text>
1086
<xsl:value-of select="$name"/>
1087
<xsl:text>=0x%x</xsl:text>
1088
</xsl:template>
1089
1090
<xsl:template match="inptr" mode="traceInValue">
1091
<xsl:param name="name"/>
1092
<xsl:text>, </xsl:text>
1093
<xsl:value-of select="$name"/>
1094
</xsl:template>
1095
1096
<xsl:template match="jrawMonitorID|jfieldID" mode="traceInFormat">
1097
<xsl:param name="name"/>
1098
<xsl:text> </xsl:text>
1099
<xsl:value-of select="$name"/>
1100
<xsl:text>=%s</xsl:text>
1101
</xsl:template>
1102
1103
<xsl:template match="jclass" mode="traceInFormat">
1104
<xsl:param name="name"/>
1105
<!-- for JVMTI a jclass/jmethodID becomes just jmethodID -->
1106
<xsl:if test="count(@method)=0">
1107
<xsl:text> </xsl:text>
1108
<xsl:value-of select="$name"/>
1109
<xsl:text>=%s</xsl:text>
1110
</xsl:if>
1111
</xsl:template>
1112
1113
<xsl:template match="jrawMonitorID" mode="traceInValue">
1114
<xsl:param name="name"/>
1115
<xsl:text>, rmonitor->get_name()</xsl:text>
1116
</xsl:template>
1117
1118
<xsl:template match="jthread" mode="traceInFormat">
1119
<xsl:param name="name"/>
1120
<!-- If we convert and test threads -->
1121
<xsl:if test="count(@impl)=0 or not(contains(@impl,'noconvert'))">
1122
<xsl:text> </xsl:text>
1123
<xsl:value-of select="$name"/>
1124
<xsl:text>=%s</xsl:text>
1125
</xsl:if>
1126
</xsl:template>
1127
1128
<xsl:template match="jthread" mode="traceInValue">
1129
<xsl:param name="name"/>
1130
<!-- If we convert and test threads -->
1131
<xsl:if test="count(@impl)=0 or not(contains(@impl,'noconvert'))">
1132
<xsl:text>,
1133
JvmtiTrace::safe_get_thread_name(java_thread)</xsl:text>
1134
</xsl:if>
1135
</xsl:template>
1136
1137
<xsl:template match="jframeID" mode="traceInFormat">
1138
<xsl:param name="name"/>
1139
<xsl:text>depth=%d</xsl:text>
1140
</xsl:template>
1141
1142
<xsl:template match="jframeID" mode="traceInValue">
1143
<xsl:param name="name"/>
1144
<xsl:text>, </xsl:text>
1145
<xsl:value-of select="$name"/>
1146
</xsl:template>
1147
1148
<xsl:template match="jclass" mode="traceInValue">
1149
<!-- for JVMTI a jclass/jmethodID becomes just jmethodID -->
1150
<xsl:if test="count(@method)=0">
1151
<xsl:text>,
1152
JvmtiTrace::get_class_name(k_mirror)</xsl:text>
1153
</xsl:if>
1154
</xsl:template>
1155
1156
<xsl:template match="jmethodID" mode="traceInFormat">
1157
<xsl:param name="name"/>
1158
<xsl:text> </xsl:text>
1159
<xsl:value-of select="$name"/>
1160
<xsl:text>=%s.%s</xsl:text>
1161
</xsl:template>
1162
1163
<xsl:template match="jmethodID" mode="traceInValue">
1164
<xsl:param name="name"/>
1165
<xsl:text>,
1166
method_oop == NULL? "NULL" : method_oop->klass_name()->as_C_string(),
1167
method_oop == NULL? "NULL" : method_oop->name()->as_C_string()
1168
</xsl:text>
1169
</xsl:template>
1170
1171
<xsl:template match="jfieldID" mode="traceInValue">
1172
<xsl:param name="name"/>
1173
<xsl:text>, fdesc.name()->as_C_string()</xsl:text>
1174
</xsl:template>
1175
1176
<xsl:template match="enum" mode="traceInFormat">
1177
<xsl:param name="name"/>
1178
<xsl:text> </xsl:text>
1179
<xsl:value-of select="$name"/>
1180
<xsl:text>=%d:%s</xsl:text>
1181
</xsl:template>
1182
1183
<xsl:template match="enum" mode="traceInValue">
1184
<xsl:param name="name"/>
1185
<xsl:text>, </xsl:text>
1186
<xsl:value-of select="$name"/>
1187
<xsl:text>,
1188
</xsl:text>
1189
<xsl:choose>
1190
<xsl:when test=".='jvmtiError'">
1191
<xsl:text>JvmtiUtil::error_name(</xsl:text>
1192
<xsl:value-of select="$name"/>
1193
<xsl:text>)
1194
</xsl:text>
1195
</xsl:when>
1196
<xsl:otherwise>
1197
<xsl:choose>
1198
<xsl:when test=".='jvmtiEvent'">
1199
<xsl:text>JvmtiTrace::event_name(</xsl:text>
1200
<xsl:value-of select="$name"/>
1201
<xsl:text>)
1202
</xsl:text>
1203
</xsl:when>
1204
<xsl:otherwise>
1205
<xsl:text>JvmtiTrace::enum_name(</xsl:text>
1206
<xsl:value-of select="."/>
1207
<xsl:text>ConstantNames, </xsl:text>
1208
<xsl:value-of select="."/>
1209
<xsl:text>ConstantValues, </xsl:text>
1210
<xsl:value-of select="$name"/>
1211
<xsl:text>)</xsl:text>
1212
</xsl:otherwise>
1213
</xsl:choose>
1214
</xsl:otherwise>
1215
</xsl:choose>
1216
</xsl:template>
1217
1218
<xsl:template match="jint|jlocation" mode="traceInFormat">
1219
<xsl:param name="name"/>
1220
<xsl:text> </xsl:text>
1221
<xsl:value-of select="$name"/>
1222
<xsl:text>=%d</xsl:text>
1223
</xsl:template>
1224
1225
<xsl:template match="jlong" mode="traceInFormat">
1226
<xsl:param name="name"/>
1227
<xsl:text> </xsl:text>
1228
<xsl:value-of select="$name"/>
1229
<xsl:text>=%ld</xsl:text>
1230
</xsl:template>
1231
1232
<xsl:template match="size_t" mode="traceInFormat">
1233
<xsl:param name="name"/>
1234
<xsl:text> </xsl:text>
1235
<xsl:value-of select="$name"/>
1236
<xsl:text>=0x%zx</xsl:text>
1237
</xsl:template>
1238
1239
<xsl:template match="jfloat|jdouble" mode="traceInFormat">
1240
<xsl:param name="name"/>
1241
<xsl:text> </xsl:text>
1242
<xsl:value-of select="$name"/>
1243
<xsl:text>=%f</xsl:text>
1244
</xsl:template>
1245
1246
<xsl:template match="char" mode="traceInFormat">
1247
<xsl:param name="name"/>
1248
<xsl:text> </xsl:text>
1249
<xsl:value-of select="$name"/>
1250
<xsl:text>=%c</xsl:text>
1251
</xsl:template>
1252
1253
<xsl:template match="uchar|jchar" mode="traceInFormat">
1254
<xsl:param name="name"/>
1255
<xsl:text> </xsl:text>
1256
<xsl:value-of select="$name"/>
1257
<xsl:text>=0x%x</xsl:text>
1258
</xsl:template>
1259
1260
<xsl:template match="jint|jlocation|jchar|jlong|jfloat|jdouble|char|uchar|size_t" mode="traceInValue">
1261
<xsl:param name="name"/>
1262
<xsl:text>, </xsl:text>
1263
<xsl:value-of select="$name"/>
1264
</xsl:template>
1265
1266
1267
<xsl:template match="jboolean" mode="traceInFormat">
1268
<xsl:param name="name"/>
1269
<xsl:text> </xsl:text>
1270
<xsl:value-of select="$name"/>
1271
<xsl:text>=%s</xsl:text>
1272
</xsl:template>
1273
1274
<xsl:template match="jboolean" mode="traceInValue">
1275
<xsl:param name="name"/>
1276
<xsl:text>, </xsl:text>
1277
<xsl:value-of select="$name"/>
1278
<xsl:text>? "true" : "false"</xsl:text>
1279
</xsl:template>
1280
1281
<xsl:template match="jobject|jvalue|jthreadGroup|void|struct" mode="traceInFormat">
1282
</xsl:template>
1283
1284
<xsl:template match="jobject|jvalue|jthreadGroup|void|struct" mode="traceInValue">
1285
</xsl:template>
1286
1287
1288
1289
</xsl:stylesheet>
1290
1291