From 0501330607b000e0913994e633b76410e1fd162c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 24 Oct 2018 02:17:10 -0400 Subject: Add libdeno.shared global shared ArrayBuffer. --- libdeno/internal.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libdeno/internal.h') diff --git a/libdeno/internal.h b/libdeno/internal.h index 6816debec..a996a0008 100644 --- a/libdeno/internal.h +++ b/libdeno/internal.h @@ -13,8 +13,9 @@ namespace deno { // deno_s = Wrapped Isolate. class DenoIsolate { public: - DenoIsolate(deno_buf snapshot, deno_recv_cb cb) + DenoIsolate(deno_buf snapshot, deno_recv_cb cb, deno_buf shared) : isolate_(nullptr), + shared_(shared), current_args_(nullptr), snapshot_creator_(nullptr), global_import_buf_ptr_(nullptr), @@ -31,6 +32,7 @@ class DenoIsolate { void AddIsolate(v8::Isolate* isolate); v8::Isolate* isolate_; + deno_buf shared_; const v8::FunctionCallbackInfo* current_args_; v8::SnapshotCreator* snapshot_creator_; void* global_import_buf_ptr_; @@ -48,6 +50,7 @@ class DenoIsolate { v8::Persistent promise_error_examiner_; v8::StartupData snapshot_; v8::Persistent global_import_buf_; + v8::Persistent shared_ab_; }; class UserDataScope { @@ -75,6 +78,8 @@ struct InternalFieldData { void Print(const v8::FunctionCallbackInfo& args); void Recv(const v8::FunctionCallbackInfo& args); void Send(const v8::FunctionCallbackInfo& args); +void Shared(v8::Local property, + const v8::PropertyCallbackInfo& info); void SetGlobalErrorHandler(const v8::FunctionCallbackInfo& args); void SetPromiseRejectHandler(const v8::FunctionCallbackInfo& args); void SetPromiseErrorExaminer(const v8::FunctionCallbackInfo& args); @@ -82,6 +87,7 @@ static intptr_t external_references[] = { reinterpret_cast(Print), reinterpret_cast(Recv), reinterpret_cast(Send), + reinterpret_cast(Shared), reinterpret_cast(SetGlobalErrorHandler), reinterpret_cast(SetPromiseRejectHandler), reinterpret_cast(SetPromiseErrorExaminer), -- cgit v1.2.3