127 void verify() PRODUCT_RETURN; 128 void print() PRODUCT_RETURN; 129 }; 130 131 132 // Condensed information from constant pool to use to resolve the method or field. 133 // resolved_klass = specified class (i.e., static receiver class) 134 // current_klass = sending method holder (i.e., class containing the method 135 // containing the call being resolved) 136 // current_method = sending method (relevant for field resolution) 137 class LinkInfo : public StackObj { 138 Symbol* _name; // extracted from JVM_CONSTANT_NameAndType 139 Symbol* _signature; 140 Klass* _resolved_klass; // class that the constant pool entry points to 141 Klass* _current_klass; // class that owns the constant pool 142 methodHandle _current_method; // sending method 143 bool _check_access; 144 constantTag _tag; 145 146 public: 147 enum AccessCheck { 148 needs_access_check, 149 skip_access_check 150 }; 151 152 LinkInfo(const constantPoolHandle& pool, int index, const methodHandle& current_method, TRAPS); 153 LinkInfo(const constantPoolHandle& pool, int index, TRAPS); 154 155 // Condensed information from other call sites within the vm. 156 LinkInfo(Klass* resolved_klass, Symbol* name, Symbol* signature, Klass* current_klass, 157 AccessCheck check_access = needs_access_check, 158 constantTag tag = JVM_CONSTANT_Invalid) : 159 _name(name), 160 _signature(signature), _resolved_klass(resolved_klass), _current_klass(current_klass), _current_method(methodHandle()), 161 _check_access(check_access == needs_access_check), _tag(tag) {} 162 163 LinkInfo(Klass* resolved_klass, Symbol* name, Symbol* signature, const methodHandle& current_method, 164 AccessCheck check_access = needs_access_check, 165 constantTag tag = JVM_CONSTANT_Invalid) : 166 _name(name), 167 _signature(signature), _resolved_klass(resolved_klass), _current_klass(current_method->method_holder()), _current_method(current_method), 168 _check_access(check_access == needs_access_check), _tag(tag) {} 169 170 // Case where we just find the method and don't check access against the current class 171 LinkInfo(Klass* resolved_klass, Symbol*name, Symbol* signature) : 172 _name(name), 173 _signature(signature), _resolved_klass(resolved_klass), _current_klass(NULL), _current_method(methodHandle()), 174 _check_access(false), _tag(JVM_CONSTANT_Invalid) {} 175 176 // accessors 177 Symbol* name() const { return _name; } 178 Symbol* signature() const { return _signature; } 179 Klass* resolved_klass() const { return _resolved_klass; } 180 Klass* current_klass() const { return _current_klass; } 181 Method* current_method() const { return _current_method(); } 182 constantTag tag() const { return _tag; } 183 bool check_access() const { return _check_access; } 184 185 void print() PRODUCT_RETURN; 186 }; 187 188 // Link information for getfield/putfield & getstatic/putstatic bytecodes | 127 void verify() PRODUCT_RETURN; 128 void print() PRODUCT_RETURN; 129 }; 130 131 132 // Condensed information from constant pool to use to resolve the method or field. 133 // resolved_klass = specified class (i.e., static receiver class) 134 // current_klass = sending method holder (i.e., class containing the method 135 // containing the call being resolved) 136 // current_method = sending method (relevant for field resolution) 137 class LinkInfo : public StackObj { 138 Symbol* _name; // extracted from JVM_CONSTANT_NameAndType 139 Symbol* _signature; 140 Klass* _resolved_klass; // class that the constant pool entry points to 141 Klass* _current_klass; // class that owns the constant pool 142 methodHandle _current_method; // sending method 143 bool _check_access; 144 constantTag _tag; 145 146 public: 147 enum class AccessCheck { 148 needs_access_check, 149 skip_access_check 150 }; 151 152 LinkInfo(const constantPoolHandle& pool, int index, const methodHandle& current_method, TRAPS); 153 LinkInfo(const constantPoolHandle& pool, int index, TRAPS); 154 155 // Condensed information from other call sites within the vm. 156 LinkInfo(Klass* resolved_klass, Symbol* name, Symbol* signature, Klass* current_klass, 157 AccessCheck check_access = AccessCheck::needs_access_check, 158 constantTag tag = JVM_CONSTANT_Invalid) : 159 _name(name), 160 _signature(signature), _resolved_klass(resolved_klass), _current_klass(current_klass), _current_method(methodHandle()), 161 _check_access(check_access == AccessCheck::needs_access_check), _tag(tag) {} 162 163 LinkInfo(Klass* resolved_klass, Symbol* name, Symbol* signature, const methodHandle& current_method, 164 AccessCheck check_access = AccessCheck::needs_access_check, 165 constantTag tag = JVM_CONSTANT_Invalid) : 166 _name(name), 167 _signature(signature), _resolved_klass(resolved_klass), _current_klass(current_method->method_holder()), _current_method(current_method), 168 _check_access(check_access == AccessCheck::needs_access_check), _tag(tag) {} 169 170 // Case where we just find the method and don't check access against the current class 171 LinkInfo(Klass* resolved_klass, Symbol*name, Symbol* signature) : 172 _name(name), 173 _signature(signature), _resolved_klass(resolved_klass), _current_klass(NULL), _current_method(methodHandle()), 174 _check_access(false), _tag(JVM_CONSTANT_Invalid) {} 175 176 // accessors 177 Symbol* name() const { return _name; } 178 Symbol* signature() const { return _signature; } 179 Klass* resolved_klass() const { return _resolved_klass; } 180 Klass* current_klass() const { return _current_klass; } 181 Method* current_method() const { return _current_method(); } 182 constantTag tag() const { return _tag; } 183 bool check_access() const { return _check_access; } 184 185 void print() PRODUCT_RETURN; 186 }; 187 188 // Link information for getfield/putfield & getstatic/putstatic bytecodes |