Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index fae20831746354eda611664a88b04013497a7224..dcc6957f34703b7f9332c1def62c4b710a20b319 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -57,6 +57,7 @@ |
| // - JSObject |
| // - JSArray |
| // - JSArrayBuffer |
| +// - JSTypedArray |
| // - JSSet |
| // - JSMap |
| // - JSWeakMap |
| @@ -401,6 +402,7 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; |
| V(JS_GLOBAL_PROXY_TYPE) \ |
| V(JS_ARRAY_TYPE) \ |
| V(JS_ARRAY_BUFFER_TYPE) \ |
| + V(JS_TYPED_ARRAY_TYPE) \ |
| V(JS_PROXY_TYPE) \ |
| V(JS_WEAK_MAP_TYPE) \ |
| V(JS_REGEXP_TYPE) \ |
| @@ -732,6 +734,7 @@ enum InstanceType { |
| JS_GLOBAL_PROXY_TYPE, |
| JS_ARRAY_TYPE, |
| JS_ARRAY_BUFFER_TYPE, |
| + JS_TYPED_ARRAY_TYPE, |
| JS_SET_TYPE, |
| JS_MAP_TYPE, |
| JS_WEAK_MAP_TYPE, |
| @@ -978,6 +981,7 @@ class MaybeObject BASE_EMBEDDED { |
| V(Boolean) \ |
| V(JSArray) \ |
| V(JSArrayBuffer) \ |
| + V(JSTypedArray) \ |
| V(JSProxy) \ |
| V(JSFunctionProxy) \ |
| V(JSSet) \ |
| @@ -8521,6 +8525,38 @@ class JSArrayBuffer: public JSObject { |
| }; |
| +class JSTypedArray: public JSObject { |
| + public: |
| + // [buffer]: ArrayBuffer that this typed array views. |
| + DECL_ACCESSORS(buffer, Object) |
| + |
| + // [byte_length]: offset of typed array in bytes. |
| + DECL_ACCESSORS(byte_offset, Object) |
| + |
| + // [byte_length]: length of typed array in bytes. |
| + DECL_ACCESSORS(byte_length, Object) |
| + |
| + // [length]: lenght of typed array in elements. |
|
rossberg
2013/04/15 13:11:03
Typo: s/lenght/length/
Dmitry Lomov (no reviews)
2013/04/15 15:40:58
Done.
|
| + DECL_ACCESSORS(length, Object) |
| + |
| + // Casting. |
| + static inline JSTypedArray* cast(Object* obj); |
| + |
| + // Dispatched behavior. |
| + 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 kSize = kLengthOffset + kPointerSize; |
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(JSTypedArray); |
| +}; |
| + |
| + |
| // 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. |