Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 81ecb890bf9c22551202bb6b2e51d19c0abd10ac..33cf2f72e6251976ecacf08ac1667545f9d6ae04 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -1263,6 +1263,7 @@ class HInstruction : public HValue { |
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 @@ class HChange V8_FINAL : public HUnaryOperation { |
set_representation(to); |
SetFlag(kUseGVN); |
SetFlag(kCanOverflow); |
- if (is_truncating_to_smi) { |
+ if (is_truncating_to_smi && to.IsSmi()) { |
SetFlag(kTruncatingToSmi); |
SetFlag(kTruncatingToInt32); |
} |