diff src/share/vm/opto/bytecodeInfo.cpp @ 10281:1da5d70655e9

8014286: failed java/lang/Math/DivModTests.java after 6934604 changes Summary: Corrected escape state for the result of boxing method. Added force inlining executed boxing methods. Reviewed-by: twisti
author kvn
date Mon, 13 May 2013 14:36:39 -0700
parents 6f3fd5150b67
children 836a62f43af9 02d7aa1456c9
line wrap: on
line diff
--- a/src/share/vm/opto/bytecodeInfo.cpp	Mon May 13 12:43:10 2013 -0700
+++ b/src/share/vm/opto/bytecodeInfo.cpp	Mon May 13 14:36:39 2013 -0700
@@ -85,20 +85,34 @@
   assert(!UseOldInlining, "do not use for old stuff");
 }
 
+/**
+ *  Return true when EA is ON and a java constructor is called or
+ *  a super constructor is called from an inlined java constructor.
+ *  Also return true for boxing methods.
+ */
 static bool is_init_with_ea(ciMethod* callee_method,
                             ciMethod* caller_method, Compile* C) {
-  // True when EA is ON and a java constructor is called or
-  // a super constructor is called from an inlined java constructor.
-  return C->do_escape_analysis() && EliminateAllocations &&
-         ( callee_method->is_initializer() ||
-           (caller_method->is_initializer() &&
-            caller_method != C->method() &&
-            caller_method->holder()->is_subclass_of(callee_method->holder()))
-         );
+  if (!C->do_escape_analysis() || !EliminateAllocations) {
+    return false; // EA is off
+  }
+  if (callee_method->is_initializer()) {
+    return true; // constuctor
+  }
+  if (caller_method->is_initializer() &&
+      caller_method != C->method() &&
+      caller_method->holder()->is_subclass_of(callee_method->holder())) {
+    return true; // super constructor is called from inlined constructor
+  }
+  if (C->eliminate_boxing() && callee_method->is_boxing_method()) {
+    return true;
+  }
+  return false;
 }
 
+/**
+ *  Force inlining unboxing accessor.
+ */
 static bool is_unboxing_method(ciMethod* callee_method, Compile* C) {
-  // Force inlining unboxing accessor.
   return C->eliminate_boxing() && callee_method->is_unboxing_method();
 }