Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index 7d3b879fb90bf79d46f47d07ca3b543aff71fc13..ca1e21e0cf3a2a7c210f40cb4e4d2b4ad2ec3f14 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -3881,16 +3881,21 @@ class HBitwiseBinaryOperation : public HBinaryOperation { |
SetFlag(kTruncatingToInt32); |
SetFlag(kAllowUndefinedAsNaN); |
SetAllSideEffects(); |
+ if (left->IsForceRepresentation()) { |
Sven Panne
2013/09/16 13:38:09
Why do we propagate back only to HForceRepresentat
oliv
2013/09/16 15:44:43
It is actually even wrong in the general case, sor
|
+ left->SetFlag(kTruncatingToInt32); |
+ } |
+ if (right->IsForceRepresentation()) { |
+ right->SetFlag(kTruncatingToInt32); |
+ } |
} |
virtual void RepresentationChanged(Representation to) V8_OVERRIDE { |
- if (!to.IsTagged()) { |
- ASSERT(to.IsSmiOrInteger32()); |
- ClearAllSideEffects(); |
- SetFlag(kUseGVN); |
- } else { |
+ if (to.IsTagged()) { |
SetAllSideEffects(); |
ClearFlag(kUseGVN); |
+ } else { |
+ ClearAllSideEffects(); |
+ SetFlag(kUseGVN); |
} |
} |
@@ -4524,10 +4529,12 @@ class HMul V8_FINAL : public HArithmeticBinaryOperation { |
HValue* right); |
static HInstruction* NewImul(Zone* zone, |
- HValue* context, |
- HValue* left, |
- HValue* right) { |
- HMul* mul = new(zone) HMul(context, left, right); |
+ HValue* context, |
+ HValue* left, |
+ HValue* right) { |
+ HInstruction* instr = HMul::New(zone, context, left, right); |
+ if (!instr->IsMul()) return instr; |
+ HMul* mul = HMul::cast(instr); |
// TODO(mstarzinger): Prevent bailout on minus zero for imul. |
mul->AssumeRepresentation(Representation::Integer32()); |
mul->ClearFlag(HValue::kCanOverflow); |
@@ -6494,14 +6501,20 @@ class HStringAdd V8_FINAL : public HBinaryOperation { |
HStringAdd(HValue* context, HValue* left, HValue* right, StringAddFlags flags) |
: HBinaryOperation(context, left, right, HType::String()), flags_(flags) { |
set_representation(Representation::Tagged()); |
- SetFlag(kUseGVN); |
- SetGVNFlag(kDependsOnMaps); |
- SetGVNFlag(kChangesNewSpacePromotion); |
+ if (flags_ == STRING_ADD_CHECK_NONE) { |
+ SetFlag(kUseGVN); |
+ SetGVNFlag(kDependsOnMaps); |
+ SetGVNFlag(kChangesNewSpacePromotion); |
+ } else { |
+ SetAllSideEffects(); |
+ } |
} |
// No side-effects except possible allocation. |
// NOTE: this instruction _does not_ call ToString() on its inputs. |
- virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
+ virtual bool IsDeletable() const V8_OVERRIDE { |
+ return flags_ == STRING_ADD_CHECK_NONE; |
+ } |
const StringAddFlags flags_; |
}; |