Mercurial > hg > graal-compiler
diff src/share/vm/interpreter/bytecode.cpp @ 6266:1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
6984705: JSR 292 method handle creation should not go through JNI
Summary: remove assembly code for JDK 7 chained method handles
Reviewed-by: jrose, twisti, kvn, mhaupt
Contributed-by: John Rose <john.r.rose@oracle.com>, Christian Thalinger <christian.thalinger@oracle.com>, Michael Haupt <michael.haupt@oracle.com>
author | twisti |
---|---|
date | Tue, 24 Jul 2012 10:51:00 -0700 |
parents | 3582bf76420e |
children | da91efe96a93 |
line wrap: on
line diff
--- a/src/share/vm/interpreter/bytecode.cpp Mon Jul 23 13:04:59 2012 -0700 +++ b/src/share/vm/interpreter/bytecode.cpp Tue Jul 24 10:51:00 2012 -0700 @@ -120,19 +120,22 @@ void Bytecode_invoke::verify() const { assert(is_valid(), "check invoke"); - assert(method()->constants()->cache() != NULL, "do not call this from verifier or rewriter"); + assert(cpcache() != NULL, "do not call this from verifier or rewriter"); +} + + +Symbol* Bytecode_member_ref::klass() const { + return constants()->klass_ref_at_noresolve(index()); +} + + +Symbol* Bytecode_member_ref::name() const { + return constants()->name_ref_at(index()); } Symbol* Bytecode_member_ref::signature() const { - constantPoolOop constants = method()->constants(); - return constants->signature_ref_at(index()); -} - - -Symbol* Bytecode_member_ref::name() const { - constantPoolOop constants = method()->constants(); - return constants->name_ref_at(index()); + return constants()->signature_ref_at(index()); } @@ -146,18 +149,19 @@ methodHandle Bytecode_invoke::static_target(TRAPS) { methodHandle m; KlassHandle resolved_klass; - constantPoolHandle constants(THREAD, _method->constants()); + constantPoolHandle constants(THREAD, this->constants()); - if (java_code() == Bytecodes::_invokedynamic) { - LinkResolver::resolve_dynamic_method(m, resolved_klass, constants, index(), CHECK_(methodHandle())); - } else if (java_code() != Bytecodes::_invokeinterface) { - LinkResolver::resolve_method(m, resolved_klass, constants, index(), CHECK_(methodHandle())); - } else { - LinkResolver::resolve_interface_method(m, resolved_klass, constants, index(), CHECK_(methodHandle())); - } + Bytecodes::Code bc = invoke_code(); + LinkResolver::resolve_method_statically(m, resolved_klass, bc, constants, index(), CHECK_(methodHandle())); return m; } +Handle Bytecode_invoke::appendix(TRAPS) { + ConstantPoolCacheEntry* cpce = cpcache_entry(); + if (cpce->has_appendix()) + return Handle(THREAD, cpce->f1_appendix()); + return Handle(); // usual case +} int Bytecode_member_ref::index() const { // Note: Rewriter::rewrite changes the Java_u2 of an invokedynamic to a native_u4, @@ -170,12 +174,16 @@ } int Bytecode_member_ref::pool_index() const { + return cpcache_entry()->constant_pool_index(); +} + +ConstantPoolCacheEntry* Bytecode_member_ref::cpcache_entry() const { int index = this->index(); DEBUG_ONLY({ if (!has_index_u4(code())) - index -= constantPoolOopDesc::CPCACHE_INDEX_TAG; + index = constantPoolOopDesc::get_cpcache_index(index); }); - return _method->constants()->cache()->entry_at(index)->constant_pool_index(); + return cpcache()->entry_at(index); } // Implementation of Bytecode_field