changeset 1271:2883969d09e7

6910664: C2: java/util/Arrays/Sorting.java fails with DeoptimizeALot flag Summary: Matcher::float_in_double should be true only when FPU is used for floats. Reviewed-by: never, twisti
author kvn
date Fri, 19 Feb 2010 10:04:16 -0800
parents 877a14af58e1
children b71f13525cc8
files src/cpu/sparc/vm/sparc.ad src/cpu/x86/vm/x86_32.ad src/cpu/x86/vm/x86_64.ad src/share/vm/opto/matcher.hpp src/share/vm/opto/output.cpp
diffstat 5 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/sparc.ad	Thu Feb 18 15:05:10 2010 -0800
+++ b/src/cpu/sparc/vm/sparc.ad	Fri Feb 19 10:04:16 2010 -0800
@@ -1803,8 +1803,9 @@
 // to implement the UseStrictFP mode.
 const bool Matcher::strict_fp_requires_explicit_rounding = false;
 
-// Do floats take an entire double register or just half?
-const bool Matcher::float_in_double = false;
+// Are floats conerted to double when stored to stack during deoptimization?
+// Sparc does not handle callee-save floats.
+bool Matcher::float_in_double() { return false; }
 
 // Do ints take an entire long register or just half?
 // Note that we if-def off of _LP64.
--- a/src/cpu/x86/vm/x86_32.ad	Thu Feb 18 15:05:10 2010 -0800
+++ b/src/cpu/x86/vm/x86_32.ad	Fri Feb 19 10:04:16 2010 -0800
@@ -1444,8 +1444,10 @@
 // to implement the UseStrictFP mode.
 const bool Matcher::strict_fp_requires_explicit_rounding = true;
 
-// Do floats take an entire double register or just half?
-const bool Matcher::float_in_double = true;
+// Are floats conerted to double when stored to stack during deoptimization?
+// On x32 it is stored with convertion only when FPU is used for floats.
+bool Matcher::float_in_double() { return (UseSSE == 0); }
+
 // Do ints take an entire long register or just half?
 const bool Matcher::int_in_long = false;
 
--- a/src/cpu/x86/vm/x86_64.ad	Thu Feb 18 15:05:10 2010 -0800
+++ b/src/cpu/x86/vm/x86_64.ad	Fri Feb 19 10:04:16 2010 -0800
@@ -2074,8 +2074,10 @@
 // implement the UseStrictFP mode.
 const bool Matcher::strict_fp_requires_explicit_rounding = true;
 
-// Do floats take an entire double register or just half?
-const bool Matcher::float_in_double = true;
+// Are floats conerted to double when stored to stack during deoptimization?
+// On x64 it is stored without convertion so we can use normal access.
+bool Matcher::float_in_double() { return false; }
+
 // Do ints take an entire long register or just half?
 const bool Matcher::int_in_long = true;
 
--- a/src/share/vm/opto/matcher.hpp	Thu Feb 18 15:05:10 2010 -0800
+++ b/src/share/vm/opto/matcher.hpp	Fri Feb 19 10:04:16 2010 -0800
@@ -373,8 +373,8 @@
   // to implement the UseStrictFP mode.
   static const bool strict_fp_requires_explicit_rounding;
 
-  // Do floats take an entire double register or just half?
-  static const bool float_in_double;
+  // Are floats conerted to double when stored to stack during deoptimization?
+  static bool float_in_double();
   // Do ints take an entire long register or just half?
   static const bool int_in_long;
 
--- a/src/share/vm/opto/output.cpp	Thu Feb 18 15:05:10 2010 -0800
+++ b/src/share/vm/opto/output.cpp	Fri Feb 19 10:04:16 2010 -0800
@@ -678,7 +678,7 @@
 #endif //_LP64
     else if( (t->base() == Type::FloatBot || t->base() == Type::FloatCon) &&
                OptoReg::is_reg(regnum) ) {
-      array->append(new_loc_value( _regalloc, regnum, Matcher::float_in_double
+      array->append(new_loc_value( _regalloc, regnum, Matcher::float_in_double()
                                    ? Location::float_in_dbl : Location::normal ));
     } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) {
       array->append(new_loc_value( _regalloc, regnum, Matcher::int_in_long