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

Unified Diff: src/api.h

Issue 1069883002: WIP SharedArrayBuffer implementation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge master Created 5 years, 7 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
« no previous file with comments | « src/accessors.cc ('k') | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.h
diff --git a/src/api.h b/src/api.h
index 38bb9200364a88061fd77bf22e274b2227cef506..b0991b6db5ac3a64736838853ffb52df2ba1a0e8 100644
--- a/src/api.h
+++ b/src/api.h
@@ -159,6 +159,17 @@ class RegisteredExtension {
V(Float32Array, JSTypedArray) \
V(Float64Array, JSTypedArray) \
V(DataView, JSDataView) \
+ V(SharedArrayBuffer, JSArrayBuffer) \
+ V(SharedTypedArray, JSTypedArray) \
+ V(SharedUint8Array, JSTypedArray) \
+ V(SharedUint8ClampedArray, JSTypedArray) \
+ V(SharedInt8Array, JSTypedArray) \
+ V(SharedUint16Array, JSTypedArray) \
+ V(SharedInt16Array, JSTypedArray) \
+ V(SharedUint32Array, JSTypedArray) \
+ V(SharedInt32Array, JSTypedArray) \
+ V(SharedFloat32Array, JSTypedArray) \
+ V(SharedFloat64Array, JSTypedArray) \
V(Name, Name) \
V(String, String) \
V(Symbol, Symbol) \
@@ -230,6 +241,29 @@ class Utils {
static inline Local<Float64Array> ToLocalFloat64Array(
v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedArrayBuffer> ToLocalShared(
+ v8::internal::Handle<v8::internal::JSArrayBuffer> obj);
+ static inline Local<SharedTypedArray> ToLocalShared(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedUint8Array> ToLocalSharedUint8Array(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedUint8ClampedArray> ToLocalSharedUint8ClampedArray(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedInt8Array> ToLocalSharedInt8Array(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedUint16Array> ToLocalSharedUint16Array(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedInt16Array> ToLocalSharedInt16Array(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedUint32Array> ToLocalSharedUint32Array(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedInt32Array> ToLocalSharedInt32Array(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedFloat32Array> ToLocalSharedFloat32Array(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+ static inline Local<SharedFloat64Array> ToLocalSharedFloat64Array(
+ v8::internal::Handle<v8::internal::JSTypedArray> obj);
+
static inline Local<Message> MessageToLocal(
v8::internal::Handle<v8::internal::Object> obj);
static inline Local<Promise> PromiseToLocal(
@@ -347,6 +381,14 @@ inline bool ToLocal(v8::internal::MaybeHandle<v8::internal::Object> maybe,
}
+#define MAKE_TO_LOCAL_SHARED_TYPED_ARRAY(Type, typeName, TYPE, ctype, size) \
+ Local<v8::Shared##Type##Array> Utils::ToLocalShared##Type##Array( \
+ v8::internal::Handle<v8::internal::JSTypedArray> obj) { \
+ DCHECK(obj->type() == v8::internal::kExternal##Type##Array); \
+ return Convert<v8::internal::JSTypedArray, v8::Shared##Type##Array>(obj); \
+ }
+
+
MAKE_TO_LOCAL(ToLocal, Context, Context)
MAKE_TO_LOCAL(ToLocal, Object, Value)
MAKE_TO_LOCAL(ToLocal, JSFunction, Function)
@@ -361,7 +403,11 @@ MAKE_TO_LOCAL(ToLocal, JSArrayBufferView, ArrayBufferView)
MAKE_TO_LOCAL(ToLocal, JSDataView, DataView)
MAKE_TO_LOCAL(ToLocal, JSTypedArray, TypedArray)
+MAKE_TO_LOCAL(ToLocalShared, JSArrayBuffer, SharedArrayBuffer)
+MAKE_TO_LOCAL(ToLocalShared, JSTypedArray, SharedTypedArray)
+
TYPED_ARRAYS(MAKE_TO_LOCAL_TYPED_ARRAY)
+TYPED_ARRAYS(MAKE_TO_LOCAL_SHARED_TYPED_ARRAY)
MAKE_TO_LOCAL(ToLocal, FunctionTemplateInfo, FunctionTemplate)
MAKE_TO_LOCAL(ToLocal, ObjectTemplateInfo, ObjectTemplate)
« no previous file with comments | « src/accessors.cc ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698