Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1857)

Unified Diff: src/objects.h

Issue 1069883002: WIP SharedArrayBuffer implementation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/factory.h ('K') | « src/macros.py ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 7ba625442369de1f1f0dd57ac262c03196c90bae..beba791f5cfbec8af27f5af19450a3b8df6975a5 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -444,6 +444,8 @@ const int kStubMinorKeyBits = kSmiValueSize - kStubMajorKeyBits - 1;
V(JS_ARRAY_BUFFER_TYPE) \
V(JS_TYPED_ARRAY_TYPE) \
V(JS_DATA_VIEW_TYPE) \
+ V(JS_SHARED_ARRAY_BUFFER_TYPE) \
+ V(JS_SHARED_TYPED_ARRAY_TYPE) \
V(JS_PROXY_TYPE) \
V(JS_SET_TYPE) \
V(JS_MAP_TYPE) \
@@ -745,6 +747,8 @@ enum InstanceType {
JS_ARRAY_BUFFER_TYPE,
JS_TYPED_ARRAY_TYPE,
JS_DATA_VIEW_TYPE,
+ JS_SHARED_ARRAY_BUFFER_TYPE,
+ JS_SHARED_TYPED_ARRAY_TYPE,
JS_SET_TYPE,
JS_MAP_TYPE,
JS_SET_ITERATOR_TYPE,
@@ -10225,6 +10229,9 @@ class JSArrayBuffer: public JSObject {
inline bool is_neuterable();
inline void set_is_neuterable(bool value);
+ inline bool is_shared();
+ inline void set_is_shared(bool value);
+
// [weak_next]: linked list of array buffers.
DECL_ACCESSORS(weak_next, Object)
@@ -10255,6 +10262,7 @@ class JSArrayBuffer: public JSObject {
static const int kIsExternalBit = 0;
static const int kShouldBeFreed = 1;
static const int kIsNeuterableBit = 2;
+ static const int kIsSharedBit = 3;
Jarin 2015/04/16 14:55:28 Why do you need the bit? Cannot you get the shared
binji 2015/04/16 21:00:34 Do you mean from the ExternalArrayType? I currentl
Jarin 2015/04/17 07:49:27 I was just wondering why you could not define is_s
binji 2015/04/17 09:06:44 Thanks, that works. I knew I was missing something
DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer);
};
@@ -10297,6 +10305,11 @@ class JSTypedArray: public JSArrayBufferView {
// [length]: length of typed array in elements.
DECL_ACCESSORS(length, Object)
+ // TODO(binji): How to make this a flags array and access it via hydrogen?
+ // See hydrogen.cc:HOptimizedGraphBuilder::GenerateTypedArrayInitialize
+ // [is_shared]
+ DECL_BOOLEAN_ACCESSORS(is_shared)
+
// Neutering. Only neuters this typed array.
void Neuter();
@@ -10312,7 +10325,8 @@ class JSTypedArray: public JSArrayBufferView {
DECLARE_VERIFIER(JSTypedArray)
static const int kLengthOffset = kViewSize + kPointerSize;
- static const int kSize = kLengthOffset + kPointerSize;
+ static const int kIsSharedOffset = kLengthOffset + kPointerSize;
Jarin 2015/04/16 14:55:28 Again, why do you need the shared flag? Don't you
binji 2015/04/16 21:00:34 see above
+ static const int kSize = kIsSharedOffset + kPointerSize;
static const int kSizeWithInternalFields =
kSize + v8::ArrayBufferView::kInternalFieldCount * kPointerSize;
« src/factory.h ('K') | « src/macros.py ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698