188 int bci() const { return _bci; }
189 address bcp() const { return _method->bcp_from(bci()); }
190
191 int index() const; // the constant pool index for the invoke
192 symbolOop name() const; // returns the name of the invoked method
193 symbolOop signature() const; // returns the signature of the invoked method
194 BasicType result_type(Thread *thread) const; // returns the result type of the invoke
195
196 Bytecodes::Code code() const { return Bytecodes::code_at(bcp(), _method()); }
197 Bytecodes::Code adjusted_invoke_code() const { return Bytecodes::java_code(code()); }
198
199 methodHandle static_target(TRAPS); // "specified" method (from constant pool)
200
201 // Testers
202 bool is_invokeinterface() const { return adjusted_invoke_code() == Bytecodes::_invokeinterface; }
203 bool is_invokevirtual() const { return adjusted_invoke_code() == Bytecodes::_invokevirtual; }
204 bool is_invokestatic() const { return adjusted_invoke_code() == Bytecodes::_invokestatic; }
205 bool is_invokespecial() const { return adjusted_invoke_code() == Bytecodes::_invokespecial; }
206 bool is_invokedynamic() const { return adjusted_invoke_code() == Bytecodes::_invokedynamic; }
207
208 bool has_giant_index() const { return is_invokedynamic(); }
209
210 bool is_valid() const { return is_invokeinterface() ||
211 is_invokevirtual() ||
212 is_invokestatic() ||
213 is_invokespecial() ||
214 is_invokedynamic(); }
215
216 // Creation
217 inline friend Bytecode_invoke* Bytecode_invoke_at(methodHandle method, int bci);
218
219 // Like Bytecode_invoke_at. Instead it returns NULL if the bci is not at an invoke.
220 inline friend Bytecode_invoke* Bytecode_invoke_at_check(methodHandle method, int bci);
221 };
222
223 inline Bytecode_invoke* Bytecode_invoke_at(methodHandle method, int bci) {
224 Bytecode_invoke* b = new Bytecode_invoke(method, bci);
225 debug_only(b->verify());
226 return b;
227 }
|
188 int bci() const { return _bci; }
189 address bcp() const { return _method->bcp_from(bci()); }
190
191 int index() const; // the constant pool index for the invoke
192 symbolOop name() const; // returns the name of the invoked method
193 symbolOop signature() const; // returns the signature of the invoked method
194 BasicType result_type(Thread *thread) const; // returns the result type of the invoke
195
196 Bytecodes::Code code() const { return Bytecodes::code_at(bcp(), _method()); }
197 Bytecodes::Code adjusted_invoke_code() const { return Bytecodes::java_code(code()); }
198
199 methodHandle static_target(TRAPS); // "specified" method (from constant pool)
200
201 // Testers
202 bool is_invokeinterface() const { return adjusted_invoke_code() == Bytecodes::_invokeinterface; }
203 bool is_invokevirtual() const { return adjusted_invoke_code() == Bytecodes::_invokevirtual; }
204 bool is_invokestatic() const { return adjusted_invoke_code() == Bytecodes::_invokestatic; }
205 bool is_invokespecial() const { return adjusted_invoke_code() == Bytecodes::_invokespecial; }
206 bool is_invokedynamic() const { return adjusted_invoke_code() == Bytecodes::_invokedynamic; }
207
208 bool has_receiver() const { return !is_invokestatic() && !is_invokedynamic(); }
209 bool has_giant_index() const { return is_invokedynamic(); }
210
211 bool is_valid() const { return is_invokeinterface() ||
212 is_invokevirtual() ||
213 is_invokestatic() ||
214 is_invokespecial() ||
215 is_invokedynamic(); }
216
217 // Creation
218 inline friend Bytecode_invoke* Bytecode_invoke_at(methodHandle method, int bci);
219
220 // Like Bytecode_invoke_at. Instead it returns NULL if the bci is not at an invoke.
221 inline friend Bytecode_invoke* Bytecode_invoke_at_check(methodHandle method, int bci);
222 };
223
224 inline Bytecode_invoke* Bytecode_invoke_at(methodHandle method, int bci) {
225 Bytecode_invoke* b = new Bytecode_invoke(method, bci);
226 debug_only(b->verify());
227 return b;
228 }
|