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