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