Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index fefe0c1335d4d3b582272134e0fec3ac2469293d..a11ba70302056a1d624eccada824abff4e3f4a29 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -908,8 +908,8 @@ class HDeoptimize: public HControlInstruction { |
class HGoto: public HTemplateControlInstruction<1, 0> { |
public: |
explicit HGoto(HBasicBlock* target) { |
- SetSuccessorAt(0, target); |
- } |
+ SetSuccessorAt(0, target); |
+ } |
virtual Representation RequiredInputRepresentation(int index) const { |
return Representation::None(); |
@@ -3732,7 +3732,10 @@ class HStoreNamedGeneric: public HTemplateInstruction<3> { |
class HStoreKeyedFastElement: public HTemplateInstruction<3> { |
public: |
- HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val) { |
+ enum ValueType { VALUE_IS_SMI, GENERIC_VALUE }; |
+ HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val, |
+ ValueType value_type = GENERIC_VALUE) |
danno
2011/09/23 09:05:24
Why not just use ElementKind here?
Jakob Kummerow
2011/09/26 11:30:32
Done.
|
+ : value_type_(value_type) { |
SetOperandAt(0, obj); |
SetOperandAt(1, key); |
SetOperandAt(2, val); |
@@ -3749,14 +3752,24 @@ class HStoreKeyedFastElement: public HTemplateInstruction<3> { |
HValue* object() { return OperandAt(0); } |
HValue* key() { return OperandAt(1); } |
HValue* value() { return OperandAt(2); } |
+ bool value_is_smi() { |
+ return value_type_ == VALUE_IS_SMI; |
+ } |
bool NeedsWriteBarrier() { |
- return StoringValueNeedsWriteBarrier(value()); |
+ if (value_is_smi()) { |
+ return false; |
+ } else { |
+ return StoringValueNeedsWriteBarrier(value()); |
+ } |
} |
virtual void PrintDataTo(StringStream* stream); |
DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement) |
+ |
+ private: |
+ ValueType value_type_; |
}; |