Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index fae20831746354eda611664a88b04013497a7224..373e9c7b0f2d7e1f7921fe021b1d642cd04a7805 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]: length of typed array in elements. |
+ 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. |