< prev index next >

src/share/vm/interpreter/linkResolver.hpp

Print this page

        

*** 45,79 **** vtable_call, // select recv.klass.method_at_vtable(index) itable_call, // select recv.klass.method_at_itable(resolved_method.holder, index) unknown_kind = -1 }; private: ! KlassHandle _resolved_klass; // static receiver klass, resolved from a symbolic reference ! KlassHandle _selected_klass; // dynamic receiver class (same as static, or subklass) methodHandle _resolved_method; // static target method methodHandle _selected_method; // dynamic (actual) target method CallKind _call_kind; // kind of call (static(=bytecode static/special + // others inferred), vtable, itable) int _call_index; // vtable or itable index of selected class method (if any) Handle _resolved_appendix; // extra argument in constant pool (if CPCE::has_appendix) Handle _resolved_method_type; // MethodType (for invokedynamic and invokehandle call sites) ! void set_static(KlassHandle resolved_klass, const methodHandle& resolved_method, TRAPS); ! void set_interface(KlassHandle resolved_klass, KlassHandle selected_klass, const methodHandle& resolved_method, const methodHandle& selected_method, int itable_index, TRAPS); ! void set_virtual(KlassHandle resolved_klass, KlassHandle selected_klass, const methodHandle& resolved_method, const methodHandle& selected_method, int vtable_index, TRAPS); void set_handle(const methodHandle& resolved_method, Handle resolved_appendix, Handle resolved_method_type, TRAPS); ! void set_handle(KlassHandle resolved_klass, const methodHandle& resolved_method, Handle resolved_appendix, Handle resolved_method_type, TRAPS); ! void set_common(KlassHandle resolved_klass, KlassHandle selected_klass, const methodHandle& resolved_method, const methodHandle& selected_method, CallKind kind, int index, TRAPS); --- 45,79 ---- vtable_call, // select recv.klass.method_at_vtable(index) itable_call, // select recv.klass.method_at_itable(resolved_method.holder, index) unknown_kind = -1 }; private: ! Klass* _resolved_klass; // static receiver klass, resolved from a symbolic reference ! Klass* _selected_klass; // dynamic receiver class (same as static, or subklass) methodHandle _resolved_method; // static target method methodHandle _selected_method; // dynamic (actual) target method CallKind _call_kind; // kind of call (static(=bytecode static/special + // others inferred), vtable, itable) int _call_index; // vtable or itable index of selected class method (if any) Handle _resolved_appendix; // extra argument in constant pool (if CPCE::has_appendix) Handle _resolved_method_type; // MethodType (for invokedynamic and invokehandle call sites) ! void set_static(Klass* resolved_klass, const methodHandle& resolved_method, TRAPS); ! void set_interface(Klass* resolved_klass, Klass* selected_klass, const methodHandle& resolved_method, const methodHandle& selected_method, int itable_index, TRAPS); ! void set_virtual(Klass* resolved_klass, Klass* selected_klass, const methodHandle& resolved_method, const methodHandle& selected_method, int vtable_index, TRAPS); void set_handle(const methodHandle& resolved_method, Handle resolved_appendix, Handle resolved_method_type, TRAPS); ! void set_handle(Klass* resolved_klass, const methodHandle& resolved_method, Handle resolved_appendix, Handle resolved_method_type, TRAPS); ! void set_common(Klass* resolved_klass, Klass* selected_klass, const methodHandle& resolved_method, const methodHandle& selected_method, CallKind kind, int index, TRAPS);
*** 89,100 **** // utility to extract an effective CallInfo from a method and an optional receiver limit // does not queue the method for compilation CallInfo(Method* resolved_method, Klass* resolved_klass = NULL); ! KlassHandle resolved_klass() const { return _resolved_klass; } ! KlassHandle selected_klass() const { return _selected_klass; } methodHandle resolved_method() const { return _resolved_method; } methodHandle selected_method() const { return _selected_method; } Handle resolved_appendix() const { return _resolved_appendix; } Handle resolved_method_type() const { return _resolved_method_type; } --- 89,100 ---- // utility to extract an effective CallInfo from a method and an optional receiver limit // does not queue the method for compilation CallInfo(Method* resolved_method, Klass* resolved_klass = NULL); ! Klass* resolved_klass() const { return _resolved_klass; } ! Klass* selected_klass() const { return _selected_klass; } methodHandle resolved_method() const { return _resolved_method; } methodHandle selected_method() const { return _selected_method; } Handle resolved_appendix() const { return _resolved_appendix; } Handle resolved_method_type() const { return _resolved_method_type; }
*** 133,144 **** // containing the call being resolved) // current_method = sending method (relevant for field resolution) class LinkInfo : public StackObj { Symbol* _name; // extracted from JVM_CONSTANT_NameAndType Symbol* _signature; ! KlassHandle _resolved_klass; // class that the constant pool entry points to ! KlassHandle _current_klass; // class that owns the constant pool methodHandle _current_method; // sending method bool _check_access; constantTag _tag; public: --- 133,144 ---- // containing the call being resolved) // current_method = sending method (relevant for field resolution) class LinkInfo : public StackObj { Symbol* _name; // extracted from JVM_CONSTANT_NameAndType Symbol* _signature; ! Klass* _resolved_klass; // class that the constant pool entry points to ! Klass* _current_klass; // class that owns the constant pool methodHandle _current_method; // sending method bool _check_access; constantTag _tag; public:
*** 149,183 **** LinkInfo(const constantPoolHandle& pool, int index, methodHandle current_method, TRAPS); LinkInfo(const constantPoolHandle& pool, int index, TRAPS); // Condensed information from other call sites within the vm. ! LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature, KlassHandle current_klass, AccessCheck check_access = needs_access_check, constantTag tag = JVM_CONSTANT_Invalid) : _resolved_klass(resolved_klass), ! _name(name), _signature(signature), _current_klass(current_klass), _current_method(NULL), _check_access(check_access == needs_access_check), _tag(tag) {} ! LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature, methodHandle current_method, AccessCheck check_access = needs_access_check, constantTag tag = JVM_CONSTANT_Invalid) : _resolved_klass(resolved_klass), _name(name), _signature(signature), _current_klass(current_method->method_holder()), _current_method(current_method), _check_access(check_access == needs_access_check), _tag(tag) {} // Case where we just find the method and don't check access against the current class ! LinkInfo(KlassHandle resolved_klass, Symbol*name, Symbol* signature) : _resolved_klass(resolved_klass), ! _name(name), _signature(signature), _current_klass(NULL), _current_method(NULL), _check_access(false), _tag(JVM_CONSTANT_Invalid) {} // accessors Symbol* name() const { return _name; } Symbol* signature() const { return _signature; } ! KlassHandle resolved_klass() const { return _resolved_klass; } ! KlassHandle current_klass() const { return _current_klass; } methodHandle current_method() const { return _current_method; } constantTag tag() const { return _tag; } bool check_access() const { return _check_access; } char* method_string() const; --- 149,183 ---- LinkInfo(const constantPoolHandle& pool, int index, methodHandle current_method, TRAPS); LinkInfo(const constantPoolHandle& pool, int index, TRAPS); // Condensed information from other call sites within the vm. ! LinkInfo(Klass* resolved_klass, Symbol* name, Symbol* signature, Klass* current_klass, AccessCheck check_access = needs_access_check, constantTag tag = JVM_CONSTANT_Invalid) : _resolved_klass(resolved_klass), ! _name(name), _signature(signature), _current_klass(current_klass), _current_method(methodHandle()), _check_access(check_access == needs_access_check), _tag(tag) {} ! LinkInfo(Klass* resolved_klass, Symbol* name, Symbol* signature, methodHandle current_method, AccessCheck check_access = needs_access_check, constantTag tag = JVM_CONSTANT_Invalid) : _resolved_klass(resolved_klass), _name(name), _signature(signature), _current_klass(current_method->method_holder()), _current_method(current_method), _check_access(check_access == needs_access_check), _tag(tag) {} // Case where we just find the method and don't check access against the current class ! LinkInfo(Klass* resolved_klass, Symbol*name, Symbol* signature) : _resolved_klass(resolved_klass), ! _name(name), _signature(signature), _current_klass(NULL), _current_method(methodHandle()), _check_access(false), _tag(JVM_CONSTANT_Invalid) {} // accessors Symbol* name() const { return _name; } Symbol* signature() const { return _signature; } ! Klass* resolved_klass() const { return _resolved_klass; } ! Klass* current_klass() const { return _current_klass; } methodHandle current_method() const { return _current_method; } constantTag tag() const { return _tag; } bool check_access() const { return _check_access; } char* method_string() const;
*** 204,224 **** Handle *appendix_result_or_null, Handle *method_type_result, TRAPS); JVMCI_ONLY(public:) // Needed for CompilerToVM.resolveMethod() // Not Linktime so doesn't take LinkInfo static methodHandle lookup_instance_method_in_klasses ( ! KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); JVMCI_ONLY(private:) // Similar loader constraint checking functions that throw // LinkageError with descriptive message. static void check_method_loader_constraints(const LinkInfo& link_info, const methodHandle& resolved_method, const char* method_type, TRAPS); static void check_field_loader_constraints(Symbol* field, Symbol* sig, ! KlassHandle current_klass, ! KlassHandle sel_klass, TRAPS); static methodHandle resolve_interface_method(const LinkInfo& link_info, Bytecodes::Code code, TRAPS); static methodHandle resolve_method (const LinkInfo& link_info, Bytecodes::Code code, TRAPS); static methodHandle linktime_resolve_static_method (const LinkInfo& link_info, TRAPS); --- 204,224 ---- Handle *appendix_result_or_null, Handle *method_type_result, TRAPS); JVMCI_ONLY(public:) // Needed for CompilerToVM.resolveMethod() // Not Linktime so doesn't take LinkInfo static methodHandle lookup_instance_method_in_klasses ( ! Klass* klass, Symbol* name, Symbol* signature, TRAPS); JVMCI_ONLY(private:) // Similar loader constraint checking functions that throw // LinkageError with descriptive message. static void check_method_loader_constraints(const LinkInfo& link_info, const methodHandle& resolved_method, const char* method_type, TRAPS); static void check_field_loader_constraints(Symbol* field, Symbol* sig, ! Klass* current_klass, ! Klass* sel_klass, TRAPS); static methodHandle resolve_interface_method(const LinkInfo& link_info, Bytecodes::Code code, TRAPS); static methodHandle resolve_method (const LinkInfo& link_info, Bytecodes::Code code, TRAPS); static methodHandle linktime_resolve_static_method (const LinkInfo& link_info, TRAPS);
*** 226,258 **** static methodHandle linktime_resolve_virtual_method (const LinkInfo& link_info, TRAPS); static methodHandle linktime_resolve_interface_method (const LinkInfo& link_info, TRAPS); static void runtime_resolve_special_method (CallInfo& result, const methodHandle& resolved_method, ! KlassHandle resolved_klass, ! KlassHandle current_klass, bool check_access, TRAPS); static void runtime_resolve_virtual_method (CallInfo& result, const methodHandle& resolved_method, ! KlassHandle resolved_klass, Handle recv, ! KlassHandle recv_klass, bool check_null_and_abstract, TRAPS); static void runtime_resolve_interface_method (CallInfo& result, const methodHandle& resolved_method, ! KlassHandle resolved_klass, Handle recv, ! KlassHandle recv_klass, bool check_null_and_abstract, TRAPS); ! static void check_field_accessability(KlassHandle ref_klass, ! KlassHandle resolved_klass, ! KlassHandle sel_klass, const fieldDescriptor& fd, TRAPS); ! static void check_method_accessability(KlassHandle ref_klass, ! KlassHandle resolved_klass, ! KlassHandle sel_klass, const methodHandle& sel_method, TRAPS); // runtime resolving from constant pool static void resolve_invokestatic (CallInfo& result, const constantPoolHandle& pool, int index, TRAPS); --- 226,258 ---- static methodHandle linktime_resolve_virtual_method (const LinkInfo& link_info, TRAPS); static methodHandle linktime_resolve_interface_method (const LinkInfo& link_info, TRAPS); static void runtime_resolve_special_method (CallInfo& result, const methodHandle& resolved_method, ! Klass* resolved_klass, ! Klass* current_klass, bool check_access, TRAPS); static void runtime_resolve_virtual_method (CallInfo& result, const methodHandle& resolved_method, ! Klass* resolved_klass, Handle recv, ! Klass* recv_klass, bool check_null_and_abstract, TRAPS); static void runtime_resolve_interface_method (CallInfo& result, const methodHandle& resolved_method, ! Klass* resolved_klass, Handle recv, ! Klass* recv_klass, bool check_null_and_abstract, TRAPS); ! static void check_field_accessability(Klass* ref_klass, ! Klass* resolved_klass, ! Klass* sel_klass, const fieldDescriptor& fd, TRAPS); ! static void check_method_accessability(Klass* ref_klass, ! Klass* resolved_klass, ! 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);
*** 266,276 **** const constantPoolHandle& pool, int index, TRAPS); static void resolve_invokehandle (CallInfo& result, const constantPoolHandle& pool, int index, TRAPS); public: // constant pool resolving ! static void check_klass_accessability(KlassHandle ref_klass, KlassHandle sel_klass, TRAPS); // static resolving calls (will not run any Java code); // used only from Bytecode_invoke::static_target static methodHandle resolve_method_statically(Bytecodes::Code code, const constantPoolHandle& pool, --- 266,276 ---- const constantPoolHandle& pool, int index, TRAPS); static void resolve_invokehandle (CallInfo& result, const constantPoolHandle& pool, int index, TRAPS); public: // constant pool resolving ! static void check_klass_accessability(Klass* ref_klass, Klass* sel_klass, TRAPS); // static resolving calls (will not run any Java code); // used only from Bytecode_invoke::static_target static methodHandle resolve_method_statically(Bytecodes::Code code, const constantPoolHandle& pool,
*** 289,323 **** const LinkInfo& link_info, bool initialize_klass, TRAPS); static void resolve_special_call (CallInfo& result, const LinkInfo& link_info, TRAPS); ! static void resolve_virtual_call (CallInfo& result, Handle recv, KlassHandle recv_klass, const LinkInfo& link_info, bool check_null_and_abstract, TRAPS); ! static void resolve_interface_call(CallInfo& result, Handle recv, KlassHandle recv_klass, const LinkInfo& link_info, bool check_null_and_abstract, TRAPS); static void resolve_handle_call (CallInfo& result, const LinkInfo& link_info, TRAPS); static void resolve_dynamic_call (CallInfo& result, Handle bootstrap_specifier, Symbol* method_name, Symbol* method_signature, ! KlassHandle current_klass, TRAPS); // same as above for compile-time resolution; but returns null handle instead of throwing // an exception on error also, does not initialize klass (i.e., no side effects) ! static methodHandle resolve_virtual_call_or_null (KlassHandle receiver_klass, const LinkInfo& link_info); ! static methodHandle resolve_interface_call_or_null(KlassHandle receiver_klass, const LinkInfo& link_info); static methodHandle resolve_static_call_or_null (const LinkInfo& link_info); static methodHandle resolve_special_call_or_null (const LinkInfo& link_info); ! static int vtable_index_of_interface_method(KlassHandle klass, const methodHandle& resolved_method); // same as above for compile-time resolution; returns vtable_index if current_klass if linked ! static int resolve_virtual_vtable_index (KlassHandle receiver_klass, const LinkInfo& link_info); // static resolving for compiler (does not throw exceptions, returns null handle if unsuccessful) static methodHandle linktime_resolve_virtual_method_or_null (const LinkInfo& link_info); static methodHandle linktime_resolve_interface_method_or_null(const LinkInfo& link_info); --- 289,323 ---- const LinkInfo& link_info, bool initialize_klass, TRAPS); static void resolve_special_call (CallInfo& result, const LinkInfo& link_info, TRAPS); ! static void resolve_virtual_call (CallInfo& result, Handle recv, Klass* recv_klass, const LinkInfo& link_info, bool check_null_and_abstract, TRAPS); ! static void resolve_interface_call(CallInfo& result, Handle recv, Klass* recv_klass, const LinkInfo& link_info, bool check_null_and_abstract, TRAPS); static void resolve_handle_call (CallInfo& result, const LinkInfo& link_info, TRAPS); static void resolve_dynamic_call (CallInfo& result, Handle bootstrap_specifier, Symbol* method_name, Symbol* method_signature, ! Klass* current_klass, TRAPS); // same as above for compile-time resolution; but returns null handle instead of throwing // an exception on error also, does not initialize klass (i.e., no side effects) ! static methodHandle resolve_virtual_call_or_null (Klass* receiver_klass, const LinkInfo& link_info); ! static methodHandle resolve_interface_call_or_null(Klass* receiver_klass, const LinkInfo& link_info); static methodHandle resolve_static_call_or_null (const LinkInfo& link_info); static methodHandle resolve_special_call_or_null (const LinkInfo& link_info); ! static int vtable_index_of_interface_method(Klass* klass, const methodHandle& resolved_method); // same as above for compile-time resolution; returns vtable_index if current_klass if linked ! static int resolve_virtual_vtable_index (Klass* receiver_klass, const LinkInfo& link_info); // static resolving for compiler (does not throw exceptions, returns null handle if unsuccessful) static methodHandle linktime_resolve_virtual_method_or_null (const LinkInfo& link_info); static methodHandle linktime_resolve_interface_method_or_null(const LinkInfo& link_info);
< prev index next >