summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-10-23 19:16:27 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-10-24 14:52:38 -0700
commit3438dbe3509da8e8674dd803e8ecdc92e30f7d61 (patch)
treeec54e076d3f38ee49d5ae601baa50ac8af2aad0d
parentd2df67e8221877a14b77d5e185367717afe503f8 (diff)
Remove deno_ns
-rw-r--r--BUILD.gn39
-rw-r--r--libdeno/from_filesystem.cc59
-rwxr-xr-xtools/test.py3
3 files changed, 4 insertions, 97 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 323dbcfa0..5dd7d3ca4 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -12,7 +12,6 @@ group("default") {
testonly = true
deps = [
":deno",
- ":deno_ns",
":hyper_hello",
":test_cc",
":test_rs",
@@ -128,18 +127,6 @@ rust_executable("deno") {
]
}
-# This target is for fast incremental development.
-# When modifying the javascript runtime, this target will not go through the
-# extra process of building a snapshot and instead load the bundle from disk.
-# ns = no snapshot
-rust_executable("deno_ns") {
- source_root = "src/main.rs"
- extern = main_extern
- deps = [
- ":libdeno_nosnapshot",
- ]
-}
-
rust_executable("hyper_hello") {
source_root = "tools/hyper_hello.rs"
extern = [
@@ -228,15 +215,16 @@ v8_source_set("deno_base_test") {
"libdeno/file_util_test.cc",
"libdeno/from_snapshot.cc",
"libdeno/libdeno_test.cc",
- ]
- inputs = [
- "$target_gen_dir/snapshot_libdeno_test.bin",
+ "libdeno/test.cc",
]
deps = [
":create_snapshot_libdeno_test",
":deno_base",
"//testing/gtest:gtest",
]
+ data = [
+ "$target_gen_dir/snapshot_libdeno_test.bin",
+ ]
defines = [ "LIBDENO_TEST" ]
configs = [ ":deno_config" ]
}
@@ -335,25 +323,6 @@ action("bundle_hash_h") {
}
}
-source_set("libdeno_nosnapshot") {
- bundle_outputs = get_target_outputs(":bundle")
- bundle_location = rebase_path(bundle_outputs[0], root_build_dir)
- bundle_map_location = rebase_path(bundle_outputs[1], root_build_dir)
- inputs = bundle_outputs
- sources = [
- "libdeno/from_filesystem.cc",
- ]
- deps = [
- ":bundle",
- ":deno_bindings",
- ]
- configs += [ ":deno_config" ]
- defines = [
- "BUNDLE_LOCATION=\"$bundle_location\"",
- "BUNDLE_MAP_LOCATION=\"$bundle_map_location\"",
- ]
-}
-
ts_flatbuffer("msg_ts") {
sources = [
"src/msg.fbs",
diff --git a/libdeno/from_filesystem.cc b/libdeno/from_filesystem.cc
deleted file mode 100644
index 6b9f5ca1f..000000000
--- a/libdeno/from_filesystem.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2018 the Deno authors. All rights reserved. MIT license.
-// This file is used to load the bundle at start for deno_ns.
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <string>
-
-#include "third_party/v8/include/v8.h"
-#include "third_party/v8/src/base/logging.h"
-
-#include "deno.h"
-#include "file_util.h"
-#include "internal.h"
-
-namespace deno {
-
-Deno* NewFromFileSystem(deno_recv_cb cb) {
- std::string exe_path;
- CHECK(deno::ExePath(&exe_path));
- std::string exe_dir = deno::Dirname(exe_path); // Always ends with a slash.
-
- std::string js_source_path = exe_dir + BUNDLE_LOCATION;
- std::string js_source;
- CHECK(deno::ReadFileToString(js_source_path.c_str(), &js_source));
-
- std::string js_source_map_path = exe_dir + BUNDLE_MAP_LOCATION;
- std::string js_source_map;
- CHECK(deno::ReadFileToString(js_source_map_path.c_str(), &js_source_map));
-
- Deno* d = new Deno;
- d->currentArgs = nullptr;
- d->cb = cb;
- d->user_data = nullptr;
- v8::Isolate::CreateParams params;
- params.array_buffer_allocator =
- v8::ArrayBuffer::Allocator::NewDefaultAllocator();
- v8::Isolate* isolate = v8::Isolate::New(params);
- AddIsolate(d, isolate);
-
- v8::Locker locker(isolate);
- v8::Isolate::Scope isolate_scope(isolate);
- {
- v8::HandleScope handle_scope(isolate);
- auto context = v8::Context::New(isolate);
- // For source maps to work, the bundle location that is passed to
- // InitializeContext must be a relative path.
- InitializeContext(isolate, context, BUNDLE_LOCATION, js_source,
- &js_source_map);
- d->context.Reset(d->isolate, context);
- }
-
- return d;
-}
-
-} // namespace deno
-
-extern "C" {
-Deno* deno_new(deno_recv_cb cb) { return deno::NewFromFileSystem(cb); }
-}
diff --git a/tools/test.py b/tools/test.py
index 2212cd191..fb0544256 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -42,8 +42,6 @@ def main(argv):
deno_exe = os.path.join(build_dir, "deno" + executable_suffix)
check_exists(deno_exe)
- deno_ns_exe = os.path.join(build_dir, "deno_ns" + executable_suffix)
- check_exists(deno_ns_exe)
# Internal tools testing
setup_test()
@@ -61,7 +59,6 @@ def main(argv):
unit_tests(deno_exe)
check_output_test(deno_exe)
- check_output_test(deno_ns_exe)
rmtree(deno_dir)