Mercurial > hg > graal-jvmci-8
diff src/share/vm/ci/ciEnv.cpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 82af018d61db 1d7922586cf6 |
children | c38f13903fdf |
line wrap: on
line diff
--- a/src/share/vm/ci/ciEnv.cpp Mon Aug 20 15:21:31 2012 +0200 +++ b/src/share/vm/ci/ciEnv.cpp Tue Aug 21 10:39:19 2012 +0200 @@ -50,7 +50,6 @@ #include "oops/oop.inline.hpp" #include "oops/oop.inline2.hpp" #include "prims/jvmtiExport.hpp" -#include "prims/methodHandleWalk.hpp" #include "runtime/init.hpp" #include "runtime/reflection.hpp" #include "runtime/sharedRuntime.hpp" @@ -581,7 +580,7 @@ assert(index < 0, "only one kind of index at a time"); ConstantPoolCacheEntry* cpc_entry = cpool->cache()->entry_at(cache_index); index = cpc_entry->constant_pool_index(); - oop obj = cpc_entry->f1(); + oop obj = cpc_entry->f1_as_instance(); if (obj != NULL) { assert(obj->is_instance() || obj->is_array(), "must be a Java reference"); ciObject* ciobj = get_object(obj); @@ -749,7 +748,7 @@ if (cpool->has_preresolution() || (holder == ciEnv::MethodHandle_klass() && - methodOopDesc::is_method_handle_invoke_name(name_sym))) { + MethodHandles::is_signature_polymorphic_name(holder->get_klassOop(), name_sym))) { // Short-circuit lookups for JSR 292-related call sites. // That is, do not rely only on name-based lookups, because they may fail // if the names are not resolvable in the boot class loader (7056328). @@ -759,11 +758,13 @@ case Bytecodes::_invokespecial: case Bytecodes::_invokestatic: { - methodOop m = constantPoolOopDesc::method_at_if_loaded(cpool, index, bc); + oop appendix_oop = NULL; + methodOop m = constantPoolOopDesc::method_at_if_loaded(cpool, index); if (m != NULL) { return get_object(m)->as_method(); } } + break; } } @@ -799,27 +800,28 @@ // Compare the following logic with InterpreterRuntime::resolve_invokedynamic. assert(bc == Bytecodes::_invokedynamic, "must be invokedynamic"); - bool is_resolved = cpool->cache()->main_entry_at(index)->is_resolved(bc); - if (is_resolved && cpool->cache()->secondary_entry_at(index)->is_f1_null()) - // FIXME: code generation could allow for null (unlinked) call site - is_resolved = false; + ConstantPoolCacheEntry* secondary_entry = cpool->cache()->secondary_entry_at(index); + bool is_resolved = !secondary_entry->is_f1_null(); + // FIXME: code generation could allow for null (unlinked) call site + // The call site could be made patchable as follows: + // Load the appendix argument from the constant pool. + // Test the appendix argument and jump to a known deopt routine if it is null. + // Jump through a patchable call site, which is initially a deopt routine. + // Patch the call site to the nmethod entry point of the static compiled lambda form. + // As with other two-component call sites, both values must be independently verified. - // Call site might not be resolved yet. We could create a real invoker method from the - // compiler, but it is simpler to stop the code path here with an unlinked method. + // Call site might not be resolved yet. + // Stop the code path here with an unlinked method. if (!is_resolved) { ciInstanceKlass* holder = get_object(SystemDictionary::MethodHandle_klass())->as_instance_klass(); - ciSymbol* name = ciSymbol::invokeExact_name(); + ciSymbol* name = ciSymbol::invokeBasic_name(); ciSymbol* signature = get_symbol(cpool->signature_ref_at(index)); return get_unloaded_method(holder, name, signature, accessor); } - // Get the invoker methodOop from the constant pool. - oop f1_value = cpool->cache()->main_entry_at(index)->f1(); - methodOop signature_invoker = (methodOop) f1_value; - assert(signature_invoker != NULL && signature_invoker->is_method() && signature_invoker->is_method_handle_invoke(), - "correct result from LinkResolver::resolve_invokedynamic"); - - return get_object(signature_invoker)->as_method(); + // Get the invoker methodOop and the extra argument from the constant pool. + methodOop adapter = secondary_entry->f2_as_vfinal_method(); + return get_object(adapter)->as_method(); } @@ -1131,7 +1133,7 @@ // ------------------------------------------------------------------ // ciEnv::notice_inlined_method() void ciEnv::notice_inlined_method(ciMethod* method) { - _num_inlined_bytecodes += method->code_size(); + _num_inlined_bytecodes += method->code_size_for_inlining(); } // ------------------------------------------------------------------