hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp
changeset 580 aed902488ae4
parent 251 cb2e73f71205
child 670 ddf3e9583f2f
--- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Wed May 14 00:41:06 2008 -0700
+++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp	Thu May 15 22:40:43 2008 -0700
@@ -218,6 +218,13 @@
   ciInstanceKlass* callee_holder = ciEnv::get_instance_klass_for_declared_method_holder(holder);
   ciInstanceKlass* actual_recv = callee_holder;
 
+  // some methods are obviously bindable without any type checks so
+  // convert them directly to an invokespecial.
+  if (target->is_loaded() && !target->is_abstract() &&
+      target->can_be_statically_bound() && code == Bytecodes::_invokevirtual) {
+    code = Bytecodes::_invokespecial;
+  }
+
   // compute size of arguments
   int arg_size = target->arg_size();
   if (!target->is_loaded() && code == Bytecodes::_invokestatic) {