diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-06-13 15:01:21 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-13 15:01:21 +0200 |
commit | 5c7ba22f2242930ad09f011eaea12a59153e294f (patch) | |
tree | 6edb4e52147fe81b76e340028fa9cc67e4f058e7 /deno2/deno_internal.h | |
parent | 69868c2b0e4372e6d7e49821caca41d372686eea (diff) | |
parent | bb6222c91872695cbe98aa2a75166265f52cec2e (diff) |
Merge branch 'deno2'
Diffstat (limited to 'deno2/deno_internal.h')
-rw-r--r-- | deno2/deno_internal.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/deno2/deno_internal.h b/deno2/deno_internal.h new file mode 100644 index 000000000..82c537582 --- /dev/null +++ b/deno2/deno_internal.h @@ -0,0 +1,44 @@ +// Copyright 2018 Ryan Dahl <ry@tinyclouds.org> +// All rights reserved. MIT License. +#ifndef DENO_INTERNAL_H_ +#define DENO_INTERNAL_H_ + +#include <string> +#include "include/deno.h" +#include "v8/include/v8.h" + +extern "C" { +// deno_s = Wrapped Isolate. +struct deno_s { + v8::Isolate* isolate; + std::string last_exception; + v8::Persistent<v8::Function> sub; + v8::Persistent<v8::Context> context; + deno_sub_cb cb; + void* data; +}; +} + +namespace deno { + +struct InternalFieldData { + uint32_t data; +}; + +void Print(const v8::FunctionCallbackInfo<v8::Value>& args); +void Sub(const v8::FunctionCallbackInfo<v8::Value>& args); +void Pub(const v8::FunctionCallbackInfo<v8::Value>& args); +static intptr_t external_references[] = {reinterpret_cast<intptr_t>(Print), + reinterpret_cast<intptr_t>(Sub), + reinterpret_cast<intptr_t>(Pub), 0}; + +Deno* NewFromSnapshot(void* data, deno_sub_cb cb); + +v8::StartupData MakeSnapshot(v8::StartupData* prev_natives_blob, + v8::StartupData* prev_snapshot_blob, + const char* js_filename, const char* js_source); + +void AddIsolate(Deno* d, v8::Isolate* isolate); + +} // namespace deno +#endif // DENO_INTERNAL_H_ |