annotate src/share/vm/prims/jvmtiH.xsl @ 7588:f9eb431c3efe

8006005: Fix constant pool index validation and alignment trap for method parameter reflection Summary: This patch addresses an alignment trap due to the storage format of method parameters data in constMethod. It also adds code to validate constant pool indexes for method parameters data. Reviewed-by: jrose, dholmes Contributed-by: eric.mccorkle@oracle.com
author coleenp
date Mon, 14 Jan 2013 11:01:39 -0500
parents 684faacebf20
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 <?xml version="1.0" encoding="utf-8"?>
a61af66fc99e Initial load
duke
parents:
diff changeset
2 <!--
1988
684faacebf20 7003782: Update JVMTI version to 1.2 for jdk7
kamg
parents: 1552
diff changeset
3 Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
5
a61af66fc99e Initial load
duke
parents:
diff changeset
6 This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
7 under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
8 published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
9
a61af66fc99e Initial load
duke
parents:
diff changeset
10 This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
13 version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
14 accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
15
a61af66fc99e Initial load
duke
parents:
diff changeset
16 You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
17 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
18 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
19
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
22 questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
23
a61af66fc99e Initial load
duke
parents:
diff changeset
24 -->
a61af66fc99e Initial load
duke
parents:
diff changeset
25
a61af66fc99e Initial load
duke
parents:
diff changeset
26 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
a61af66fc99e Initial load
duke
parents:
diff changeset
27 version="1.0">
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 <xsl:import href="jvmtiLib.xsl"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 <xsl:output method="text" omit-xml-declaration="yes"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 <xsl:template match="/">
a61af66fc99e Initial load
duke
parents:
diff changeset
34 <xsl:apply-templates select="specification"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
35 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 <xsl:template match="specification">
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 <xsl:call-template name="intro"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 <xsl:text>/* Derived Base Types */
a61af66fc99e Initial load
duke
parents:
diff changeset
42 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
43 <xsl:apply-templates select="//basetype"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
46
a61af66fc99e Initial load
duke
parents:
diff changeset
47 /* Constants */
a61af66fc99e Initial load
duke
parents:
diff changeset
48 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
49 <xsl:apply-templates select="//constants"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 /* Errors */
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
56 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
57 <xsl:for-each select="//errorid">
a61af66fc99e Initial load
duke
parents:
diff changeset
58 <xsl:sort select="@num" data-type="number"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
59 <xsl:apply-templates select="." mode="enum"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
60 <xsl:text>,
a61af66fc99e Initial load
duke
parents:
diff changeset
61 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
62 <xsl:if test="position() = last()">
a61af66fc99e Initial load
duke
parents:
diff changeset
63 <xsl:text> JVMTI_ERROR_MAX = </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
64 <xsl:value-of select="@num"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
65 </xsl:if>
a61af66fc99e Initial load
duke
parents:
diff changeset
66 </xsl:for-each>
a61af66fc99e Initial load
duke
parents:
diff changeset
67 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
68 } jvmtiError;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
70 <xsl:apply-templates select="eventsection" mode="enum"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
71
a61af66fc99e Initial load
duke
parents:
diff changeset
72 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
73 /* Pre-Declarations */
a61af66fc99e Initial load
duke
parents:
diff changeset
74 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
75 <xsl:apply-templates select="//typedef|//uniontypedef" mode="early"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
78 /* Function Types */
a61af66fc99e Initial load
duke
parents:
diff changeset
79 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
80 <xsl:apply-templates select="//callback"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 /* Structure Types */
a61af66fc99e Initial load
duke
parents:
diff changeset
85 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
86 <xsl:apply-templates select="//typedef|//uniontypedef" mode="body"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
87 <xsl:apply-templates select="//capabilitiestypedef"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 <xsl:apply-templates select="eventsection" mode="body"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 <xsl:apply-templates select="functionsection"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 <xsl:call-template name="outro"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
94
a61af66fc99e Initial load
duke
parents:
diff changeset
95 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 <xsl:template name="intro">
a61af66fc99e Initial load
duke
parents:
diff changeset
98 <xsl:call-template name="includeHeader"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
99 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
100 /* Include file for the Java(tm) Virtual Machine Tool Interface */
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 #ifndef _JAVA_JVMTI_H_
a61af66fc99e Initial load
duke
parents:
diff changeset
103 #define _JAVA_JVMTI_H_
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 #include "jni.h"
a61af66fc99e Initial load
duke
parents:
diff changeset
106
a61af66fc99e Initial load
duke
parents:
diff changeset
107 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
108 extern "C" {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
110
a61af66fc99e Initial load
duke
parents:
diff changeset
111 enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
112 JVMTI_VERSION_1 = 0x30010000,
a61af66fc99e Initial load
duke
parents:
diff changeset
113 JVMTI_VERSION_1_0 = 0x30010000,
a61af66fc99e Initial load
duke
parents:
diff changeset
114 JVMTI_VERSION_1_1 = 0x30010100,
1988
684faacebf20 7003782: Update JVMTI version to 1.2 for jdk7
kamg
parents: 1552
diff changeset
115 JVMTI_VERSION_1_2 = 0x30010200,
0
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 JVMTI_VERSION = 0x30000000 + (</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
118 <xsl:value-of select="//specification/@majorversion"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
119 <xsl:text> * 0x10000) + (</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
120 <xsl:value-of select="//specification/@minorversion"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
121 <xsl:text> * 0x100)</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
122 <xsl:variable name="micro">
a61af66fc99e Initial load
duke
parents:
diff changeset
123 <xsl:call-template name="microversion"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
124 </xsl:variable>
a61af66fc99e Initial load
duke
parents:
diff changeset
125 <xsl:choose>
a61af66fc99e Initial load
duke
parents:
diff changeset
126 <xsl:when test="string($micro)='dev'">
a61af66fc99e Initial load
duke
parents:
diff changeset
127 <xsl:text> /* checked out - </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
128 </xsl:when>
a61af66fc99e Initial load
duke
parents:
diff changeset
129 <xsl:otherwise>
a61af66fc99e Initial load
duke
parents:
diff changeset
130 <xsl:text> + </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
131 <xsl:value-of select="$micro"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
132 <xsl:text> /* </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
133 </xsl:otherwise>
a61af66fc99e Initial load
duke
parents:
diff changeset
134 </xsl:choose>
a61af66fc99e Initial load
duke
parents:
diff changeset
135 <xsl:text>version: </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
136 <xsl:call-template name="showversion"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
137 <xsl:text> */
a61af66fc99e Initial load
duke
parents:
diff changeset
138 };
a61af66fc99e Initial load
duke
parents:
diff changeset
139
a61af66fc99e Initial load
duke
parents:
diff changeset
140 JNIEXPORT jint JNICALL
a61af66fc99e Initial load
duke
parents:
diff changeset
141 Agent_OnLoad(JavaVM *vm, char *options, void *reserved);
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 JNIEXPORT jint JNICALL
a61af66fc99e Initial load
duke
parents:
diff changeset
144 Agent_OnAttach(JavaVM* vm, char* options, void* reserved);
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 JNIEXPORT void JNICALL
a61af66fc99e Initial load
duke
parents:
diff changeset
147 Agent_OnUnload(JavaVM *vm);
a61af66fc99e Initial load
duke
parents:
diff changeset
148
a61af66fc99e Initial load
duke
parents:
diff changeset
149 /* Forward declaration of the environment */
a61af66fc99e Initial load
duke
parents:
diff changeset
150
a61af66fc99e Initial load
duke
parents:
diff changeset
151 struct _jvmtiEnv;
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 struct jvmtiInterface_1_;
a61af66fc99e Initial load
duke
parents:
diff changeset
154
a61af66fc99e Initial load
duke
parents:
diff changeset
155 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
156 typedef _jvmtiEnv jvmtiEnv;
a61af66fc99e Initial load
duke
parents:
diff changeset
157 #else
a61af66fc99e Initial load
duke
parents:
diff changeset
158 typedef const struct jvmtiInterface_1_ *jvmtiEnv;
a61af66fc99e Initial load
duke
parents:
diff changeset
159 #endif /* __cplusplus */
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
162 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164 <xsl:template name="outro">
a61af66fc99e Initial load
duke
parents:
diff changeset
165 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
166
a61af66fc99e Initial load
duke
parents:
diff changeset
167 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
168 } /* extern "C" */
a61af66fc99e Initial load
duke
parents:
diff changeset
169 #endif /* __cplusplus */
a61af66fc99e Initial load
duke
parents:
diff changeset
170
a61af66fc99e Initial load
duke
parents:
diff changeset
171 #endif /* !_JAVA_JVMTI_H_ */
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
174 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
175
a61af66fc99e Initial load
duke
parents:
diff changeset
176 <xsl:template match="eventsection" mode="enum">
a61af66fc99e Initial load
duke
parents:
diff changeset
177 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
178 /* Event IDs */
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 typedef enum {
a61af66fc99e Initial load
duke
parents:
diff changeset
181 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
182 <xsl:for-each select="event">
a61af66fc99e Initial load
duke
parents:
diff changeset
183 <xsl:sort select="@num" data-type="number"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
184 <xsl:if test="position()=1">
a61af66fc99e Initial load
duke
parents:
diff changeset
185 <xsl:text> JVMTI_MIN_EVENT_TYPE_VAL = </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
186 <xsl:value-of select="@num"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
187 <xsl:text>,
a61af66fc99e Initial load
duke
parents:
diff changeset
188 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
189 </xsl:if>
a61af66fc99e Initial load
duke
parents:
diff changeset
190 <xsl:apply-templates select="." mode="enum"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
191 <xsl:text>,
a61af66fc99e Initial load
duke
parents:
diff changeset
192 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
193 <xsl:if test="position()=last()">
a61af66fc99e Initial load
duke
parents:
diff changeset
194 <xsl:text> JVMTI_MAX_EVENT_TYPE_VAL = </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
195 <xsl:value-of select="@num"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
196 </xsl:if>
a61af66fc99e Initial load
duke
parents:
diff changeset
197 </xsl:for-each>
a61af66fc99e Initial load
duke
parents:
diff changeset
198 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
199 } jvmtiEvent;
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
202 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
203
a61af66fc99e Initial load
duke
parents:
diff changeset
204 <xsl:template match="eventsection" mode="body">
a61af66fc99e Initial load
duke
parents:
diff changeset
205 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
206
a61af66fc99e Initial load
duke
parents:
diff changeset
207 /* Event Definitions */
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 typedef void (JNICALL *jvmtiEventReserved)(void);
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
212 <xsl:apply-templates select="event" mode="definition">
a61af66fc99e Initial load
duke
parents:
diff changeset
213 <xsl:sort select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
214 </xsl:apply-templates>
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
217 /* Event Callback Structure */
a61af66fc99e Initial load
duke
parents:
diff changeset
218
a61af66fc99e Initial load
duke
parents:
diff changeset
219 typedef struct {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
221 <xsl:call-template name="eventStruct">
a61af66fc99e Initial load
duke
parents:
diff changeset
222 <xsl:with-param name="events" select="event"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
223 <xsl:with-param name="index" select="0"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
224 <xsl:with-param name="started" select="false"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
225 <xsl:with-param name="comment" select="'Yes'"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
226 </xsl:call-template>
a61af66fc99e Initial load
duke
parents:
diff changeset
227 <xsl:text>} jvmtiEventCallbacks;
a61af66fc99e Initial load
duke
parents:
diff changeset
228 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
231
a61af66fc99e Initial load
duke
parents:
diff changeset
232
a61af66fc99e Initial load
duke
parents:
diff changeset
233 <xsl:template match="event" mode="definition">
a61af66fc99e Initial load
duke
parents:
diff changeset
234 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
235 typedef void (JNICALL *jvmtiEvent</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
236 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
237 <xsl:text>)
a61af66fc99e Initial load
duke
parents:
diff changeset
238 (jvmtiEnv *jvmti_env</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
239 <xsl:apply-templates select="parameters" mode="signature">
a61af66fc99e Initial load
duke
parents:
diff changeset
240 <xsl:with-param name="comma">
a61af66fc99e Initial load
duke
parents:
diff changeset
241 <xsl:text>,
a61af66fc99e Initial load
duke
parents:
diff changeset
242 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
243 </xsl:with-param>
a61af66fc99e Initial load
duke
parents:
diff changeset
244 </xsl:apply-templates>
a61af66fc99e Initial load
duke
parents:
diff changeset
245 <xsl:text>);
a61af66fc99e Initial load
duke
parents:
diff changeset
246 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
247 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 <xsl:template match="functionsection">
a61af66fc99e Initial load
duke
parents:
diff changeset
250 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 /* Function Interface */
a61af66fc99e Initial load
duke
parents:
diff changeset
253
a61af66fc99e Initial load
duke
parents:
diff changeset
254 typedef struct jvmtiInterface_1_ {
a61af66fc99e Initial load
duke
parents:
diff changeset
255
a61af66fc99e Initial load
duke
parents:
diff changeset
256 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
257 <xsl:call-template name="funcStruct">
a61af66fc99e Initial load
duke
parents:
diff changeset
258 <xsl:with-param name="funcs" select="category/function[count(@hide)=0]"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
259 <xsl:with-param name="index" select="1"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
260 </xsl:call-template>
a61af66fc99e Initial load
duke
parents:
diff changeset
261
a61af66fc99e Initial load
duke
parents:
diff changeset
262 <xsl:text>} jvmtiInterface_1;
a61af66fc99e Initial load
duke
parents:
diff changeset
263
a61af66fc99e Initial load
duke
parents:
diff changeset
264 struct _jvmtiEnv {
a61af66fc99e Initial load
duke
parents:
diff changeset
265 const struct jvmtiInterface_1_ *functions;
a61af66fc99e Initial load
duke
parents:
diff changeset
266 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
267
a61af66fc99e Initial load
duke
parents:
diff changeset
268 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
269 <xsl:apply-templates select="category" mode="cppinline"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
270 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
271 #endif /* __cplusplus */
a61af66fc99e Initial load
duke
parents:
diff changeset
272 };
a61af66fc99e Initial load
duke
parents:
diff changeset
273 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
274
a61af66fc99e Initial load
duke
parents:
diff changeset
275 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
276
a61af66fc99e Initial load
duke
parents:
diff changeset
277 <xsl:template name="funcStruct">
a61af66fc99e Initial load
duke
parents:
diff changeset
278 <xsl:param name="funcs"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
279 <xsl:param name="index"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
280 <xsl:variable name="thisFunction" select="$funcs[@num=$index]"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
281 <xsl:text> /* </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
282 <xsl:number value="$index" format=" 1"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
283 <xsl:text> : </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
284 <xsl:choose>
a61af66fc99e Initial load
duke
parents:
diff changeset
285 <xsl:when test="count($thisFunction)=1">
a61af66fc99e Initial load
duke
parents:
diff changeset
286 <xsl:value-of select="$thisFunction/synopsis"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
287 <xsl:text> */
a61af66fc99e Initial load
duke
parents:
diff changeset
288 jvmtiError (JNICALL *</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
289 <xsl:value-of select="$thisFunction/@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
290 <xsl:text>) (jvmtiEnv* env</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
291 <xsl:apply-templates select="$thisFunction/parameters" mode="signature">
a61af66fc99e Initial load
duke
parents:
diff changeset
292 <xsl:with-param name="comma">
a61af66fc99e Initial load
duke
parents:
diff changeset
293 <xsl:text>,
a61af66fc99e Initial load
duke
parents:
diff changeset
294 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
295 </xsl:with-param>
a61af66fc99e Initial load
duke
parents:
diff changeset
296 </xsl:apply-templates>
a61af66fc99e Initial load
duke
parents:
diff changeset
297 <xsl:text>)</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
298 </xsl:when>
a61af66fc99e Initial load
duke
parents:
diff changeset
299 <xsl:otherwise>
a61af66fc99e Initial load
duke
parents:
diff changeset
300 <xsl:text> RESERVED */
a61af66fc99e Initial load
duke
parents:
diff changeset
301 void *reserved</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
302 <xsl:value-of select="$index"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
303 </xsl:otherwise>
a61af66fc99e Initial load
duke
parents:
diff changeset
304 </xsl:choose>
a61af66fc99e Initial load
duke
parents:
diff changeset
305 <xsl:text>;
a61af66fc99e Initial load
duke
parents:
diff changeset
306
a61af66fc99e Initial load
duke
parents:
diff changeset
307 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
308 <xsl:if test="count($funcs[@num &gt; $index]) &gt; 0">
a61af66fc99e Initial load
duke
parents:
diff changeset
309 <xsl:call-template name="funcStruct">
a61af66fc99e Initial load
duke
parents:
diff changeset
310 <xsl:with-param name="funcs" select="$funcs"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
311 <xsl:with-param name="index" select="1+$index"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
312 </xsl:call-template>
a61af66fc99e Initial load
duke
parents:
diff changeset
313 </xsl:if>
a61af66fc99e Initial load
duke
parents:
diff changeset
314 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
315
a61af66fc99e Initial load
duke
parents:
diff changeset
316
a61af66fc99e Initial load
duke
parents:
diff changeset
317 <xsl:template match="function">
a61af66fc99e Initial load
duke
parents:
diff changeset
318 <xsl:text> jvmtiError (JNICALL *</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
319 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
320 <xsl:text>) (jvmtiEnv* env</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
321 <xsl:apply-templates select="parameters" mode="signature"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
322 <xsl:text>);
a61af66fc99e Initial load
duke
parents:
diff changeset
323
a61af66fc99e Initial load
duke
parents:
diff changeset
324 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
325 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
326
a61af66fc99e Initial load
duke
parents:
diff changeset
327 <xsl:template match="category" mode="cppinline">
a61af66fc99e Initial load
duke
parents:
diff changeset
328 <xsl:apply-templates select="function[count(@hide)=0]" mode="cppinline"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
329 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
330
a61af66fc99e Initial load
duke
parents:
diff changeset
331 <xsl:template match="function" mode="cppinline">
a61af66fc99e Initial load
duke
parents:
diff changeset
332 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
333 jvmtiError </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
334 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
335 <xsl:text>(</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
336 <xsl:apply-templates select="parameters" mode="signaturenoleadcomma"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
337 <xsl:text>) {
a61af66fc99e Initial load
duke
parents:
diff changeset
338 return functions-></xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
339 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
340 <xsl:text>(this</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
341 <xsl:for-each select="parameters">
a61af66fc99e Initial load
duke
parents:
diff changeset
342 <xsl:for-each select="param">
a61af66fc99e Initial load
duke
parents:
diff changeset
343 <xsl:if test="@id != '...' and count(jclass/@method) = 0">
a61af66fc99e Initial load
duke
parents:
diff changeset
344 <xsl:text>, </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
345 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
346 </xsl:if>
a61af66fc99e Initial load
duke
parents:
diff changeset
347 </xsl:for-each>
a61af66fc99e Initial load
duke
parents:
diff changeset
348 </xsl:for-each>
a61af66fc99e Initial load
duke
parents:
diff changeset
349 <xsl:text>);
a61af66fc99e Initial load
duke
parents:
diff changeset
350 }
a61af66fc99e Initial load
duke
parents:
diff changeset
351 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
352 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
353
a61af66fc99e Initial load
duke
parents:
diff changeset
354
a61af66fc99e Initial load
duke
parents:
diff changeset
355 <xsl:template match="basetype">
a61af66fc99e Initial load
duke
parents:
diff changeset
356 <xsl:if test="count(definition)!=0">
a61af66fc99e Initial load
duke
parents:
diff changeset
357 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
358 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
359 <xsl:apply-templates select="definition"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
360 </xsl:if>
a61af66fc99e Initial load
duke
parents:
diff changeset
361 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
362
a61af66fc99e Initial load
duke
parents:
diff changeset
363 <xsl:template match="constants">
a61af66fc99e Initial load
duke
parents:
diff changeset
364 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
365
a61af66fc99e Initial load
duke
parents:
diff changeset
366 /* </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
367 <xsl:value-of select="@label"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
368 <xsl:text> */
a61af66fc99e Initial load
duke
parents:
diff changeset
369 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
370 <xsl:choose>
a61af66fc99e Initial load
duke
parents:
diff changeset
371 <xsl:when test="@kind='enum'">
a61af66fc99e Initial load
duke
parents:
diff changeset
372 <xsl:apply-templates select="." mode="enum"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
373 </xsl:when>
a61af66fc99e Initial load
duke
parents:
diff changeset
374 <xsl:otherwise>
a61af66fc99e Initial load
duke
parents:
diff changeset
375 <xsl:apply-templates select="." mode="constants"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
376 </xsl:otherwise>
a61af66fc99e Initial load
duke
parents:
diff changeset
377 </xsl:choose>
a61af66fc99e Initial load
duke
parents:
diff changeset
378 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
379
a61af66fc99e Initial load
duke
parents:
diff changeset
380 <xsl:template match="callback">
a61af66fc99e Initial load
duke
parents:
diff changeset
381 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
382 typedef </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
383 <xsl:apply-templates select="child::*[position()=1]" mode="signature"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
384 <xsl:text> (JNICALL *</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
385 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
386 <xsl:text>)
a61af66fc99e Initial load
duke
parents:
diff changeset
387 (</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
388 <xsl:for-each select="parameters">
a61af66fc99e Initial load
duke
parents:
diff changeset
389 <xsl:apply-templates select="param[position()=1]" mode="signature"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
390 <xsl:for-each select="param[position()>1]">
a61af66fc99e Initial load
duke
parents:
diff changeset
391 <xsl:text>, </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
392 <xsl:apply-templates select="." mode="signature"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
393 </xsl:for-each>
a61af66fc99e Initial load
duke
parents:
diff changeset
394 </xsl:for-each>
a61af66fc99e Initial load
duke
parents:
diff changeset
395 <xsl:text>);
a61af66fc99e Initial load
duke
parents:
diff changeset
396 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
397 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
398
a61af66fc99e Initial load
duke
parents:
diff changeset
399 <xsl:template match="capabilitiestypedef">
a61af66fc99e Initial load
duke
parents:
diff changeset
400 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
401 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
402 <xsl:apply-templates select="." mode="genstruct"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
403 <xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
404 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
405 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
406
a61af66fc99e Initial load
duke
parents:
diff changeset
407 <xsl:template match="typedef" mode="early">
a61af66fc99e Initial load
duke
parents:
diff changeset
408 <xsl:text>struct _</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
409 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
410 <xsl:text>;
a61af66fc99e Initial load
duke
parents:
diff changeset
411 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
412 <xsl:text>typedef struct _</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
413 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
414 <xsl:text> </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
415 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
416 <xsl:text>;
a61af66fc99e Initial load
duke
parents:
diff changeset
417 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
418 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
419
a61af66fc99e Initial load
duke
parents:
diff changeset
420 <xsl:template match="typedef" mode="body">
a61af66fc99e Initial load
duke
parents:
diff changeset
421 <xsl:text>struct _</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
422 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
423 <xsl:text> {
a61af66fc99e Initial load
duke
parents:
diff changeset
424 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
425 <xsl:apply-templates select="field" mode="signature"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
426 <xsl:text>};
a61af66fc99e Initial load
duke
parents:
diff changeset
427 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
428 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
429
a61af66fc99e Initial load
duke
parents:
diff changeset
430 <xsl:template match="uniontypedef" mode="early">
a61af66fc99e Initial load
duke
parents:
diff changeset
431 <xsl:text>union _</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
432 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
433 <xsl:text>;
a61af66fc99e Initial load
duke
parents:
diff changeset
434 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
435 <xsl:text>typedef union _</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
436 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
437 <xsl:text> </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
438 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
439 <xsl:text>;
a61af66fc99e Initial load
duke
parents:
diff changeset
440 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
441 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
442
a61af66fc99e Initial load
duke
parents:
diff changeset
443 <xsl:template match="uniontypedef" mode="body">
a61af66fc99e Initial load
duke
parents:
diff changeset
444 <xsl:text>union _</xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
445 <xsl:value-of select="@id"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
446 <xsl:text> {
a61af66fc99e Initial load
duke
parents:
diff changeset
447 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
448 <xsl:apply-templates select="field" mode="signature"/>
a61af66fc99e Initial load
duke
parents:
diff changeset
449 <xsl:text>};
a61af66fc99e Initial load
duke
parents:
diff changeset
450 </xsl:text>
a61af66fc99e Initial load
duke
parents:
diff changeset
451 </xsl:template>
a61af66fc99e Initial load
duke
parents:
diff changeset
452
a61af66fc99e Initial load
duke
parents:
diff changeset
453 </xsl:stylesheet>