Reviewers: Michael Starzinger,

Message:
PTAL

Description:
Revert "Smi-support for HSar."

Please review this at https://chromiumcodereview.appspot.com/21076003/

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

Affected files:
  M src/arm/lithium-arm.cc
  M src/arm/lithium-codegen-arm.cc
  M src/hydrogen-instructions.h
  M src/ia32/lithium-codegen-ia32.cc
  M src/ia32/lithium-ia32.cc
  M src/x64/lithium-x64.cc


Index: src/arm/lithium-arm.cc
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc
index f7286191a8f64f6c84dfa03f63081be38f31602a..b55679ee0147b30f702b6cff74ae879ad7811f44 100644
--- a/src/arm/lithium-arm.cc
+++ b/src/arm/lithium-arm.cc
@@ -733,9 +733,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
     constant_value = constant->Integer32Value() & 0x1f;
// Left shifts can deoptimize if we shift by > 0 and the result cannot be
     // truncated to smi.
-    if (instr->representation().IsSmi() &&
-        op == Token::SHL &&
-        constant_value > 0) {
+    if (instr->representation().IsSmi() && constant_value > 0) {
       for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
         if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
           does_deopt = true;
@@ -754,8 +752,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
       does_deopt = !instr->CheckFlag(HInstruction::kUint32);
     } else {
       for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
-        if (!it.value()->CheckFlag(HValue::kTruncatingToInt32) &&
-            !it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
+        if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
           does_deopt = true;
           break;
         }
Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index 8cdc886e2e5a944b4008e0696996c8ecc189f2f0..929d04de13aa693065ad37067d8645266eed2300 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -1725,9 +1725,6 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
       case Token::SAR:
         if (shift_count != 0) {
           __ mov(result, Operand(left, ASR, shift_count));
-          if (instr->hydrogen_value()->representation().IsSmi()) {
-            __ and_(result, result, Operand(~kSmiTagMask));
-          }
         } else {
           __ Move(result, left);
         }
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 077d47b3fa44ac3449eeb9dc7fe0e3b6fbeacdb7..e71b7cdf41a1b483e22320eecddd5a569fe0a541 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -4964,9 +4964,7 @@ class HShr: public HBitwiseBinaryOperation {
   virtual void UpdateRepresentation(Representation new_rep,
                                     HInferRepresentationPhase* h_infer,
                                     const char* reason) {
-    if (new_rep.IsSmi() && !right()->IsConstant()) {
-      new_rep = Representation::Integer32();
-    }
+    if (new_rep.IsSmi()) new_rep = Representation::Integer32();
HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason);
   }

Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 5096ea81d457ab6756ad44614b9d5cdf8269e407..3ddad068bfdfc0454442a87e3fd964269d5e6298 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -1757,9 +1757,6 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
       case Token::SAR:
         if (shift_count != 0) {
           __ sar(ToRegister(left), shift_count);
-          if (instr->hydrogen_value()->representation().IsSmi()) {
-            __ and_(ToRegister(left), ~kSmiTagMask);
-          }
         }
         break;
       case Token::SHR:
Index: src/ia32/lithium-ia32.cc
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc
index 026c2a43a0718050653fd0317fc1f9ab883c2606..8c8103f61996e9f9a4604dc32a7ce3f4c4b39066 100644
--- a/src/ia32/lithium-ia32.cc
+++ b/src/ia32/lithium-ia32.cc
@@ -787,9 +787,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
     constant_value = constant->Integer32Value() & 0x1f;
// Left shifts can deoptimize if we shift by > 0 and the result cannot be
     // truncated to smi.
-    if (instr->representation().IsSmi() &&
-        op == Token::SHL &&
-        constant_value > 0) {
+    if (instr->representation().IsSmi() && constant_value > 0) {
       for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
         if (!it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
           does_deopt = true;
@@ -808,8 +806,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
       does_deopt = !instr->CheckFlag(HInstruction::kUint32);
     } else {
       for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
-        if (!it.value()->CheckFlag(HValue::kTruncatingToInt32) &&
-            !it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
+        if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
           does_deopt = true;
           break;
         }
Index: src/x64/lithium-x64.cc
diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc
index 79b575d1a1f94cacf108abb6634b6a4496e8e691..4153417473e24e4dfc2d915799b294dc3c4413d5 100644
--- a/src/x64/lithium-x64.cc
+++ b/src/x64/lithium-x64.cc
@@ -751,8 +751,7 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
       does_deopt = !instr->CheckFlag(HInstruction::kUint32);
     } else {
       for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
-        if (!it.value()->CheckFlag(HValue::kTruncatingToInt32) &&
-            !it.value()->CheckFlag(HValue::kTruncatingToSmi)) {
+        if (!it.value()->CheckFlag(HValue::kTruncatingToInt32)) {
           does_deopt = true;
           break;
         }


--
--
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/groups/opt_out.


Reply via email to