< prev index next >

src/hotspot/share/jvmci/jvmciCodeInstaller.hpp

Print this page




  68 
  69 class CodeMetadata {
  70 public:
  71   CodeMetadata() {}
  72 
  73   CodeBlob* get_code_blob() const { return _cb; }
  74 
  75   PcDesc* get_pc_desc() const { return _pc_desc; }
  76   int get_nr_pc_desc() const { return _nr_pc_desc; }
  77 
  78   u_char* get_scopes_desc() const { return _scopes_desc; }
  79   int get_scopes_size() const { return _nr_scopes_desc; }
  80 
  81 #if INCLUDE_AOT
  82   RelocBuffer* get_reloc_buffer() { return &_reloc_buffer; }
  83   AOTOopRecorder* get_oop_recorder() { return _oop_recorder; }
  84 #endif
  85 
  86   ExceptionHandlerTable* get_exception_table() { return _exception_table; }
  87 
  88   ImplicitExceptionTable* get_implicit_exception_table() { return _implicit_exception_table; }
  89 
  90   void set_pc_desc(PcDesc* desc, int count) {
  91     _pc_desc = desc;
  92     _nr_pc_desc = count;
  93   }
  94 
  95   void set_scopes(u_char* scopes, int size) {
  96     _scopes_desc = scopes;
  97     _nr_scopes_desc = size;
  98   }
  99 
 100 #if INCLUDE_AOT
 101   void set_oop_recorder(AOTOopRecorder* recorder) {
 102     _oop_recorder = recorder;
 103   }
 104 #endif
 105 
 106   void set_exception_table(ExceptionHandlerTable* table) {
 107     _exception_table = table;
 108   }
 109 
 110   void set_implicit_exception_table(ImplicitExceptionTable* table) {
 111     _implicit_exception_table = table;
 112   }
 113 
 114 private:
 115   CodeBlob* _cb;
 116   PcDesc* _pc_desc;
 117   int _nr_pc_desc;
 118 
 119   u_char* _scopes_desc;
 120   int _nr_scopes_desc;
 121 
 122 #if INCLUDE_AOT
 123   RelocBuffer _reloc_buffer;
 124   AOTOopRecorder* _oop_recorder;
 125 #endif
 126   ExceptionHandlerTable* _exception_table;
 127   ImplicitExceptionTable* _implicit_exception_table;
 128 };
 129 
 130 /*
 131  * This class handles the conversion from a InstalledCode to a CodeBlob or an nmethod.
 132  */
 133 class CodeInstaller : public StackObj {
 134   friend class JVMCIVMStructs;
 135 private:
 136   enum MarkId {
 137     VERIFIED_ENTRY                         = 1,
 138     UNVERIFIED_ENTRY                       = 2,
 139     OSR_ENTRY                              = 3,
 140     EXCEPTION_HANDLER_ENTRY                = 4,
 141     DEOPT_HANDLER_ENTRY                    = 5,
 142     INVOKEINTERFACE                        = 6,
 143     INVOKEVIRTUAL                          = 7,
 144     INVOKESTATIC                           = 8,
 145     INVOKESPECIAL                          = 9,
 146     INLINE_INVOKE                          = 10,
 147     POLL_NEAR                              = 11,


 175   CodeOffsets   _offsets;
 176 
 177   jint          _code_size;
 178   jint          _total_frame_size;
 179   jint          _orig_pc_offset;
 180   jint          _parameter_count;
 181   jint          _constants_size;
 182 
 183   bool          _has_wide_vector;
 184 
 185   MarkId        _next_call_type;
 186   address       _invoke_mark_pc;
 187 
 188   CodeSection*  _instructions;
 189   CodeSection*  _constants;
 190 
 191   OopRecorder*              _oop_recorder;
 192   DebugInformationRecorder* _debug_recorder;
 193   Dependencies*             _dependencies;
 194   ExceptionHandlerTable     _exception_handler_table;
 195   ImplicitExceptionTable    _implicit_exception_table;
 196 
 197   bool _immutable_pic_compilation;  // Installer is called for Immutable PIC compilation.
 198 
 199   static ConstantOopWriteValue* _oop_null_scope_value;
 200   static ConstantIntValue*    _int_m1_scope_value;
 201   static ConstantIntValue*    _int_0_scope_value;
 202   static ConstantIntValue*    _int_1_scope_value;
 203   static ConstantIntValue*    _int_2_scope_value;
 204   static LocationValue*       _illegal_value;
 205 
 206   jint pd_next_offset(NativeInstruction* inst, jint pc_offset, JVMCIObject method, JVMCI_TRAPS);
 207   void pd_patch_OopConstant(int pc_offset, JVMCIObject constant, JVMCI_TRAPS);
 208   void pd_patch_MetaspaceConstant(int pc_offset, JVMCIObject constant, JVMCI_TRAPS);
 209   void pd_patch_DataSectionReference(int pc_offset, int data_offset, JVMCI_TRAPS);
 210   void pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, JVMCI_TRAPS);
 211   void pd_relocate_JavaMethod(CodeBuffer &cbuf, JVMCIObject method, jint pc_offset, JVMCI_TRAPS);
 212   void pd_relocate_poll(address pc, jint mark, JVMCI_TRAPS);
 213 
 214   JVMCIObjectArray sites()                { return _sites_handle; }
 215   JVMCIPrimitiveArray code()              { return _code_handle; }




  68 
  69 class CodeMetadata {
  70 public:
  71   CodeMetadata() {}
  72 
  73   CodeBlob* get_code_blob() const { return _cb; }
  74 
  75   PcDesc* get_pc_desc() const { return _pc_desc; }
  76   int get_nr_pc_desc() const { return _nr_pc_desc; }
  77 
  78   u_char* get_scopes_desc() const { return _scopes_desc; }
  79   int get_scopes_size() const { return _nr_scopes_desc; }
  80 
  81 #if INCLUDE_AOT
  82   RelocBuffer* get_reloc_buffer() { return &_reloc_buffer; }
  83   AOTOopRecorder* get_oop_recorder() { return _oop_recorder; }
  84 #endif
  85 
  86   ExceptionHandlerTable* get_exception_table() { return _exception_table; }
  87 


  88   void set_pc_desc(PcDesc* desc, int count) {
  89     _pc_desc = desc;
  90     _nr_pc_desc = count;
  91   }
  92 
  93   void set_scopes(u_char* scopes, int size) {
  94     _scopes_desc = scopes;
  95     _nr_scopes_desc = size;
  96   }
  97 
  98 #if INCLUDE_AOT
  99   void set_oop_recorder(AOTOopRecorder* recorder) {
 100     _oop_recorder = recorder;
 101   }
 102 #endif
 103 
 104   void set_exception_table(ExceptionHandlerTable* table) {
 105     _exception_table = table;
 106   }
 107 




 108 private:
 109   CodeBlob* _cb;
 110   PcDesc* _pc_desc;
 111   int _nr_pc_desc;
 112 
 113   u_char* _scopes_desc;
 114   int _nr_scopes_desc;
 115 
 116 #if INCLUDE_AOT
 117   RelocBuffer _reloc_buffer;
 118   AOTOopRecorder* _oop_recorder;
 119 #endif
 120   ExceptionHandlerTable* _exception_table;

 121 };
 122 
 123 /*
 124  * This class handles the conversion from a InstalledCode to a CodeBlob or an nmethod.
 125  */
 126 class CodeInstaller : public StackObj {
 127   friend class JVMCIVMStructs;
 128 private:
 129   enum MarkId {
 130     VERIFIED_ENTRY                         = 1,
 131     UNVERIFIED_ENTRY                       = 2,
 132     OSR_ENTRY                              = 3,
 133     EXCEPTION_HANDLER_ENTRY                = 4,
 134     DEOPT_HANDLER_ENTRY                    = 5,
 135     INVOKEINTERFACE                        = 6,
 136     INVOKEVIRTUAL                          = 7,
 137     INVOKESTATIC                           = 8,
 138     INVOKESPECIAL                          = 9,
 139     INLINE_INVOKE                          = 10,
 140     POLL_NEAR                              = 11,


 168   CodeOffsets   _offsets;
 169 
 170   jint          _code_size;
 171   jint          _total_frame_size;
 172   jint          _orig_pc_offset;
 173   jint          _parameter_count;
 174   jint          _constants_size;
 175 
 176   bool          _has_wide_vector;
 177 
 178   MarkId        _next_call_type;
 179   address       _invoke_mark_pc;
 180 
 181   CodeSection*  _instructions;
 182   CodeSection*  _constants;
 183 
 184   OopRecorder*              _oop_recorder;
 185   DebugInformationRecorder* _debug_recorder;
 186   Dependencies*             _dependencies;
 187   ExceptionHandlerTable     _exception_handler_table;

 188 
 189   bool _immutable_pic_compilation;  // Installer is called for Immutable PIC compilation.
 190 
 191   static ConstantOopWriteValue* _oop_null_scope_value;
 192   static ConstantIntValue*    _int_m1_scope_value;
 193   static ConstantIntValue*    _int_0_scope_value;
 194   static ConstantIntValue*    _int_1_scope_value;
 195   static ConstantIntValue*    _int_2_scope_value;
 196   static LocationValue*       _illegal_value;
 197 
 198   jint pd_next_offset(NativeInstruction* inst, jint pc_offset, JVMCIObject method, JVMCI_TRAPS);
 199   void pd_patch_OopConstant(int pc_offset, JVMCIObject constant, JVMCI_TRAPS);
 200   void pd_patch_MetaspaceConstant(int pc_offset, JVMCIObject constant, JVMCI_TRAPS);
 201   void pd_patch_DataSectionReference(int pc_offset, int data_offset, JVMCI_TRAPS);
 202   void pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, JVMCI_TRAPS);
 203   void pd_relocate_JavaMethod(CodeBuffer &cbuf, JVMCIObject method, jint pc_offset, JVMCI_TRAPS);
 204   void pd_relocate_poll(address pc, jint mark, JVMCI_TRAPS);
 205 
 206   JVMCIObjectArray sites()                { return _sites_handle; }
 207   JVMCIPrimitiveArray code()              { return _code_handle; }


< prev index next >