Revision: 20385
Author:   [email protected]
Date:     Tue Apr  1 10:32:25 2014 UTC
Log:      Set kTruncatingToSmi for HChange only when To rep is Smi

BUG=
[email protected]

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

Patch from Weiliang Lin <[email protected]>.
http://code.google.com/p/v8/source/detail?r=20385

Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h

=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Tue Mar 25 16:32:23 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.cc Tue Apr 1 10:32:25 2014 UTC
@@ -1561,6 +1561,7 @@
   HUnaryOperation::PrintDataTo(stream);
   stream->Add(" %s to %s", from().Mnemonic(), to().Mnemonic());

+  if (CanTruncateToSmi()) stream->Add(" truncating-smi");
   if (CanTruncateToInt32()) stream->Add(" truncating-int32");
   if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
if (CheckFlag(kAllowUndefinedAsNaN)) stream->Add(" allow-undefined-as-nan");
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Tue Apr 1 09:20:28 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Tue Apr 1 10:32:25 2014 UTC
@@ -1263,6 +1263,7 @@
     position_.set_operand_position(index, pos);
   }

+  bool CanTruncateToSmi() const { return CheckFlag(kTruncatingToSmi); }
   bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); }

   virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0;
@@ -1733,7 +1734,7 @@
     set_representation(to);
     SetFlag(kUseGVN);
     SetFlag(kCanOverflow);
-    if (is_truncating_to_smi) {
+    if (is_truncating_to_smi && to.IsSmi()) {
       SetFlag(kTruncatingToSmi);
       SetFlag(kTruncatingToInt32);
     }

--
--
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