Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 6fbfd15f388054854e9b39a25faac0ffa7456dfd..5d4b90a5bc5c4e70f1389d3bc7a1d01e6d088721 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -1718,7 +1718,9 @@ class HChange: public HUnaryOperation { |
ASSERT(!value->representation().Equals(to)); |
set_representation(to); |
SetFlag(kUseGVN); |
- if (deoptimize_on_undefined) SetFlag(kDeoptimizeOnUndefined); |
+ if (deoptimize_on_undefined || to.IsTagged()) { |
+ SetFlag(kDeoptimizeOnUndefined); |
+ } |
if (is_truncating) SetFlag(kTruncatingToInt32); |
if (value->representation().IsSmi() || value->type().IsSmi()) { |
set_type(HType::Smi()); |