From 3b595253a2e9f8badc416f85d0b09bf48f344634 Mon Sep 17 00:00:00 2001 From: Tristan Marion Date: Fri, 22 Jun 2018 15:30:35 +0200 Subject: Move `deno2` folder to `src` (#277) --- src/deno_internal.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/deno_internal.h (limited to 'src/deno_internal.h') diff --git a/src/deno_internal.h b/src/deno_internal.h new file mode 100644 index 000000000..e0a4c34a4 --- /dev/null +++ b/src/deno_internal.h @@ -0,0 +1,44 @@ +// Copyright 2018 Ryan Dahl +// All rights reserved. MIT License. +#ifndef DENO_INTERNAL_H_ +#define DENO_INTERNAL_H_ + +#include +#include "include/deno.h" +#include "v8/include/v8.h" + +extern "C" { +// deno_s = Wrapped Isolate. +struct deno_s { + v8::Isolate* isolate; + const v8::FunctionCallbackInfo* currentArgs; + std::string last_exception; + v8::Persistent sub; + v8::Persistent context; + deno_sub_cb cb; + void* data; +}; +} + +namespace deno { + +struct InternalFieldData { + uint32_t data; +}; + +void Print(const v8::FunctionCallbackInfo& args); +void Sub(const v8::FunctionCallbackInfo& args); +void Pub(const v8::FunctionCallbackInfo& args); +static intptr_t external_references[] = {reinterpret_cast(Print), + reinterpret_cast(Sub), + reinterpret_cast(Pub), 0}; + +Deno* NewFromSnapshot(void* data, deno_sub_cb cb); + +void InitializeContext(v8::Isolate* isolate, v8::Local context, + const char* js_filename, const char* js_source); + +void AddIsolate(Deno* d, v8::Isolate* isolate); + +} // namespace deno +#endif // DENO_INTERNAL_H_ -- cgit v1.2.3