Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index c256a7cd9c6cb30c2f435cb93285103d96be3758..ceffd83a8022647a148236fcc59e69d533d22ab3 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -408,6 +408,7 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; |
| V(JS_ARRAY_TYPE) \ |
| V(JS_ARRAY_BUFFER_TYPE) \ |
| V(JS_TYPED_ARRAY_TYPE) \ |
| + V(JS_DATA_VIEW_TYPE) \ |
| V(JS_PROXY_TYPE) \ |
| V(JS_WEAK_MAP_TYPE) \ |
| V(JS_REGEXP_TYPE) \ |
| @@ -744,6 +745,7 @@ enum InstanceType { |
| JS_ARRAY_TYPE, |
| JS_ARRAY_BUFFER_TYPE, |
| JS_TYPED_ARRAY_TYPE, |
| + JS_DATA_VIEW_TYPE, |
| JS_SET_TYPE, |
| JS_MAP_TYPE, |
| JS_WEAK_MAP_TYPE, |
| @@ -993,7 +995,9 @@ class MaybeObject BASE_EMBEDDED { |
| V(Boolean) \ |
| V(JSArray) \ |
| V(JSArrayBuffer) \ |
| + V(JSArrayBufferView) \ |
|
rossberg
2013/06/21 08:44:01
Please add the new classes to the hierarchy commen
Dmitry Lomov (no reviews)
2013/06/21 11:32:10
Done.
|
| V(JSTypedArray) \ |
| + V(JSDataView) \ |
| V(JSProxy) \ |
| V(JSFunctionProxy) \ |
| V(JSSet) \ |
| @@ -8841,7 +8845,7 @@ class JSArrayBuffer: public JSObject { |
| }; |
| -class JSTypedArray: public JSObject { |
| +class JSArrayBufferView: public JSObject { |
| public: |
| // [buffer]: ArrayBuffer that this typed array views. |
| DECL_ACCESSORS(buffer, Object) |
| @@ -8852,12 +8856,33 @@ class JSTypedArray: public JSObject { |
| // [byte_length]: length of typed array in bytes. |
| DECL_ACCESSORS(byte_length, Object) |
| - // [length]: length of typed array in elements. |
| - DECL_ACCESSORS(length, Object) |
| - |
| // [weak_next]: linked list of typed arrays over the same array buffer. |
| DECL_ACCESSORS(weak_next, Object) |
| + // Casting. |
| + static inline JSArrayBufferView* cast(Object* obj); |
| + |
| + DECLARE_VERIFIER(JSArrayBufferView); |
| + |
| + static const int kBufferOffset = JSObject::kHeaderSize; |
| + static const int kByteOffsetOffset = kBufferOffset + kPointerSize; |
| + static const int kByteLengthOffset = kByteOffsetOffset + kPointerSize; |
| + static const int kWeakNextOffset = kByteLengthOffset + kPointerSize; |
| + static const int kViewSize = kWeakNextOffset + kPointerSize; |
| + |
| + protected: |
| + void NeuterView(); |
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBufferView); |
| +}; |
| + |
| + |
| +class JSTypedArray: public JSArrayBufferView { |
| + public: |
| + // [length]: length of typed array in elements. |
| + DECL_ACCESSORS(length, Object) |
| + |
| // Neutering. Only neuters this typed array. |
| void Neuter(); |
| @@ -8871,18 +8896,33 @@ class JSTypedArray: public JSObject { |
| DECLARE_PRINTER(JSTypedArray) |
| DECLARE_VERIFIER(JSTypedArray) |
| - static const int kBufferOffset = JSObject::kHeaderSize; |
| - static const int kByteOffsetOffset = kBufferOffset + kPointerSize; |
| - static const int kByteLengthOffset = kByteOffsetOffset + kPointerSize; |
| - static const int kLengthOffset = kByteLengthOffset + kPointerSize; |
| - static const int kWeakNextOffset = kLengthOffset + kPointerSize; |
| - static const int kSize = kWeakNextOffset + kPointerSize; |
| + static const int kLengthOffset = kViewSize + kPointerSize; |
| + static const int kSize = kLengthOffset + kPointerSize; |
| private: |
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSTypedArray); |
| }; |
| +class JSDataView: public JSArrayBufferView { |
| + public: |
| + // Only neuters this DataView |
| + void Neuter(); |
| + |
| + // Casting. |
| + static inline JSDataView* cast(Object* obj); |
| + |
| + // Dispatched behavior. |
| + DECLARE_PRINTER(JSDataView) |
| + DECLARE_VERIFIER(JSDataView) |
| + |
| + static const int kSize = kViewSize; |
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(JSDataView); |
| +}; |
| + |
| + |
| // Foreign describes objects pointing from JavaScript to C structures. |
| // Since they cannot contain references to JS HeapObjects they can be |
| // placed in old_data_space. |