--- a/indy.compiler.patch Mon Jul 06 09:58:21 2009 +0200
+++ b/indy.compiler.patch Tue Jul 07 20:55:38 2009 -0700
@@ -346,7 +346,7 @@ diff --git a/src/share/vm/ci/ciEnv.cpp b
ciInstanceKlass* ciEnv::_Object;
ciInstanceKlass* ciEnv::_Throwable;
ciInstanceKlass* ciEnv::_Thread;
-@@ -685,6 +686,28 @@
+@@ -685,6 +686,35 @@
// ------------------------------------------------------------------
@@ -362,6 +362,13 @@ diff --git a/src/share/vm/ci/ciEnv.cpp b
+ assert(cpc_entry != NULL && cpc_entry->is_secondary_entry(), "sanity");
+ Handle call_site = cpc_entry->f1();
+
++ // Call site might not be linked yet.
++ if (call_site.is_null()) {
++ ciInstanceKlass* mh_klass = get_object(SystemDictionary::MethodHandle_klass())->as_instance_klass();
++ ciSymbol* sig_sym = get_object(cpool->signature_ref_at(index))->as_symbol();
++ return get_unloaded_method(mh_klass, ciSymbol::invoke_name(), sig_sym);
++ }
++
+ // Get the methodOop from the CallSite.
+ methodOop method_oop = (methodOop) java_dyn_CallSite::vmmethod(call_site());
+ assert(method_oop != NULL, "sanity");
@@ -375,7 +382,7 @@ diff --git a/src/share/vm/ci/ciEnv.cpp b
// ciEnv::get_instance_klass_for_declared_method_holder
ciInstanceKlass* ciEnv::get_instance_klass_for_declared_method_holder(ciKlass* method_holder) {
// For the case of <array>.clone(), the method holder can be a ciArrayKlass
-@@ -706,15 +729,18 @@
+@@ -706,15 +736,18 @@
}
@@ -551,7 +558,25 @@ diff --git a/src/share/vm/ci/ciTypeFlow.
diff --git a/src/share/vm/ci/ciTypeFlow.cpp b/src/share/vm/ci/ciTypeFlow.cpp
--- a/src/share/vm/ci/ciTypeFlow.cpp
+++ b/src/share/vm/ci/ciTypeFlow.cpp
-@@ -1292,8 +1292,8 @@
+@@ -635,8 +635,15 @@
+ ciMethod* method = str->get_method(will_link);
+ if (!will_link) {
+ // We weren't able to find the method.
+- ciKlass* unloaded_holder = method->holder();
+- trap(str, unloaded_holder, str->get_method_holder_index());
++ if (str->cur_bc() == Bytecodes::_invokedynamic) {
++ trap(str, NULL,
++ Deoptimization::make_trap_request
++ (Deoptimization::Reason_uninitialized,
++ Deoptimization::Action_reinterpret));
++ } else {
++ ciKlass* unloaded_holder = method->holder();
++ trap(str, unloaded_holder, str->get_method_holder_index());
++ }
+ } else {
+ ciSignature* signature = method->signature();
+ ciSignatureStream sigstr(signature);
+@@ -1292,8 +1299,8 @@
case Bytecodes::_invokeinterface: do_invoke(str, true); break;
case Bytecodes::_invokespecial: do_invoke(str, true); break;
case Bytecodes::_invokestatic: do_invoke(str, false); break;
@@ -691,6 +716,18 @@ diff --git a/src/share/vm/interpreter/by
def(_new , "new" , "bii" , NULL , T_OBJECT , 1, true );
def(_newarray , "newarray" , "bc" , NULL , T_OBJECT , 0, true );
def(_anewarray , "anewarray" , "bii" , NULL , T_OBJECT , 0, true );
+diff --git a/src/share/vm/interpreter/interpreter.cpp b/src/share/vm/interpreter/interpreter.cpp
+--- a/src/share/vm/interpreter/interpreter.cpp
++++ b/src/share/vm/interpreter/interpreter.cpp
+@@ -380,7 +380,7 @@
+ // (NOT needed for the old calling convension)
+ if (!is_top_frame) {
+ int index = Bytes::get_native_u4(bcp+1);
+- method->constants()->cache()->entry_at(index)->set_parameter_size(callee_parameters);
++ method->constants()->cache()->secondary_entry_at(index)->set_parameter_size(callee_parameters);
+ }
+ break;
+ }
diff --git a/src/share/vm/interpreter/linkResolver.cpp b/src/share/vm/interpreter/linkResolver.cpp
--- a/src/share/vm/interpreter/linkResolver.cpp
+++ b/src/share/vm/interpreter/linkResolver.cpp