1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/code/jvmticmlr.h Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,115 @@ 1.4 +/* 1.5 + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +/* 1.30 + * This header file defines the data structures sent by the VM 1.31 + * through the JVMTI CompiledMethodLoad callback function via the 1.32 + * "void * compile_info" parameter. The memory pointed to by the 1.33 + * compile_info parameter may not be referenced after returning from 1.34 + * the CompiledMethodLoad callback. These are VM implementation 1.35 + * specific data structures that may evolve in future releases. A 1.36 + * JVMTI agent should interpret a non-NULL compile_info as a pointer 1.37 + * to a region of memory containing a list of records. In a typical 1.38 + * usage scenario, a JVMTI agent would cast each record to a 1.39 + * jvmtiCompiledMethodLoadRecordHeader, a struct that represents 1.40 + * arbitrary information. This struct contains a kind field to indicate 1.41 + * the kind of information being passed, and a pointer to the next 1.42 + * record. If the kind field indicates inlining information, then the 1.43 + * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord. 1.44 + * This record contains an array of PCStackInfo structs, which indicate 1.45 + * for every pc address what are the methods on the invocation stack. 1.46 + * The "methods" and "bcis" fields in each PCStackInfo struct specify a 1.47 + * 1-1 mapping between these inlined methods and their bytecode indices. 1.48 + * This can be used to derive the proper source lines of the inlined 1.49 + * methods. 1.50 + */ 1.51 + 1.52 +#ifndef _JVMTI_CMLR_H_ 1.53 +#define _JVMTI_CMLR_H_ 1.54 + 1.55 +enum { 1.56 + JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001, 1.57 + JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000, 1.58 + 1.59 + JVMTI_CMLR_MAJOR_VERSION = 0x00000001, 1.60 + JVMTI_CMLR_MINOR_VERSION = 0x00000000 1.61 + 1.62 + /* 1.63 + * This comment is for the "JDK import from HotSpot" sanity check: 1.64 + * version: 1.0.0 1.65 + */ 1.66 +}; 1.67 + 1.68 +typedef enum { 1.69 + JVMTI_CMLR_DUMMY = 1, 1.70 + JVMTI_CMLR_INLINE_INFO = 2 1.71 +} jvmtiCMLRKind; 1.72 + 1.73 +/* 1.74 + * Record that represents arbitrary information passed through JVMTI 1.75 + * CompiledMethodLoadEvent void pointer. 1.76 + */ 1.77 +typedef struct _jvmtiCompiledMethodLoadRecordHeader { 1.78 + jvmtiCMLRKind kind; /* id for the kind of info passed in the record */ 1.79 + jint majorinfoversion; /* major and minor info version values. Init'ed */ 1.80 + jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */ 1.81 + 1.82 + struct _jvmtiCompiledMethodLoadRecordHeader* next; 1.83 +} jvmtiCompiledMethodLoadRecordHeader; 1.84 + 1.85 +/* 1.86 + * Record that gives information about the methods on the compile-time 1.87 + * stack at a specific pc address of a compiled method. Each element in 1.88 + * the methods array maps to same element in the bcis array. 1.89 + */ 1.90 +typedef struct _PCStackInfo { 1.91 + void* pc; /* the pc address for this compiled method */ 1.92 + jint numstackframes; /* number of methods on the stack */ 1.93 + jmethodID* methods; /* array of numstackframes method ids */ 1.94 + jint* bcis; /* array of numstackframes bytecode indices */ 1.95 +} PCStackInfo; 1.96 + 1.97 +/* 1.98 + * Record that contains inlining information for each pc address of 1.99 + * an nmethod. 1.100 + */ 1.101 +typedef struct _jvmtiCompiledMethodLoadInlineRecord { 1.102 + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ 1.103 + jint numpcs; /* number of pc descriptors in this nmethod */ 1.104 + PCStackInfo* pcinfo; /* array of numpcs pc descriptors */ 1.105 +} jvmtiCompiledMethodLoadInlineRecord; 1.106 + 1.107 +/* 1.108 + * Dummy record used to test that we can pass records with different 1.109 + * information through the void pointer provided that they can be cast 1.110 + * to a jvmtiCompiledMethodLoadRecordHeader. 1.111 + */ 1.112 + 1.113 +typedef struct _jvmtiCompiledMethodLoadDummyRecord { 1.114 + jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ 1.115 + char message[50]; 1.116 +} jvmtiCompiledMethodLoadDummyRecord; 1.117 + 1.118 +#endif