hotspot/src/share/vm/jvmci/jvmciEnv.hpp
changeset 34165 66826441022f
parent 33160 c59f1676d27e
child 34185 ee71c590a456
equal deleted inserted replaced
34164:a9e6034d7707 34165:66826441022f
    76   // Return an unloaded klass if !require_local and no class at all is found.
    76   // Return an unloaded klass if !require_local and no class at all is found.
    77   //
    77   //
    78   // The CI treats a klass as loaded if it is consistently defined in
    78   // The CI treats a klass as loaded if it is consistently defined in
    79   // another loader, even if it hasn't yet been loaded in all loaders
    79   // another loader, even if it hasn't yet been loaded in all loaders
    80   // that could potentially see it via delegation.
    80   // that could potentially see it via delegation.
    81   static KlassHandle get_klass_by_name(KlassHandle& accessing_klass,
    81   static KlassHandle get_klass_by_name(KlassHandle accessing_klass,
    82                              Symbol* klass_name,
    82                              Symbol* klass_name,
    83                              bool require_local);
    83                              bool require_local);
    84 
    84 
    85   // Constant pool access.
    85   // Constant pool access.
    86   static KlassHandle   get_klass_by_index(constantPoolHandle& cpool,
    86   static KlassHandle   get_klass_by_index(const constantPoolHandle& cpool,
    87                                 int klass_index,
    87                                 int klass_index,
    88                                 bool& is_accessible,
    88                                 bool& is_accessible,
    89                                 KlassHandle& loading_klass);
    89                                 KlassHandle loading_klass);
    90   static void   get_field_by_index(instanceKlassHandle& loading_klass, fieldDescriptor& fd,
    90   static void   get_field_by_index(instanceKlassHandle loading_klass, fieldDescriptor& fd,
    91                                 int field_index);
    91                                 int field_index);
    92   static methodHandle  get_method_by_index(constantPoolHandle& cpool,
    92   static methodHandle  get_method_by_index(const constantPoolHandle& cpool,
    93                                  int method_index, Bytecodes::Code bc,
    93                                  int method_index, Bytecodes::Code bc,
    94                                  instanceKlassHandle& loading_klass);
    94                                  instanceKlassHandle loading_klass);
    95 
    95 
    96   JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter);
    96   JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter);
    97 
    97 
    98 private:
    98 private:
    99   CompileTask*     _task;
    99   CompileTask*     _task;
   103   bool  _jvmti_can_hotswap_or_post_breakpoint;
   103   bool  _jvmti_can_hotswap_or_post_breakpoint;
   104   bool  _jvmti_can_access_local_variables;
   104   bool  _jvmti_can_access_local_variables;
   105   bool  _jvmti_can_post_on_exceptions;
   105   bool  _jvmti_can_post_on_exceptions;
   106 
   106 
   107   // Implementation methods for loading and constant pool access.
   107   // Implementation methods for loading and constant pool access.
   108   static KlassHandle get_klass_by_name_impl(KlassHandle& accessing_klass,
   108   static KlassHandle get_klass_by_name_impl(KlassHandle accessing_klass,
   109                                   constantPoolHandle& cpool,
   109                                   const constantPoolHandle& cpool,
   110                                   Symbol* klass_name,
   110                                   Symbol* klass_name,
   111                                   bool require_local);
   111                                   bool require_local);
   112   static KlassHandle   get_klass_by_index_impl(constantPoolHandle& cpool,
   112   static KlassHandle   get_klass_by_index_impl(const constantPoolHandle& cpool,
   113                                      int klass_index,
   113                                      int klass_index,
   114                                      bool& is_accessible,
   114                                      bool& is_accessible,
   115                                      KlassHandle& loading_klass);
   115                                      KlassHandle loading_klass);
   116   static void   get_field_by_index_impl(instanceKlassHandle& loading_klass, fieldDescriptor& fd,
   116   static void   get_field_by_index_impl(instanceKlassHandle loading_klass, fieldDescriptor& fd,
   117                                      int field_index);
   117                                      int field_index);
   118   static methodHandle  get_method_by_index_impl(constantPoolHandle& cpool,
   118   static methodHandle  get_method_by_index_impl(const constantPoolHandle& cpool,
   119                                       int method_index, Bytecodes::Code bc,
   119                                       int method_index, Bytecodes::Code bc,
   120                                       instanceKlassHandle& loading_klass);
   120                                       instanceKlassHandle loading_klass);
   121 
   121 
   122   // Helper methods
   122   // Helper methods
   123   static bool       check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass);
   123   static bool       check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass);
   124   static methodHandle  lookup_method(instanceKlassHandle&  accessor,
   124   static methodHandle  lookup_method(instanceKlassHandle  accessor,
   125                            instanceKlassHandle&  holder,
   125                            instanceKlassHandle  holder,
   126                            Symbol*         name,
   126                            Symbol*         name,
   127                            Symbol*         sig,
   127                            Symbol*         sig,
   128                            Bytecodes::Code bc);
   128                            Bytecodes::Code bc);
   129 
   129 
   130   private:
   130   private:
   140 public:
   140 public:
   141   CompileTask* task() { return _task; }
   141   CompileTask* task() { return _task; }
   142 
   142 
   143   // Register the result of a compilation.
   143   // Register the result of a compilation.
   144   static JVMCIEnv::CodeInstallResult register_method(
   144   static JVMCIEnv::CodeInstallResult register_method(
   145                        methodHandle&             target,
   145                        const methodHandle&       target,
   146                        nmethod*&                 nm,
   146                        nmethod*&                 nm,
   147                        int                       entry_bci,
   147                        int                       entry_bci,
   148                        CodeOffsets*              offsets,
   148                        CodeOffsets*              offsets,
   149                        int                       orig_pc_offset,
   149                        int                       orig_pc_offset,
   150                        CodeBuffer*               code_buffer,
   150                        CodeBuffer*               code_buffer,
   164 
   164 
   165   // converts the Klass* representing the holder of a method into a
   165   // converts the Klass* representing the holder of a method into a
   166   // InstanceKlass*.  This is needed since the holder of a method in
   166   // InstanceKlass*.  This is needed since the holder of a method in
   167   // the bytecodes could be an array type.  Basically this converts
   167   // the bytecodes could be an array type.  Basically this converts
   168   // array types into java/lang/Object and other types stay as they are.
   168   // array types into java/lang/Object and other types stay as they are.
   169   static instanceKlassHandle get_instance_klass_for_declared_method_holder(KlassHandle& klass);
   169   static instanceKlassHandle get_instance_klass_for_declared_method_holder(KlassHandle klass);
   170 };
   170 };
   171 
   171 
   172 #endif // SHARE_VM_JVMCI_JVMCIENV_HPP
   172 #endif // SHARE_VM_JVMCI_JVMCIENV_HPP