< prev index next >

src/hotspot/share/interpreter/linkResolver.hpp

Print this page
*** 187,10 ***
--- 187,16 ---
    bool check_access() const             { return _check_access; }
    bool check_loader_constraints() const { return _check_loader_constraints; }
    void         print()  PRODUCT_RETURN;
  };
  
+ enum class StaticMode : uint8_t {
+   dont_initialize_klass,
+   initialize_klass,
+   initialize_klass_preemptable
+ };
+ 
  // Link information for getfield/putfield & getstatic/putstatic bytecodes
  // is represented using a fieldDescriptor.
  
  // The LinkResolver is used to resolve constant-pool references at run-time.
  // It does all necessary link-time checks & throws exceptions if necessary.

*** 265,11 ***
                                           Klass* sel_klass,
                                           const methodHandle& sel_method, TRAPS);
  
    // runtime resolving from constant pool
    static void resolve_invokestatic   (CallInfo& result,
!                                       const constantPoolHandle& pool, int index, TRAPS);
    static void resolve_invokespecial  (CallInfo& result, Handle recv,
                                        const constantPoolHandle& pool, int index, TRAPS);
    static void resolve_invokevirtual  (CallInfo& result, Handle recv,
                                        const constantPoolHandle& pool, int index, TRAPS);
    static void resolve_invokeinterface(CallInfo& result, Handle recv,
--- 271,11 ---
                                           Klass* sel_klass,
                                           const methodHandle& sel_method, TRAPS);
  
    // runtime resolving from constant pool
    static void resolve_invokestatic   (CallInfo& result,
!                                       const constantPoolHandle& pool, int index, StaticMode mode, TRAPS);
    static void resolve_invokespecial  (CallInfo& result, Handle recv,
                                        const constantPoolHandle& pool, int index, TRAPS);
    static void resolve_invokevirtual  (CallInfo& result, Handle recv,
                                        const constantPoolHandle& pool, int index, TRAPS);
    static void resolve_invokeinterface(CallInfo& result, Handle recv,

*** 293,26 ***
    static void resolve_field_access(fieldDescriptor& result,
                                     const constantPoolHandle& pool,
                                     int index,
                                     const methodHandle& method,
                                     Bytecodes::Code byte,
!                                    bool initialize_class, TRAPS);
    static void resolve_field_access(fieldDescriptor& result,
                                     const constantPoolHandle& pool,
                                     int index,
                                     const methodHandle& method,
                                     Bytecodes::Code byte, TRAPS) {
      resolve_field_access(result, pool, index, method, byte,
!                          /* initialize_class*/true, THREAD);
    }
    static void resolve_field(fieldDescriptor& result, const LinkInfo& link_info,
                              Bytecodes::Code access_kind,
!                             bool initialize_class, TRAPS);
  
    static void resolve_static_call   (CallInfo& result,
                                       const LinkInfo& link_info,
!                                      bool initialize_klass, TRAPS);
    static void resolve_special_call  (CallInfo& result,
                                       Handle recv,
                                       const LinkInfo& link_info,
                                       TRAPS);
    static void resolve_virtual_call  (CallInfo& result, Handle recv, Klass* recv_klass,
--- 299,26 ---
    static void resolve_field_access(fieldDescriptor& result,
                                     const constantPoolHandle& pool,
                                     int index,
                                     const methodHandle& method,
                                     Bytecodes::Code byte,
!                                    StaticMode mode, TRAPS);
    static void resolve_field_access(fieldDescriptor& result,
                                     const constantPoolHandle& pool,
                                     int index,
                                     const methodHandle& method,
                                     Bytecodes::Code byte, TRAPS) {
      resolve_field_access(result, pool, index, method, byte,
!                          StaticMode::initialize_klass, THREAD);
    }
    static void resolve_field(fieldDescriptor& result, const LinkInfo& link_info,
                              Bytecodes::Code access_kind,
!                             StaticMode mode, TRAPS);
  
    static void resolve_static_call   (CallInfo& result,
                                       const LinkInfo& link_info,
!                                      StaticMode mode, TRAPS);
    static void resolve_special_call  (CallInfo& result,
                                       Handle recv,
                                       const LinkInfo& link_info,
                                       TRAPS);
    static void resolve_virtual_call  (CallInfo& result, Handle recv, Klass* recv_klass,

*** 350,11 ***
    static Method* linktime_resolve_interface_method_or_null(const LinkInfo& link_info);
  
    // runtime resolving from constant pool
    static void resolve_invoke(CallInfo& result, Handle recv,
                               const constantPoolHandle& pool, int index,
!                              Bytecodes::Code byte, TRAPS);
  
    // runtime resolving from attached method
    static void resolve_invoke(CallInfo& result, Handle& recv,
                               const methodHandle& attached_method,
                               Bytecodes::Code byte, TRAPS);
--- 356,16 ---
    static Method* linktime_resolve_interface_method_or_null(const LinkInfo& link_info);
  
    // runtime resolving from constant pool
    static void resolve_invoke(CallInfo& result, Handle recv,
                               const constantPoolHandle& pool, int index,
!                              Bytecodes::Code byte, StaticMode static_mode, TRAPS);
+   static void resolve_invoke(CallInfo& result, Handle recv,
+                              const constantPoolHandle& pool, int index,
+                              Bytecodes::Code byte, TRAPS) {
+     resolve_invoke(result, recv, pool, index, byte, StaticMode::initialize_klass, THREAD);
+   }
  
    // runtime resolving from attached method
    static void resolve_invoke(CallInfo& result, Handle& recv,
                               const methodHandle& attached_method,
                               Bytecodes::Code byte, TRAPS);
< prev index next >