0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

28 commits

Author SHA1 Message Date
Bert Belder
8999517421
core,cli: fix clippy warnings 2019-05-03 03:29:42 +02: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
Kevin (Kun) "Kassimo" Qian
7237e9d34a fs: add Deno.utime/Deno.utimeSync (#2241) 2019-05-01 05:08:11 -04:00
Kitson Kelly
1a0f53a807 Add support for custom tsconfig.json (#2089)
Use `--config`
2019-04-29 07:58:31 -07:00
Kevin (Kun) "Kassimo" Qian
1d4b92ac85 Add Deno.kill(pid, signo) and process.kill(signo) (Unix only) (#2177) 2019-04-21 21:26:56 -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
Bert Belder
4ffe1612ff Silence clippy warnings and format source code 2019-04-09 20:05:47 +02: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
Ryan Dahl
2debbdacb9
Merge Worker and Isolate types (#2078)
Reduces generics.
2019-04-08 17:10:00 -04:00
Vincent LE GOFF
734cf781c6 Allow high precision performance.now() (#1977) 2019-04-08 16:22:40 -04:00
Ryan Dahl
f7fdb90fd5
core: snapshot improvements (#2052)
* Moves how snapshots are supplied to the Isolate. Previously they were
  given by Behavior::startup_data() but it was only called once at
  startup. It makes more sense (and simplifies Behavior) to pass it to the
  constructor of Isolate.
* Adds new libdeno type deno_snapshot instead of overloading
  deno_buf.
* Adds new libdeno method to delete snapshot deno_snapshot_delete().
* Renames deno_get_snapshot() to deno_snapshot_new().
* Makes StartupData hold references to snapshots. This was implicit when
  it previously held a deno_buf but is made explicit now. Note that
  include_bytes!() returns a &'static [u8] and we want to avoid
  copying that.
2019-04-08 10:12:43 -04:00
Kevin (Kun) "Kassimo" Qian
1746a3ac69 Add link/linkSync fs call for hardlinks (#2074) 2019-04-08 09:11:32 -04:00
Bert Belder
b735155712
Clippy fixes 2019-04-02 18:04:25 +02:00
andy finch
b0a23beb8f Add web worker JS API (#1993)
* Refactored the way worker polling is scheduled and errors are handled.
* Share the worker future as a Shared
2019-04-01 15:09:59 -04:00
Ryan Dahl
e9910d8ae5
Rename crate deno_core to deno (#2022) 2019-03-30 19:30:40 -04:00
Ryan Dahl
c25e262b04
Merge the --recompile and --reload flags (#2003) 2019-03-28 16:05:41 -04:00
Bartek Iwańczuk
597ee38ef2 Rewrite readFile and writeFile (#2000)
Using open/read/write
2019-03-27 23:29:36 -04:00
Kitson Kelly
c43cfedeba namespace reorg: libdeno and DenoCore to Deno.core (#1998) 2019-03-26 08:22:07 -04:00
andy finch
1499d57490 Remove dead code (#1983) 2019-03-21 15:52:30 -04:00
Ryan Dahl
94405bb617
Fix clippy errors and upgrade Rust to 1.33.0 in CI (#1945) 2019-03-20 18:55:52 -04:00
Ryan Dahl
4c831f1eb5
Add more async module loading function (#1974)
* get_source_code_async
* fetch_module_meta_data_async
* fetch_module_meta_data_and_maybe_compile_async
2019-03-20 11:38:43 -04:00
andy finch
48bf419669 Separate behavior for the compiler isolate (#1973) 2019-03-19 20:55:59 -04:00
andy finch
6131152a57 Remove old Buf definition in cli.rs (#1971) 2019-03-19 16:47:35 -04:00
Ryan Dahl
fa3c35301a
Rename //src/ to //cli/ (#1962)
To better distinguish the deno_core crate from the executable deno,
which will now be called "the cli" internally.
2019-03-19 12:18:05 -04:00
Renamed from src/ops.rs (Browse further)