jvmti2_sys/jvmticmlr.rs
1use core::ffi::{c_char, c_void};
2use jni_sys::{jint, jmethodID};
3
4#[repr(C)]
5#[derive(Clone, Copy, Debug)]
6pub enum jvmtiCMLRKind {
7 JVMTI_CMLR_DUMMY = 1,
8 JVMTI_CMLR_INLINE_INFO = 2,
9}
10
11pub type jvmtiCompiledMethodLoadRecordHeader = _jvmtiCompiledMethodLoadRecordHeader;
12/*
13 * Record that represents arbitrary information passed through JVMTI
14 * CompiledMethodLoadEvent void pointer.
15 */
16#[repr(C)]
17#[derive(Clone, Copy, Debug)]
18pub struct _jvmtiCompiledMethodLoadRecordHeader {
19 kind: jvmtiCMLRKind, /* id for the kind of info passed in the record */
20 majorinfoversion: jint, /* major and minor info version values. Init'ed */
21 minorinfoversion: jint, /* to current version value in jvmtiExport.cpp. */
22 next: *mut _jvmtiCompiledMethodLoadRecordHeader,
23}
24
25pub type PCStackInfo = _PCStackInfo;
26/*
27 * Record that gives information about the methods on the compile-time
28 * stack at a specific pc address of a compiled method. Each element in
29 * the methods array maps to same element in the bcis array.
30*/
31#[repr(C)]
32#[derive(Clone, Copy, Debug)]
33pub struct _PCStackInfo {
34 pc: *mut c_void, /* the pc address for this compiled method */
35 numstackframes: jint, /* number of methods on the stack */
36 methods: *mut jmethodID, /* array of numstackframes method ids */
37 bcis: *mut jint, /* array of numstackframes bytecode indices */
38}
39
40pub type jvmtiCompiledMethodLoadInlineRecord = _jvmtiCompiledMethodLoadInlineRecord;
41
42/*
43 * Record that contains inlining information for each pc address of
44 * an nmethod.
45*/
46#[repr(C)]
47#[derive(Clone, Copy, Debug)]
48pub struct _jvmtiCompiledMethodLoadInlineRecord {
49 pub header: jvmtiCompiledMethodLoadRecordHeader, /* common header for casting */
50 pub numpcs: jint, /* number of pc descriptors in this nmethod */
51 pub pcinfo: *mut PCStackInfo, /* array of numpcs pc descriptors */
52}
53
54pub type jvmtiCompiledMethodLoadDummyRecord = _jvmtiCompiledMethodLoadDummyRecord;
55
56/*
57 * Dummy record used to test that we can pass records with different
58 * information through the void pointer provided that they can be cast
59 * to a jvmtiCompiledMethodLoadRecordHeader.
60*/
61#[repr(C)]
62#[derive(Clone, Copy, Debug)]
63pub struct _jvmtiCompiledMethodLoadDummyRecord {
64 pub header: jvmtiCompiledMethodLoadRecordHeader, /* common header for casting */
65 pub message: [c_char; 50],
66}