Mercurial > hg > release > icedtea7-forest-2.1 > hotspot
changeset 2904:876f4a66bd71
7096366: PPC: corruption of floating-point values with DeoptimizeALot
Summary: fix for a deoptimization found on PPC, which could impact other big endian platforms
Reviewed-by: roland, dholmes
author | bdelsart |
---|---|
date | Fri, 07 Oct 2011 13:28:44 +0200 |
parents | 34d69affce86 |
children | c2ef8b5cd1f3 |
files | src/share/vm/c1/c1_LinearScan.cpp |
diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/vm/c1/c1_LinearScan.cpp Thu Sep 29 09:53:56 2011 -0700 +++ b/src/share/vm/c1/c1_LinearScan.cpp Fri Oct 07 13:28:44 2011 +0200 @@ -2619,6 +2619,24 @@ Location::Type loc_type = float_saved_as_double ? Location::float_in_dbl : Location::normal; VMReg rname = frame_map()->fpu_regname(opr->fpu_regnr()); +#ifndef __SOFTFP__ +#ifndef VM_LITTLE_ENDIAN + if (! float_saved_as_double) { + // On big endian system, we may have an issue if float registers use only + // the low half of the (same) double registers. + // Both the float and the double could have the same regnr but would correspond + // to two different addresses once saved. + + // get next safely (no assertion checks) + VMReg next = VMRegImpl::as_VMReg(1+rname->value()); + if (next->is_reg() && + (next->as_FloatRegister() == rname->as_FloatRegister())) { + // the back-end does use the same numbering for the double and the float + rname = next; // VMReg for the low bits, e.g. the real VMReg for the float + } + } +#endif +#endif LocationValue* sv = new LocationValue(Location::new_reg_loc(loc_type, rname)); scope_values->append(sv);