X87: fixed branch distances.

port r24151.

original commit message:

  Forgot a few kNear occurences, only happens with --deopt-every-n-times.
  Death to manual jump distance calculation! :-P

BUG=
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/595263002

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
weiliang.lin@intel.com 2014-09-24 15:17:20 +00:00
parent 352733dca2
commit 8e6e09c169

View File

@ -5302,9 +5302,10 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
Label lost_precision, is_nan, minus_zero, done; Label lost_precision, is_nan, minus_zero, done;
X87Register input_reg = ToX87Register(input); X87Register input_reg = ToX87Register(input);
X87Fxch(input_reg); X87Fxch(input_reg);
Label::Distance dist = DeoptEveryNTimes() ? Label::kFar : Label::kNear;
__ X87TOSToI(result_reg, instr->hydrogen()->GetMinusZeroMode(), __ X87TOSToI(result_reg, instr->hydrogen()->GetMinusZeroMode(),
&lost_precision, &is_nan, &minus_zero, Label::kNear); &lost_precision, &is_nan, &minus_zero, dist);
__ jmp(&done, Label::kNear); __ jmp(&done, dist);
__ bind(&lost_precision); __ bind(&lost_precision);
DeoptimizeIf(no_condition, instr, "lost precision"); DeoptimizeIf(no_condition, instr, "lost precision");
__ bind(&is_nan); __ bind(&is_nan);
@ -5326,10 +5327,10 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
Label lost_precision, is_nan, minus_zero, done; Label lost_precision, is_nan, minus_zero, done;
X87Register input_reg = ToX87Register(input); X87Register input_reg = ToX87Register(input);
X87Fxch(input_reg); X87Fxch(input_reg);
Label::Distance dist = DeoptEveryNTimes() ? Label::kFar : Label::kNear;
__ X87TOSToI(result_reg, instr->hydrogen()->GetMinusZeroMode(), __ X87TOSToI(result_reg, instr->hydrogen()->GetMinusZeroMode(),
&lost_precision, &is_nan, &minus_zero, &lost_precision, &is_nan, &minus_zero, dist);
DeoptEveryNTimes() ? Label::kFar : Label::kNear); __ jmp(&done, dist);
__ jmp(&done, Label::kNear);
__ bind(&lost_precision); __ bind(&lost_precision);
DeoptimizeIf(no_condition, instr, "lost precision"); DeoptimizeIf(no_condition, instr, "lost precision");
__ bind(&is_nan); __ bind(&is_nan);