src/share/vm/code/jvmticmlr.h

Thu, 24 May 2018 18:41:44 +0800

author
aoqi
date
Thu, 24 May 2018 18:41:44 +0800
changeset 8856
ac27a9c85bea
parent 6876
710a3c8b516e
permissions
-rw-r--r--

Merge

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

mercurial