summaryrefslogtreecommitdiff
path: root/libdeno/internal.h
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2018-08-19 16:44:10 +0900
committerRyan Dahl <ry@tinyclouds.org>2018-08-19 11:27:47 -0400
commitaaabc853e84a03f72208c0e80634bd986c3ca4e2 (patch)
tree24cb4daf07c7b52b9260e041289ab2e79f25f5a8 /libdeno/internal.h
parent146bc93b81ef1775a3a22784c74cbf0c8bbd1c9e (diff)
chore: move libdeno files to //libdeno/
Diffstat (limited to 'libdeno/internal.h')
-rw-r--r--libdeno/internal.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/libdeno/internal.h b/libdeno/internal.h
new file mode 100644
index 000000000..c63ba532a
--- /dev/null
+++ b/libdeno/internal.h
@@ -0,0 +1,44 @@
+// Copyright 2018 the Deno authors. All rights reserved. MIT license.
+#ifndef INTERNAL_H_
+#define INTERNAL_H_
+
+#include <string>
+#include "deno.h"
+#include "third_party/v8/include/v8.h"
+
+extern "C" {
+// deno_s = Wrapped Isolate.
+struct deno_s {
+ v8::Isolate* isolate;
+ const v8::FunctionCallbackInfo<v8::Value>* currentArgs;
+ std::string last_exception;
+ v8::Persistent<v8::Function> recv;
+ v8::Persistent<v8::Context> context;
+ deno_recv_cb cb;
+ void* data;
+};
+}
+
+namespace deno {
+
+struct InternalFieldData {
+ uint32_t data;
+};
+
+void Print(const v8::FunctionCallbackInfo<v8::Value>& args);
+void Recv(const v8::FunctionCallbackInfo<v8::Value>& args);
+void Send(const v8::FunctionCallbackInfo<v8::Value>& args);
+static intptr_t external_references[] = {reinterpret_cast<intptr_t>(Print),
+ reinterpret_cast<intptr_t>(Recv),
+ reinterpret_cast<intptr_t>(Send), 0};
+
+Deno* NewFromSnapshot(void* data, deno_recv_cb cb);
+
+void InitializeContext(v8::Isolate* isolate, v8::Local<v8::Context> context,
+ const char* js_filename, const std::string& js_source,
+ const std::string* source_map);
+
+void AddIsolate(Deno* d, v8::Isolate* isolate);
+
+} // namespace deno
+#endif // INTERNAL_H_