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