jvmticmlr.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  3. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. *
  5. *
  6. *
  7. *
  8. *
  9. *
  10. *
  11. *
  12. *
  13. *
  14. *
  15. *
  16. *
  17. *
  18. *
  19. *
  20. *
  21. *
  22. *
  23. *
  24. */
  25. /*
  26. * This header file defines the data structures sent by the VM
  27. * through the JVMTI CompiledMethodLoad callback function via the
  28. * "void * compile_info" parameter. The memory pointed to by the
  29. * compile_info parameter may not be referenced after returning from
  30. * the CompiledMethodLoad callback. These are VM implementation
  31. * specific data structures that may evolve in future releases. A
  32. * JVMTI agent should interpret a non-NULL compile_info as a pointer
  33. * to a region of memory containing a list of records. In a typical
  34. * usage scenario, a JVMTI agent would cast each record to a
  35. * jvmtiCompiledMethodLoadRecordHeader, a struct that represents
  36. * arbitrary information. This struct contains a kind field to indicate
  37. * the kind of information being passed, and a pointer to the next
  38. * record. If the kind field indicates inlining information, then the
  39. * agent would cast the record to a jvmtiCompiledMethodLoadInlineRecord.
  40. * This record contains an array of PCStackInfo structs, which indicate
  41. * for every pc address what are the methods on the invocation stack.
  42. * The "methods" and "bcis" fields in each PCStackInfo struct specify a
  43. * 1-1 mapping between these inlined methods and their bytecode indices.
  44. * This can be used to derive the proper source lines of the inlined
  45. * methods.
  46. */
  47. #ifndef _JVMTI_CMLR_H_
  48. #define _JVMTI_CMLR_H_
  49. enum {
  50. JVMTI_CMLR_MAJOR_VERSION_1 = 0x00000001,
  51. JVMTI_CMLR_MINOR_VERSION_0 = 0x00000000,
  52. JVMTI_CMLR_MAJOR_VERSION = 0x00000001,
  53. JVMTI_CMLR_MINOR_VERSION = 0x00000000
  54. /*
  55. * This comment is for the "JDK import from HotSpot" sanity check:
  56. * version: 1.0.0
  57. */
  58. };
  59. typedef enum {
  60. JVMTI_CMLR_DUMMY = 1,
  61. JVMTI_CMLR_INLINE_INFO = 2
  62. } jvmtiCMLRKind;
  63. /*
  64. * Record that represents arbitrary information passed through JVMTI
  65. * CompiledMethodLoadEvent void pointer.
  66. */
  67. typedef struct _jvmtiCompiledMethodLoadRecordHeader {
  68. jvmtiCMLRKind kind; /* id for the kind of info passed in the record */
  69. jint majorinfoversion; /* major and minor info version values. Init'ed */
  70. jint minorinfoversion; /* to current version value in jvmtiExport.cpp. */
  71. struct _jvmtiCompiledMethodLoadRecordHeader* next;
  72. } jvmtiCompiledMethodLoadRecordHeader;
  73. /*
  74. * Record that gives information about the methods on the compile-time
  75. * stack at a specific pc address of a compiled method. Each element in
  76. * the methods array maps to same element in the bcis array.
  77. */
  78. typedef struct _PCStackInfo {
  79. void* pc; /* the pc address for this compiled method */
  80. jint numstackframes; /* number of methods on the stack */
  81. jmethodID* methods; /* array of numstackframes method ids */
  82. jint* bcis; /* array of numstackframes bytecode indices */
  83. } PCStackInfo;
  84. /*
  85. * Record that contains inlining information for each pc address of
  86. * an nmethod.
  87. */
  88. typedef struct _jvmtiCompiledMethodLoadInlineRecord {
  89. jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */
  90. jint numpcs; /* number of pc descriptors in this nmethod */
  91. PCStackInfo* pcinfo; /* array of numpcs pc descriptors */
  92. } jvmtiCompiledMethodLoadInlineRecord;
  93. /*
  94. * Dummy record used to test that we can pass records with different
  95. * information through the void pointer provided that they can be cast
  96. * to a jvmtiCompiledMethodLoadRecordHeader.
  97. */
  98. typedef struct _jvmtiCompiledMethodLoadDummyRecord {
  99. jvmtiCompiledMethodLoadRecordHeader header; /* common header for casting */
  100. char message[50];
  101. } jvmtiCompiledMethodLoadDummyRecord;
  102. #endif