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