Fri, 19 Feb 2010 10:04:16 -0800
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
1.1 --- a/src/cpu/sparc/vm/sparc.ad Thu Feb 18 15:05:10 2010 -0800 1.2 +++ b/src/cpu/sparc/vm/sparc.ad Fri Feb 19 10:04:16 2010 -0800 1.3 @@ -1803,8 +1803,9 @@ 1.4 // to implement the UseStrictFP mode. 1.5 const bool Matcher::strict_fp_requires_explicit_rounding = false; 1.6 1.7 -// Do floats take an entire double register or just half? 1.8 -const bool Matcher::float_in_double = false; 1.9 +// Are floats conerted to double when stored to stack during deoptimization? 1.10 +// Sparc does not handle callee-save floats. 1.11 +bool Matcher::float_in_double() { return false; } 1.12 1.13 // Do ints take an entire long register or just half? 1.14 // Note that we if-def off of _LP64.
2.1 --- a/src/cpu/x86/vm/x86_32.ad Thu Feb 18 15:05:10 2010 -0800 2.2 +++ b/src/cpu/x86/vm/x86_32.ad Fri Feb 19 10:04:16 2010 -0800 2.3 @@ -1444,8 +1444,10 @@ 2.4 // to implement the UseStrictFP mode. 2.5 const bool Matcher::strict_fp_requires_explicit_rounding = true; 2.6 2.7 -// Do floats take an entire double register or just half? 2.8 -const bool Matcher::float_in_double = true; 2.9 +// Are floats conerted to double when stored to stack during deoptimization? 2.10 +// On x32 it is stored with convertion only when FPU is used for floats. 2.11 +bool Matcher::float_in_double() { return (UseSSE == 0); } 2.12 + 2.13 // Do ints take an entire long register or just half? 2.14 const bool Matcher::int_in_long = false; 2.15
3.1 --- a/src/cpu/x86/vm/x86_64.ad Thu Feb 18 15:05:10 2010 -0800 3.2 +++ b/src/cpu/x86/vm/x86_64.ad Fri Feb 19 10:04:16 2010 -0800 3.3 @@ -2074,8 +2074,10 @@ 3.4 // implement the UseStrictFP mode. 3.5 const bool Matcher::strict_fp_requires_explicit_rounding = true; 3.6 3.7 -// Do floats take an entire double register or just half? 3.8 -const bool Matcher::float_in_double = true; 3.9 +// Are floats conerted to double when stored to stack during deoptimization? 3.10 +// On x64 it is stored without convertion so we can use normal access. 3.11 +bool Matcher::float_in_double() { return false; } 3.12 + 3.13 // Do ints take an entire long register or just half? 3.14 const bool Matcher::int_in_long = true; 3.15
4.1 --- a/src/share/vm/opto/matcher.hpp Thu Feb 18 15:05:10 2010 -0800 4.2 +++ b/src/share/vm/opto/matcher.hpp Fri Feb 19 10:04:16 2010 -0800 4.3 @@ -373,8 +373,8 @@ 4.4 // to implement the UseStrictFP mode. 4.5 static const bool strict_fp_requires_explicit_rounding; 4.6 4.7 - // Do floats take an entire double register or just half? 4.8 - static const bool float_in_double; 4.9 + // Are floats conerted to double when stored to stack during deoptimization? 4.10 + static bool float_in_double(); 4.11 // Do ints take an entire long register or just half? 4.12 static const bool int_in_long; 4.13
5.1 --- a/src/share/vm/opto/output.cpp Thu Feb 18 15:05:10 2010 -0800 5.2 +++ b/src/share/vm/opto/output.cpp Fri Feb 19 10:04:16 2010 -0800 5.3 @@ -678,7 +678,7 @@ 5.4 #endif //_LP64 5.5 else if( (t->base() == Type::FloatBot || t->base() == Type::FloatCon) && 5.6 OptoReg::is_reg(regnum) ) { 5.7 - array->append(new_loc_value( _regalloc, regnum, Matcher::float_in_double 5.8 + array->append(new_loc_value( _regalloc, regnum, Matcher::float_in_double() 5.9 ? Location::float_in_dbl : Location::normal )); 5.10 } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) { 5.11 array->append(new_loc_value( _regalloc, regnum, Matcher::int_in_long