Crossfire JXClient, Trunk
jvmticmlr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation. Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 /*
27  * This header file defines the data structures sent by the VM
28  * through the JVMTI CompiledMethodLoad callback function via the
29  * "void * compile_info" parameter. The memory pointed to by the
30  * compile_info parameter may not be referenced after returning from
31  * the CompiledMethodLoad callback. These are VM implementation
32  * specific data structures that may evolve in future releases. A
33  * JVMTI agent should interpret a non-NULL compile_info as a pointer
34  * to a region of memory containing a list of records. In a typical
35  * usage scenario, a JVMTI agent would cast each record to a
36  * jvmtiCompiledMethodLoadRecordHeader, a struct that represents
37  * arbitrary information. This struct contains a kind field to indicate
38  * the kind of information being passed, and a pointer to the next
39  * record. If the kind field indicates inlining information, then the
40  * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord.
41  * This record contains an array of PCStackInfo structs, which indicate
42  * for every pc address what are the methods on the invocation stack.
43  * The "methods" and "bcis" fields in each PCStackInfo struct specify a
44  * 1-1 mapping between these inlined methods and their bytecode indices.
45  * This can be used to derive the proper source lines of the inlined
46  * methods.
47  */
48 
49 #ifndef _JVMTI_CMLR_H_
50 #define _JVMTI_CMLR_H_
51 
52 enum {
55 
58 
59  /*
60  * This comment is for the "JDK import from HotSpot" sanity check:
61  * version: 1.0.0
62  */
63 };
64 
65 typedef enum {
69 
70 /*
71  * Record that represents arbitrary information passed through JVMTI
72  * CompiledMethodLoadEvent void pointer.
73  */
75  jvmtiCMLRKind kind; /* id for the kind of info passed in the record */
76  jint majorinfoversion; /* major and minor info version values. Init'ed */
77  jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */
78 
81 
82 /*
83  * Record that gives information about the methods on the compile-time
84  * stack at a specific pc address of a compiled method. Each element in
85  * the methods array maps to same element in the bcis array.
86  */
87 typedef struct _PCStackInfo {
88  void* pc; /* the pc address for this compiled method */
89  jint numstackframes; /* number of methods on the stack */
90  jmethodID* methods; /* array of numstackframes method ids */
91  jint* bcis; /* array of numstackframes bytecode indices */
92 } PCStackInfo;
93 
94 /*
95  * Record that contains inlining information for each pc address of
96  * an nmethod.
97  */
99  jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */
100  jint numpcs; /* number of pc descriptors in this nmethod */
101  PCStackInfo* pcinfo; /* array of numpcs pc descriptors */
103 
104 /*
105  * Dummy record used to test that we can pass records with different
106  * information through the void pointer provided that they can be cast
107  * to a jvmtiCompiledMethodLoadRecordHeader.
108  */
109 
111  jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */
112  char message[50];
114 
115 #endif
_jvmtiCompiledMethodLoadRecordHeader::next
struct _jvmtiCompiledMethodLoadRecordHeader * next
Definition: jvmticmlr.h:79
_jvmtiCompiledMethodLoadInlineRecord::header
jvmtiCompiledMethodLoadRecordHeader header
Definition: jvmticmlr.h:99
jmethodID
struct _jmethodID * jmethodID
Definition: jni.h:136
jvmtiCompiledMethodLoadInlineRecord
struct _jvmtiCompiledMethodLoadInlineRecord jvmtiCompiledMethodLoadInlineRecord
_PCStackInfo
Definition: jvmticmlr.h:87
JVMTI_CMLR_INLINE_INFO
@ JVMTI_CMLR_INLINE_INFO
Definition: jvmticmlr.h:67
PCStackInfo
struct _PCStackInfo PCStackInfo
JVMTI_CMLR_DUMMY
@ JVMTI_CMLR_DUMMY
Definition: jvmticmlr.h:66
jvmtiCompiledMethodLoadDummyRecord
struct _jvmtiCompiledMethodLoadDummyRecord jvmtiCompiledMethodLoadDummyRecord
_jvmtiCompiledMethodLoadRecordHeader
Definition: jvmticmlr.h:74
_PCStackInfo::pc
void * pc
Definition: jvmticmlr.h:88
JVMTI_CMLR_MAJOR_VERSION
@ JVMTI_CMLR_MAJOR_VERSION
Definition: jvmticmlr.h:56
_jvmtiCompiledMethodLoadRecordHeader::kind
jvmtiCMLRKind kind
Definition: jvmticmlr.h:75
_jvmtiCompiledMethodLoadRecordHeader::majorinfoversion
jint majorinfoversion
Definition: jvmticmlr.h:76
_jvmtiCompiledMethodLoadDummyRecord::message
char message[50]
Definition: jvmticmlr.h:112
_jvmtiCompiledMethodLoadDummyRecord
Definition: jvmticmlr.h:110
_PCStackInfo::numstackframes
jint numstackframes
Definition: jvmticmlr.h:89
_PCStackInfo::methods
jmethodID * methods
Definition: jvmticmlr.h:90
_jvmtiCompiledMethodLoadInlineRecord::pcinfo
PCStackInfo * pcinfo
Definition: jvmticmlr.h:101
jvmtiCompiledMethodLoadRecordHeader
struct _jvmtiCompiledMethodLoadRecordHeader jvmtiCompiledMethodLoadRecordHeader
_jvmtiCompiledMethodLoadDummyRecord::header
jvmtiCompiledMethodLoadRecordHeader header
Definition: jvmticmlr.h:111
jint
long jint
Definition: jni_md.h:33
_PCStackInfo::bcis
jint * bcis
Definition: jvmticmlr.h:91
jvmtiCMLRKind
jvmtiCMLRKind
Definition: jvmticmlr.h:65
JVMTI_CMLR_MINOR_VERSION
@ JVMTI_CMLR_MINOR_VERSION
Definition: jvmticmlr.h:57
_jvmtiCompiledMethodLoadInlineRecord::numpcs
jint numpcs
Definition: jvmticmlr.h:100
_jvmtiCompiledMethodLoadInlineRecord
Definition: jvmticmlr.h:98
JVMTI_CMLR_MINOR_VERSION_0
@ JVMTI_CMLR_MINOR_VERSION_0
Definition: jvmticmlr.h:54
JVMTI_CMLR_MAJOR_VERSION_1
@ JVMTI_CMLR_MAJOR_VERSION_1
Definition: jvmticmlr.h:53
_jvmtiCompiledMethodLoadRecordHeader::minorinfoversion
jint minorinfoversion
Definition: jvmticmlr.h:77