Commit graph

22 commits

Author SHA1 Message Date
Bartek Iwańczuk bca5cc5041 Move ModuleSpecifier to //core (#2509) 2019-06-12 16:55:59 -07:00
Bartek Iwańczuk b3c4307d02 Refactor module resolving (#2493)
Adds ModuleSpecifier, which wraps a URL. This is now passed around instead of
specifier and resolver strings.
2019-06-12 12:00:08 -07:00
Gurwinder S 7fc3d5ed8b Removed unused method and update docs (#2499) 2019-06-11 16:09:31 -04:00
Ryan Dahl de8c85f8f2
Move Modules to ThreadSafeState (#2498) 2019-06-11 14:35:03 -04:00
Matt Harrison d82c1991cf Add --seed for setting RNG seed (#2483) 2019-06-11 10:34:39 -04:00
Bartek Iwańczuk a115340288 feat: Import maps (#2360) 2019-06-09 09:08:20 -04:00
Kitson Kelly 307e092753 Add 'bundle' subcommand. (#2467) 2019-06-08 14:42:28 -04:00
gurv-s 35f879ad32 Remove tokio_util::block_on dep in compile_async and other cleanup 2019-06-08 10:59:20 -04:00
Kitson Kelly e3b2205eba Cleanup compiler API (#2466) 2019-06-06 20:37:26 -04:00
Ryan Dahl e152dae006
RecursiveLoad shouldn't own the Isolate (#2453)
This patch makes it so that RecursiveLoad doesn't own the Isolate, so
Worker::execute_mod_async does not consume itself.

Previously Worker implemented Loader, but now ThreadSafeState does.

This is necessary preparation work for dynamic import (#1789) and import
maps (#1921)
2019-06-05 16:35:38 -04:00
Ryan Dahl 856c44213b TS compiler refactor
* Compiler no longer has its own Tokio runtime. Compiler handles one
  message and then exits.

* Uses the simpler ts.CompilerHost interface instead of
  ts.LanguageServiceHost.

* avoids recompiling the same module by introducing a hacky but simple
  `hashset<string>` that stores the module names that have been already
  compiled.

* Removes the CompilerConfig op.

* Removes a lot of the mocking stuff in compiler.ts like `this._ts`. It
  is not useful as we don't even have tests.

* Turns off checkJs because it causes fmt_test to die with OOM.
2019-05-29 07:53:39 -04:00
Ryan Dahl aba952397a
Add progress bar (#2309) 2019-05-11 10:23:19 -04:00
andy finch 2edee3367d First pass at permissions whitelist (#2129) 2019-05-08 19:20:30 -04:00
Ryan Dahl c171813e89
core: express op as enum (#2255) 2019-05-01 18:22:32 -04:00
Bert Belder 41c7e96f1a
Refactor zero-copy buffers for performance and to prevent memory leaks
* In order to prevent ArrayBuffers from getting garbage collected by V8,
  we used to store a v8::Persistent<ArrayBuffer> in a map. This patch
  introduces a custom ArrayBuffer allocator which doesn't use Persistent
  handles, but instead stores a pointer to the actual ArrayBuffer data
  alongside with a reference count. Since creating Persistent handles
  has quite a bit of overhead, this change significantly increases
  performance. Various HTTP server benchmarks report about 5-10% more
  requests per second than before.

* Previously the Persistent handle that prevented garbage collection had
  to be released manually, and this wasn't always done, which was
  causing memory leaks. This has been resolved by introducing a new
  `PinnedBuf` type in both Rust and C++ that automatically re-enables
  garbage collection when it goes out of scope.

* Zero-copy buffers are now correctly wrapped in an Option if there is a
  possibility that they're not present. This clears up a correctness
  issue where we were creating zero-length slices from a null pointer,
  which is against the rules.
2019-05-01 21:11:09 +02:00
Kitson Kelly 1a0f53a807 Add support for custom tsconfig.json (#2089)
Use `--config`
2019-04-29 07:58:31 -07:00
Ryan Dahl d68b44b6b2
core: make Isolate concrete, remove Dispatch trait (#2183)
Op dispatch is now dynamically dispatched, so slightly less efficient.
The immeasurable perf hit is a reasonable trade for the API simplicity
that is gained here.
2019-04-23 18:58:00 -04:00
Bartek Iwańczuk cd19da62d9 Refactor CLI entry point (#2157)
Changes "deno --types" to "deno types"
and "deno --prefetch" to "deno prefetch"
2019-04-21 11:34:18 -04:00
Bert Belder 8477daa8b9
Fix clippy warnings 2019-04-17 15:35:46 +02:00
Ryan Dahl 1bfb443369
Implement async module loading in CLI (#2084) 2019-04-16 15:13:42 -04:00
andy finch 960ee5257a Improve op dispatch (#2088) 2019-04-11 10:58:31 -04:00
Ryan Dahl d2579f4564
core: Rename Behavior to Dispatch (#2082)
And rename IsolateState to ThreadSafeState.

Also make ThreadSafeState directly implement Dispatch. This is simpler.
2019-04-09 13:11:25 -04:00
Renamed from cli/isolate_state.rs (Browse further)