changeset 2078:540dc0858c17

Fix PR IcedTea/481
author Gary Benson <gbenson@redhat.com>
date Wed, 05 May 2010 11:28:27 +0100
parents b571e4dc0ca6
children 6d1e2fae468a 0e1af84bed2c
files ChangeLog ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue May 04 17:50:37 2010 +0100
+++ b/ChangeLog	Wed May 05 11:28:27 2010 +0100
@@ -1,3 +1,10 @@
+2010-05-05  Gary Benson  <gbenson@redhat.com>
+
+	PR icedtea/481
+	* ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp
+	(SharkTopLevelBlock::improve_virtual_call): Disable an
+	optimization that cannot currently be supported.
+
 2010-05-04  Andrew John Hughes  <ahughes@redhat.com>
 
 	Move OpenJDK patches to appropriate subdirectory.
--- a/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp	Tue May 04 17:50:37 2010 +0100
+++ b/ports/hotspot/src/share/vm/shark/sharkTopLevelBlock.cpp	Wed May 05 11:28:27 2010 +0100
@@ -903,6 +903,18 @@
       dest_method->holder() == java_lang_Object_klass())
     return dest_method;
 
+#ifdef SHARK_CAN_DEOPTIMIZE_ANYWHERE
+  // This code can replace a virtual call with a direct call if this
+  // class is the only one in the entire set of loaded classes that
+  // implements this method.  This makes the compiled code dependent
+  // on other classes that implement the method not being loaded, a
+  // condition which is enforced by the dependency tracker.  If the
+  // dependency tracker determines a method has become invalid it
+  // will mark it for recompilation, causing running copies to be
+  // deoptimized.  Shark currently can't deoptimize arbitrarily like
+  // that, so this optimization cannot be used.
+  // http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=481
+  
   // All other interesting cases are instance classes
   if (!receiver_type->is_instance_klass())
     return NULL;
@@ -958,6 +970,8 @@
   // with non-monomorphic targets if the receiver has an exact
   // type.  We don't mark types this way, so we can't do this.
 
+#endif // SHARK_CAN_DEOPTIMIZE_ANYWHERE
+
   return NULL;
 }