Remove a generated mov and jmp.
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 17 Feb 2010 14:18:47 +0000 (14:18 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 17 Feb 2010 14:18:47 +0000 (14:18 +0000)
Remove a move and jump from the fast-path code in the speculative
backend. Ultimately, this code belongs to the bailout and not the
fast path.

Review URL: http://codereview.chromium.org/601094

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm/fast-codegen-arm.cc
src/ia32/fast-codegen-ia32.cc
src/x64/fast-codegen-x64.cc

index 1029609..a07b0d2 100644 (file)
@@ -156,13 +156,9 @@ void FastCodeGenerator::EmitBitOr() {
   } else {
     // Preserve the destination operand in a scratch register in case of
     // bailout.
-    Label done;
     __ mov(scratch0(), destination());
     __ orr(destination(), accumulator1(), Operand(accumulator0()));
-    __ BranchOnSmi(destination(), &done);
-    __ mov(destination(), scratch0());
-    __ jmp(bailout());
-    __ bind(&done);
+    __ BranchOnNotSmi(destination(), bailout());
   }
 
   // If we didn't bailout, the result (in fact, both inputs too) is known to
index 39c77ee..9bab75a 100644 (file)
@@ -165,14 +165,10 @@ void FastCodeGenerator::EmitBitOr() {
   } else {
     // Preserve the destination operand in a scratch register in case of
     // bailout.
-    Label done;
     __ mov(scratch0(), destination());
     __ or_(destination(), Operand(other_accumulator(destination())));
     __ test(destination(), Immediate(kSmiTagMask));
-    __ j(zero, &done, taken);
-    __ mov(destination(), scratch0());
-    __ jmp(bailout());
-    __ bind(&done);
+    __ j(not_zero, bailout(), not_taken);
   }
 
   // If we didn't bailout, the result (in fact, both inputs too) is known to
index fe61ff7..1af7685 100644 (file)
@@ -165,13 +165,9 @@ void FastCodeGenerator::EmitBitOr() {
   } else {
     // Preserve the destination operand in a scratch register in case of
     // bailout.
-    Label done;
     __ movq(scratch0(), destination());
     __ or_(destination(), other_accumulator(destination()));
-    __ JumpIfSmi(destination(), &done);
-    __ movq(destination(), scratch0());
-    __ jmp(bailout());
-    __ bind(&done);
+    __ JumpIfNotSmi(destination(), bailout());
   }