Reviewers: jarin,

Message:
Committed patchset #1 (id:1) manually as 24151 (presubmit successful).

Description:
Fixed branch distances.

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

[email protected]

Committed: https://code.google.com/p/v8/source/detail?r=24151

Please review this at https://codereview.chromium.org/598573002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+12, -10 lines):
  M src/ia32/lithium-codegen-ia32.cc
  M src/x64/lithium-codegen-x64.cc


Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 7453cac53bc88e86c7fa4dcdb5d471a929089e92..1d7c8c1b0c6f86ab6bf716e788729f5c6f483968 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -4843,11 +4843,11 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
     Label lost_precision, is_nan, minus_zero, done;
     XMMRegister input_reg = ToDoubleRegister(input);
     XMMRegister xmm_scratch = double_scratch0();
+    Label::Distance dist = DeoptEveryNTimes() ? Label::kFar : Label::kNear;
     __ DoubleToI(result_reg, input_reg, xmm_scratch,
                  instr->hydrogen()->GetMinusZeroMode(), &lost_precision,
-                 &is_nan, &minus_zero,
-                 DeoptEveryNTimes() ? Label::kFar : Label::kNear);
-    __ jmp(&done, Label::kNear);
+                 &is_nan, &minus_zero, dist);
+    __ jmp(&done, dist);
     __ bind(&lost_precision);
     DeoptimizeIf(no_condition, instr, "lost precision");
     __ bind(&is_nan);
@@ -4869,10 +4869,11 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
   Label lost_precision, is_nan, minus_zero, done;
   XMMRegister input_reg = ToDoubleRegister(input);
   XMMRegister xmm_scratch = double_scratch0();
+  Label::Distance dist = DeoptEveryNTimes() ? Label::kFar : Label::kNear;
   __ DoubleToI(result_reg, input_reg, xmm_scratch,
instr->hydrogen()->GetMinusZeroMode(), &lost_precision, &is_nan, - &minus_zero, DeoptEveryNTimes() ? Label::kFar : Label::kNear);
-  __ jmp(&done, Label::kNear);
+               &minus_zero, dist);
+  __ jmp(&done, dist);
   __ bind(&lost_precision);
   DeoptimizeIf(no_condition, instr, "lost precision");
   __ bind(&is_nan);
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 9514657c34d9030e3dda9812b5235b3af46c5d5d..1981d55f7950409248ea0dd4c9e01fc7326d4ff7 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -5038,11 +5038,11 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
   } else {
     Label lost_precision, is_nan, minus_zero, done;
     XMMRegister xmm_scratch = double_scratch0();
+    Label::Distance dist = DeoptEveryNTimes() ? Label::kFar : Label::kNear;
     __ DoubleToI(result_reg, input_reg, xmm_scratch,
                  instr->hydrogen()->GetMinusZeroMode(), &lost_precision,
-                 &is_nan, &minus_zero,
-                 DeoptEveryNTimes() ? Label::kFar : Label::kNear);
-    __ jmp(&done, Label::kNear);
+                 &is_nan, &minus_zero, dist);
+    __ jmp(&done, dist);
     __ bind(&lost_precision);
     DeoptimizeIf(no_condition, instr, "lost precision");
     __ bind(&is_nan);
@@ -5065,10 +5065,11 @@ void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {

   Label lost_precision, is_nan, minus_zero, done;
   XMMRegister xmm_scratch = double_scratch0();
+  Label::Distance dist = DeoptEveryNTimes() ? Label::kFar : Label::kNear;
   __ DoubleToI(result_reg, input_reg, xmm_scratch,
instr->hydrogen()->GetMinusZeroMode(), &lost_precision, &is_nan, - &minus_zero, DeoptEveryNTimes() ? Label::kFar : Label::kNear);
-  __ jmp(&done, Label::kNear);
+               &minus_zero, dist);
+  __ jmp(&done, dist);
   __ bind(&lost_precision);
   DeoptimizeIf(no_condition, instr, "lost precision");
   __ bind(&is_nan);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to