Mercurial > hg > truffle
diff src/share/vm/ci/ciStreams.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 | 8033953d67ff |
children | 7f813940ac35 |
line wrap: on
line diff
--- a/src/share/vm/ci/ciStreams.cpp Mon Jul 23 13:04:59 2012 -0700 +++ b/src/share/vm/ci/ciStreams.cpp Tue Jul 24 10:51:00 2012 -0700 @@ -364,6 +364,29 @@ } // ------------------------------------------------------------------ +// ciBytecodeStream::has_appendix +// +// Returns true if there is an appendix argument stored in the +// constant pool cache at the current bci. +bool ciBytecodeStream::has_appendix() { + VM_ENTRY_MARK; + constantPoolHandle cpool(_method->get_methodOop()->constants()); + return constantPoolOopDesc::has_appendix_at_if_loaded(cpool, get_method_index()); +} + +// ------------------------------------------------------------------ +// ciBytecodeStream::get_appendix +// +// Return the appendix argument stored in the constant pool cache at +// the current bci. +ciObject* ciBytecodeStream::get_appendix() { + VM_ENTRY_MARK; + constantPoolHandle cpool(_method->get_methodOop()->constants()); + oop appendix_oop = constantPoolOopDesc::appendix_at_if_loaded(cpool, get_method_index()); + return CURRENT_ENV->get_object(appendix_oop); +} + +// ------------------------------------------------------------------ // ciBytecodeStream::get_declared_method_holder // // Get the declared holder of the currently referenced method. @@ -378,9 +401,9 @@ VM_ENTRY_MARK; constantPoolHandle cpool(_method->get_methodOop()->constants()); bool ignore; - // report as InvokeDynamic for invokedynamic, which is syntactically classless + // report as MethodHandle for invokedynamic, which is syntactically classless if (cur_bc() == Bytecodes::_invokedynamic) - return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_lang_invoke_InvokeDynamic(), false); + return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_lang_invoke_MethodHandle(), false); return CURRENT_ENV->get_klass_by_index(cpool, get_method_holder_index(), ignore, _holder); } @@ -396,6 +419,24 @@ } // ------------------------------------------------------------------ +// ciBytecodeStream::get_declared_method_signature +// +// Get the declared signature of the currently referenced method. +// +// This is always the same as the signature of the resolved method +// itself, except for _invokehandle and _invokedynamic calls. +// +ciSignature* ciBytecodeStream::get_declared_method_signature() { + int sig_index = get_method_signature_index(); + VM_ENTRY_MARK; + ciEnv* env = CURRENT_ENV; + constantPoolHandle cpool(_method->get_methodOop()->constants()); + Symbol* sig_sym = cpool->symbol_at(sig_index); + ciKlass* pool_holder = env->get_object(cpool->pool_holder())->as_klass(); + return new (env->arena()) ciSignature(pool_holder, cpool, env->get_symbol(sig_sym)); +} + +// ------------------------------------------------------------------ // ciBytecodeStream::get_method_signature_index // // Get the constant pool index of the signature of the method @@ -434,7 +475,7 @@ // Get the CallSite from the constant pool cache. int method_index = get_method_index(); ConstantPoolCacheEntry* cpcache_entry = cpcache->secondary_entry_at(method_index); - oop call_site_oop = cpcache_entry->f1(); + oop call_site_oop = cpcache_entry->f1_as_instance(); // Create a CallSite object and return it. return CURRENT_ENV->get_object(call_site_oop)->as_call_site();