dcubed@1619: /* trims@1907: * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. dcubed@1619: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. dcubed@1619: * dcubed@1619: * This code is free software; you can redistribute it and/or modify it dcubed@1619: * under the terms of the GNU General Public License version 2 only, as trims@1907: * published by the Free Software Foundation. Oracle designates this dcubed@1619: * particular file as subject to the "Classpath" exception as provided trims@1907: * by Oracle in the LICENSE file that accompanied this code. dcubed@1619: * dcubed@1619: * This code is distributed in the hope that it will be useful, but WITHOUT dcubed@1619: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dcubed@1619: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dcubed@1619: * version 2 for more details (a copy is included in the LICENSE file that dcubed@1619: * accompanied this code). dcubed@1619: * dcubed@1619: * You should have received a copy of the GNU General Public License version dcubed@1619: * 2 along with this work; if not, write to the Free Software Foundation, dcubed@1619: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. dcubed@1619: * trims@1907: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA trims@1907: * or visit www.oracle.com if you need additional information or have any trims@1907: * questions. dcubed@1619: */ dcubed@1619: dcubed@1619: /* dcubed@1619: * This header file defines the data structures sent by the VM dcubed@1619: * through the JVMTI CompiledMethodLoad callback function via the dcubed@1619: * "void * compile_info" parameter. The memory pointed to by the dcubed@1619: * compile_info parameter may not be referenced after returning from dcubed@1619: * the CompiledMethodLoad callback. These are VM implementation dcubed@1619: * specific data structures that may evolve in future releases. A dcubed@1619: * JVMTI agent should interpret a non-NULL compile_info as a pointer dcubed@1619: * to a region of memory containing a list of records. In a typical dcubed@1619: * usage scenario, a JVMTI agent would cast each record to a dcubed@1619: * jvmtiCompiledMethodLoadRecordHeader, a struct that represents dcubed@1619: * arbitrary information. This struct contains a kind field to indicate dcubed@1619: * the kind of information being passed, and a pointer to the next dcubed@1619: * record. If the kind field indicates inlining information, then the dcubed@1619: * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord. dcubed@1619: * This record contains an array of PCStackInfo structs, which indicate dcubed@1619: * for every pc address what are the methods on the invocation stack. dcubed@1619: * The "methods" and "bcis" fields in each PCStackInfo struct specify a dcubed@1619: * 1-1 mapping between these inlined methods and their bytecode indices. dcubed@1619: * This can be used to derive the proper source lines of the inlined dcubed@1619: * methods. dcubed@1619: */ dcubed@1619: dcubed@1619: #ifndef _JVMTI_CMLR_H_ dcubed@1619: #define _JVMTI_CMLR_H_ dcubed@1619: dcubed@1619: enum { dcubed@1619: JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001, dcubed@1619: JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000, dcubed@1619: dcubed@1619: JVMTI_CMLR_MAJOR_VERSION = 0x00000001, dcubed@1619: JVMTI_CMLR_MINOR_VERSION = 0x00000000 dcubed@1619: dcubed@1619: /* dcubed@1619: * This comment is for the "JDK import from HotSpot" sanity check: dcubed@1619: * version: 1.0.0 dcubed@1619: */ dcubed@1619: }; dcubed@1619: dcubed@1619: typedef enum { dcubed@1619: JVMTI_CMLR_DUMMY = 1, dcubed@1619: JVMTI_CMLR_INLINE_INFO = 2 dcubed@1619: } jvmtiCMLRKind; dcubed@1619: dcubed@1619: /* dcubed@1619: * Record that represents arbitrary information passed through JVMTI dcubed@1619: * CompiledMethodLoadEvent void pointer. dcubed@1619: */ dcubed@1619: typedef struct _jvmtiCompiledMethodLoadRecordHeader { dcubed@1619: jvmtiCMLRKind kind; /* id for the kind of info passed in the record */ dcubed@1619: jint majorinfoversion; /* major and minor info version values. Init'ed */ dcubed@1619: jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */ dcubed@1619: dcubed@1619: struct _jvmtiCompiledMethodLoadRecordHeader* next; dcubed@1619: } jvmtiCompiledMethodLoadRecordHeader; dcubed@1619: dcubed@1619: /* dcubed@1619: * Record that gives information about the methods on the compile-time dcubed@1619: * stack at a specific pc address of a compiled method. Each element in dcubed@1619: * the methods array maps to same element in the bcis array. dcubed@1619: */ dcubed@1619: typedef struct _PCStackInfo { dcubed@1619: void* pc; /* the pc address for this compiled method */ dcubed@1619: jint numstackframes; /* number of methods on the stack */ dcubed@1619: jmethodID* methods; /* array of numstackframes method ids */ dcubed@1619: jint* bcis; /* array of numstackframes bytecode indices */ dcubed@1619: } PCStackInfo; dcubed@1619: dcubed@1619: /* dcubed@1619: * Record that contains inlining information for each pc address of dcubed@1619: * an nmethod. dcubed@1619: */ dcubed@1619: typedef struct _jvmtiCompiledMethodLoadInlineRecord { dcubed@1619: jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ dcubed@1619: jint numpcs; /* number of pc descriptors in this nmethod */ dcubed@1619: PCStackInfo* pcinfo; /* array of numpcs pc descriptors */ dcubed@1619: } jvmtiCompiledMethodLoadInlineRecord; dcubed@1619: dcubed@1619: /* dcubed@1619: * Dummy record used to test that we can pass records with different dcubed@1619: * information through the void pointer provided that they can be cast dcubed@1619: * to a jvmtiCompiledMethodLoadRecordHeader. dcubed@1619: */ dcubed@1619: dcubed@1619: typedef struct _jvmtiCompiledMethodLoadDummyRecord { dcubed@1619: jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */ dcubed@1619: char message[50]; dcubed@1619: } jvmtiCompiledMethodLoadDummyRecord; dcubed@1619: dcubed@1619: #endif