Chromium Code Reviews| Index: src/hydrogen-instructions.h |
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h |
| index 73c1d7d3a2990ebec5b62767e1541609df03a127..e2968a1730c6111cb0e67f02a40e72357de76b26 100644 |
| --- a/src/hydrogen-instructions.h |
| +++ b/src/hydrogen-instructions.h |
| @@ -4755,8 +4755,9 @@ class HAdd V8_FINAL : public HArithmeticBinaryOperation { |
| // Add is only commutative if two integer values are added and not if two |
| // tagged values are added (because it might be a String concatenation). |
| + // We also do not commute (pointer + offset). |
| virtual bool IsCommutative() const V8_OVERRIDE { |
| - return !representation().IsTagged(); |
| + return !representation().IsTagged() && !representation().IsExternal(); |
| } |
| virtual HValue* EnsureAndPropagateNotMinusZero( |
| @@ -4792,6 +4793,10 @@ class HAdd V8_FINAL : public HArithmeticBinaryOperation { |
| } |
| } |
| + virtual Representation RepresentationFromInputs() V8_OVERRIDE; |
| + |
| + virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE; |
| + |
| DECLARE_CONCRETE_INSTRUCTION(Add) |
| protected: |
| @@ -6085,6 +6090,43 @@ class HObjectAccess V8_FINAL { |
| // Create an access for the payload of a Cell or JSGlobalPropertyCell. |
| static HObjectAccess ForCellPayload(Isolate* isolate); |
| + static HObjectAccess ForJSTypedArrayLength() { |
| + return HObjectAccess::ForJSObjectOffset(JSTypedArray::kLengthOffset); |
| + } |
| + |
| + static HObjectAccess ForJSArrayBufferBackingStore() { |
| + return HObjectAccess::ForJSObjectOffset( |
| + JSArrayBuffer::kBackingStoreOffset, Representation::External()); |
| + } |
| + |
| + static HObjectAccess ForExternalArrayExternalPointer() { |
| + return HObjectAccess::ForJSObjectOffset( |
| + ExternalArray::kExternalPointerOffset, Representation::External()); |
| + } |
| + |
| + |
|
danno
2013/11/25 11:44:13
nit: perhaps only one line between functions
|
| + static HObjectAccess ForJSArrayBufferViewWeakNext() { |
| + return HObjectAccess::ForJSObjectOffset(JSArrayBufferView::kWeakNextOffset); |
| + } |
| + |
| + static HObjectAccess ForJSArrayBufferWeakFirstView() { |
| + return HObjectAccess::ForJSObjectOffset( |
| + JSArrayBuffer::kWeakFirstViewOffset); |
| + } |
| + |
| + static HObjectAccess ForJSArrayBufferViewBuffer() { |
| + return HObjectAccess::ForJSObjectOffset(JSArrayBufferView::kBufferOffset); |
| + } |
| + |
| + static HObjectAccess ForJSArrayBufferViewByteOffset() { |
| + return HObjectAccess::ForJSObjectOffset( |
| + JSArrayBufferView::kByteOffsetOffset); |
| + } |
| + |
| + static HObjectAccess ForJSArrayBufferViewByteLength() { |
| + return HObjectAccess::ForJSObjectOffset( |
| + JSArrayBufferView::kByteLengthOffset); |
| + } |
| void PrintTo(StringStream* stream); |
|
danno
2013/11/25 11:44:13
nit: perhaps one line above?
|
| inline bool Equals(HObjectAccess that) const { |
| @@ -6501,6 +6543,8 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> { |
| } else if (field_representation().IsDouble() || |
| field_representation().IsSmi()) { |
| return field_representation(); |
| + } else if (field_representation().IsExternal()) { |
| + return Representation::External(); |
| } |
| } |
| return Representation::Tagged(); |