Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/hotspot/share/prims/jvmtiEnv.xsl
41144 views
1
<?xml version="1.0"?>
2
<!--
3
Copyright (c) 2002, 2021, 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:template match="/">
33
<xsl:apply-templates select="specification"/>
34
</xsl:template>
35
36
<xsl:template match="specification">
37
<xsl:call-template name="sourceHeader"/>
38
<xsl:text>
39
40
// end file prefix - do not modify or remove this line
41
</xsl:text>
42
<xsl:apply-templates select="functionsection"/>
43
</xsl:template>
44
45
<xsl:template match="functionsection">
46
<xsl:apply-templates select="category"/>
47
</xsl:template>
48
49
<xsl:template match="category">
50
<xsl:text>
51
//
52
// </xsl:text><xsl:value-of select="@label"/><xsl:text> functions
53
//
54
</xsl:text>
55
<xsl:apply-templates select="function[not(contains(@impl,'unimpl'))]"/>
56
</xsl:template>
57
58
<xsl:template match="function">
59
<xsl:apply-templates select="parameters" mode="advice"/>
60
<xsl:text>
61
jvmtiError
62
JvmtiEnv::</xsl:text>
63
<xsl:if test="count(@hide)=1">
64
<xsl:value-of select="@hide"/>
65
</xsl:if>
66
<xsl:value-of select="@id"/>
67
<xsl:text>(</xsl:text>
68
<xsl:apply-templates select="parameters" mode="HotSpotSig"/>
69
<xsl:text>) {</xsl:text>
70
<xsl:for-each select="parameters/param/jclass">
71
<xsl:if test="count(@method|@field)=0">
72
<xsl:text>
73
if (java_lang_Class::is_primitive(k_mirror)) {
74
// DO PRIMITIVE CLASS PROCESSING
75
return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
76
}
77
Klass* k_oop = java_lang_Class::as_Klass(k_mirror);
78
if (k_oop == NULL) {
79
return JVMTI_ERROR_INVALID_CLASS;
80
}</xsl:text>
81
</xsl:if>
82
</xsl:for-each>
83
<xsl:text>
84
return JVMTI_ERROR_MUST_POSSESS_CAPABILITY;
85
} /* end </xsl:text>
86
<xsl:if test="count(@hide)=1">
87
<xsl:value-of select="@hide"/>
88
</xsl:if>
89
<xsl:value-of select="@id"/>
90
<xsl:text> */
91
92
</xsl:text>
93
</xsl:template>
94
95
96
<!-- ======== ADVICE ======== -->
97
98
<xsl:template match="parameters" mode="advice">
99
<xsl:apply-templates select="param" mode="advice"/>
100
</xsl:template>
101
102
<xsl:template match="param" mode="advice">
103
<xsl:apply-templates select="child::*[position()=1]" mode="advice">
104
<xsl:with-param name="name" select="@id"/>
105
</xsl:apply-templates>
106
</xsl:template>
107
108
<xsl:template match="jthread" mode="advice">
109
<xsl:param name="name"/>
110
<xsl:choose>
111
<xsl:when test="count(@impl)=0 or not(contains(@impl,'noconvert'))">
112
<xsl:text>
113
// java_thread - protected by ThreadsListHandle and pre-checked</xsl:text>
114
</xsl:when>
115
<xsl:otherwise>
116
<xsl:text>
117
// </xsl:text>
118
<xsl:value-of select="$name"/>
119
<xsl:text> - NOT protected by ThreadsListHandle and NOT pre-checked</xsl:text>
120
</xsl:otherwise>
121
</xsl:choose>
122
</xsl:template>
123
124
<xsl:template match="jrawMonitorID" mode="advice">
125
<xsl:param name="name"/>
126
<xsl:text>
127
// rmonitor - pre-checked for validity</xsl:text>
128
</xsl:template>
129
130
<xsl:template match="jframeID" mode="advice">
131
<xsl:param name="name"/>
132
<xsl:text>
133
// depth - pre-checked as non-negative</xsl:text>
134
</xsl:template>
135
136
<xsl:template match="jmethodID" mode="advice">
137
<xsl:param name="name"/>
138
<xsl:text>
139
// method - pre-checked for validity, but may be NULL meaning obsolete method</xsl:text>
140
</xsl:template>
141
142
<xsl:template match="jfieldID" mode="advice">
143
<xsl:param name="name"/>
144
</xsl:template>
145
146
<xsl:template match="jclass" mode="advice">
147
<xsl:param name="name"/>
148
<!--
149
classes passed as part of a class/method or class/field pair are used
150
by the wrapper to get the internal type but are not needed by nor
151
passed to the implementation layer.
152
-->
153
<xsl:if test="count(@method|@field)=0">
154
<xsl:text>
155
// k_mirror - may be primitive, this must be checked</xsl:text>
156
</xsl:if>
157
</xsl:template>
158
159
<xsl:template match="nullok" mode="advice">
160
</xsl:template>
161
162
<xsl:template match="outptr|outbuf|allocfieldbuf|ptrtype|inptr|inbuf|vmbuf|allocbuf|agentbuf|allocallocbuf" mode="advice">
163
<xsl:param name="name"/>
164
<xsl:choose>
165
<xsl:when test="count(nullok)=0">
166
<xsl:text>
167
// </xsl:text>
168
<xsl:value-of select="$name"/>
169
<xsl:text> - pre-checked for NULL</xsl:text>
170
</xsl:when>
171
<xsl:otherwise>
172
<xsl:text>
173
// </xsl:text>
174
<xsl:value-of select="$name"/>
175
<xsl:text> - NULL is a valid value, must be checked</xsl:text>
176
</xsl:otherwise>
177
</xsl:choose>
178
</xsl:template>
179
180
<xsl:template match="jint" mode="advice">
181
<xsl:param name="name"/>
182
<xsl:if test="count(@min)=1">
183
<xsl:text>
184
// </xsl:text>
185
<xsl:value-of select="$name"/>
186
<xsl:text> - pre-checked to be greater than or equal to </xsl:text>
187
<xsl:value-of select="@min"/>
188
</xsl:if>
189
</xsl:template>
190
191
<xsl:template match="jobject|jvalue|jthreadGroup|enum|jlong|jfloat|jdouble|jlocation|jboolean|char|uchar|size_t|void|varargs|struct" mode="advice">
192
<xsl:param name="name"/>
193
</xsl:template>
194
195
</xsl:stylesheet>
196
197