Index: src/hydrogen-instructions.h |
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
index f741f292e8b1f0bf87591fc2c9dafb9e12c5bb78..cdb04c82e9aab218389ca855e2752e526dabcfd5 100644 |
--- a/src/hydrogen-instructions.h |
+++ b/src/hydrogen-instructions.h |
@@ -134,7 +134,6 @@ class LChunkBuilder; |
V(IsStringAndBranch) \ |
V(IsSmiAndBranch) \ |
V(IsUndetectableAndBranch) \ |
- V(JSArrayLength) \ |
V(LeaveInlined) \ |
V(LoadContextSlot) \ |
V(LoadElements) \ |
@@ -2392,45 +2391,6 @@ class HCallRuntime: public HCall<1> { |
}; |
-class HJSArrayLength: public HTemplateInstruction<2> { |
- public: |
- HJSArrayLength(HValue* value, HValue* typecheck, |
- HType type = HType::Tagged()) { |
- set_type(type); |
- // The length of an array is stored as a tagged value in the array |
- // 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 != NULL ? typecheck : value); |
- set_representation(Representation::Tagged()); |
- SetFlag(kUseGVN); |
- SetGVNFlag(kDependsOnArrayLengths); |
- SetGVNFlag(kDependsOnMaps); |
- } |
- |
- virtual Representation RequiredInputRepresentation(int index) { |
- return Representation::Tagged(); |
- } |
- |
- virtual void PrintDataTo(StringStream* stream); |
- |
- HValue* value() { return OperandAt(0); } |
- HValue* typecheck() { |
- ASSERT(HasTypeCheck()); |
- return OperandAt(1); |
- } |
- bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); } |
- |
- DECLARE_CONCRETE_INSTRUCTION(JSArrayLength) |
- |
- protected: |
- virtual bool DataEquals(HValue* other_raw) { return true; } |
- |
- private: |
- virtual bool IsDeletable() const { return true; } |
-}; |
- |
- |
class HFixedArrayBaseLength: public HUnaryOperation { |
public: |
explicit HFixedArrayBaseLength(HValue* value) : HUnaryOperation(value) { |
@@ -5200,6 +5160,13 @@ class HLoadNamedField: public HUnaryOperation { |
} |
} |
+ static HLoadNamedField* NewArrayLength(HValue* object, Zone* zone) { |
+ HLoadNamedField* result = new(zone) HLoadNamedField( |
+ object, true, JSArray::kLengthOffset); |
+ result->SetGVNFlag(kDependsOnArrayLengths); |
+ return result; |
+ } |
+ |
HValue* object() { return OperandAt(0); } |
bool is_in_object() const { return is_in_object_; } |
int offset() const { return offset_; } |