comparison src/share/vm/c1/c1_LinearScan.cpp @ 3999:eba73e0c7780

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 7588156f5cf9
children c7401dcad8bf
comparison
equal deleted inserted replaced
3998:ec5ce9326985 3999:eba73e0c7780
2617 opr = _fpu_stack_allocator->to_fpu_stack(opr); 2617 opr = _fpu_stack_allocator->to_fpu_stack(opr);
2618 #endif 2618 #endif
2619 2619
2620 Location::Type loc_type = float_saved_as_double ? Location::float_in_dbl : Location::normal; 2620 Location::Type loc_type = float_saved_as_double ? Location::float_in_dbl : Location::normal;
2621 VMReg rname = frame_map()->fpu_regname(opr->fpu_regnr()); 2621 VMReg rname = frame_map()->fpu_regname(opr->fpu_regnr());
2622 #ifndef __SOFTFP__
2623 #ifndef VM_LITTLE_ENDIAN
2624 if (! float_saved_as_double) {
2625 // On big endian system, we may have an issue if float registers use only
2626 // the low half of the (same) double registers.
2627 // Both the float and the double could have the same regnr but would correspond
2628 // to two different addresses once saved.
2629
2630 // get next safely (no assertion checks)
2631 VMReg next = VMRegImpl::as_VMReg(1+rname->value());
2632 if (next->is_reg() &&
2633 (next->as_FloatRegister() == rname->as_FloatRegister())) {
2634 // the back-end does use the same numbering for the double and the float
2635 rname = next; // VMReg for the low bits, e.g. the real VMReg for the float
2636 }
2637 }
2638 #endif
2639 #endif
2622 LocationValue* sv = new LocationValue(Location::new_reg_loc(loc_type, rname)); 2640 LocationValue* sv = new LocationValue(Location::new_reg_loc(loc_type, rname));
2623 2641
2624 scope_values->append(sv); 2642 scope_values->append(sv);
2625 return 1; 2643 return 1;
2626 2644