Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/code/jvmticmlr.h
32285 views
/*1* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/*26* This header file defines the data structures sent by the VM27* through the JVMTI CompiledMethodLoad callback function via the28* "void * compile_info" parameter. The memory pointed to by the29* compile_info parameter may not be referenced after returning from30* the CompiledMethodLoad callback. These are VM implementation31* specific data structures that may evolve in future releases. A32* JVMTI agent should interpret a non-NULL compile_info as a pointer33* to a region of memory containing a list of records. In a typical34* usage scenario, a JVMTI agent would cast each record to a35* jvmtiCompiledMethodLoadRecordHeader, a struct that represents36* arbitrary information. This struct contains a kind field to indicate37* the kind of information being passed, and a pointer to the next38* record. If the kind field indicates inlining information, then the39* agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord.40* This record contains an array of PCStackInfo structs, which indicate41* for every pc address what are the methods on the invocation stack.42* The "methods" and "bcis" fields in each PCStackInfo struct specify a43* 1-1 mapping between these inlined methods and their bytecode indices.44* This can be used to derive the proper source lines of the inlined45* methods.46*/4748#ifndef _JVMTI_CMLR_H_49#define _JVMTI_CMLR_H_5051enum {52JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001,53JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000,5455JVMTI_CMLR_MAJOR_VERSION = 0x00000001,56JVMTI_CMLR_MINOR_VERSION = 0x000000005758/*59* This comment is for the "JDK import from HotSpot" sanity check:60* version: 1.0.061*/62};6364typedef enum {65JVMTI_CMLR_DUMMY = 1,66JVMTI_CMLR_INLINE_INFO = 267} jvmtiCMLRKind;6869/*70* Record that represents arbitrary information passed through JVMTI71* CompiledMethodLoadEvent void pointer.72*/73typedef struct _jvmtiCompiledMethodLoadRecordHeader {74jvmtiCMLRKind kind; /* id for the kind of info passed in the record */75jint majorinfoversion; /* major and minor info version values. Init'ed */76jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */7778struct _jvmtiCompiledMethodLoadRecordHeader* next;79} jvmtiCompiledMethodLoadRecordHeader;8081/*82* Record that gives information about the methods on the compile-time83* stack at a specific pc address of a compiled method. Each element in84* the methods array maps to same element in the bcis array.85*/86typedef struct _PCStackInfo {87void* pc; /* the pc address for this compiled method */88jint numstackframes; /* number of methods on the stack */89jmethodID* methods; /* array of numstackframes method ids */90jint* bcis; /* array of numstackframes bytecode indices */91} PCStackInfo;9293/*94* Record that contains inlining information for each pc address of95* an nmethod.96*/97typedef struct _jvmtiCompiledMethodLoadInlineRecord {98jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */99jint numpcs; /* number of pc descriptors in this nmethod */100PCStackInfo* pcinfo; /* array of numpcs pc descriptors */101} jvmtiCompiledMethodLoadInlineRecord;102103/*104* Dummy record used to test that we can pass records with different105* information through the void pointer provided that they can be cast106* to a jvmtiCompiledMethodLoadRecordHeader.107*/108109typedef struct _jvmtiCompiledMethodLoadDummyRecord {110jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */111char message[50];112} jvmtiCompiledMethodLoadDummyRecord;113114#endif115116117