Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index c6bf71d8356d58b1020128c10cbcc8009de984de..b7866c6837f13736d199be7198f0d916da623ec7 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -1944,7 +1944,7 @@ class HJSArrayLength: public HTemplateInstruction<2> { |
// object. It is guaranteed to be 32 bit integer, but it can be |
// represented as either a smi or heap number. |
SetOperandAt(0, value); |
- SetOperandAt(1, typecheck); |
+ SetOperandAt(1, typecheck != NULL ? typecheck : value); |
Jakob Kummerow
2012/12/11 14:05:54
I could swear I've reviewed this change before...
danno
2012/12/12 00:36:03
Landed the other patch first, rebased on it.
On 20
|
set_representation(Representation::Tagged()); |
SetFlag(kUseGVN); |
SetGVNFlag(kDependsOnArrayLengths); |
@@ -1958,7 +1958,11 @@ class HJSArrayLength: public HTemplateInstruction<2> { |
virtual void PrintDataTo(StringStream* stream); |
HValue* value() { return OperandAt(0); } |
- HValue* typecheck() { return OperandAt(1); } |
+ HValue* typecheck() { |
+ ASSERT(HasTypeCheck()); |
+ return OperandAt(1); |
+ } |
+ bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); } |
DECLARE_CONCRETE_INSTRUCTION(JSArrayLength) |
@@ -2159,14 +2163,18 @@ class HLoadElements: public HTemplateInstruction<2> { |
public: |
HLoadElements(HValue* value, HValue* typecheck) { |
SetOperandAt(0, value); |
- SetOperandAt(1, typecheck); |
+ SetOperandAt(1, typecheck != NULL ? typecheck : value); |
set_representation(Representation::Tagged()); |
SetFlag(kUseGVN); |
SetGVNFlag(kDependsOnElementsPointer); |
} |
HValue* value() { return OperandAt(0); } |
- HValue* typecheck() { return OperandAt(1); } |
+ HValue* typecheck() { |
+ ASSERT(HasTypeCheck()); |
+ return OperandAt(1); |
+ } |
+ bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); } |
virtual void PrintDataTo(StringStream* stream); |
@@ -4387,7 +4395,7 @@ class HLoadKeyed |
bit_field_ = ElementsKindField::encode(elements_kind); |
SetOperandAt(0, obj); |
SetOperandAt(1, HBoundsCheck::ExtractUncheckedIndex(checked_key)); |
- SetOperandAt(2, dependency); |
+ SetOperandAt(2, dependency != NULL ? dependency : obj); |
SetOperandAt(3, checked_key); |
if (!is_external()) { |
@@ -4429,7 +4437,11 @@ class HLoadKeyed |
} |
HValue* elements() { return OperandAt(0); } |
HValue* key() { return OperandAt(1); } |
- HValue* dependency() { return OperandAt(2); } |
+ HValue* dependency() { |
+ ASSERT(HasDependency()); |
+ return OperandAt(2); |
+ } |
+ bool HasDependency() const { return OperandAt(0) != OperandAt(2); } |
HValue* checked_key() { return OperandAt(3); } |
uint32_t index_offset() { return IndexOffsetField::decode(bit_field_); } |
void SetIndexOffset(uint32_t index_offset) { |