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

36 commits

Author SHA1 Message Date
Bartek Iwańczuk
2e74f164b6
refactor: deno_runtime crate (#8640)
This commit moves Deno JS runtime, ops, permissions and
inspector implementation to new "deno_runtime" crate located
in "runtime/" directory.

Details in "runtime/README.md".

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-12-13 19:45:53 +01:00
Steven Guerrero
43a35b005f
perf: use minimal op with performance.now() (#8619) 2020-12-07 08:27:25 -05:00
William Perron
943b0980c7
feat(cli/ops): add the sleep_sync op (#7974) 2020-10-15 21:06:31 -04:00
Bartek Iwańczuk
45d4fd44c9
refactor: move op state registration to workers (#7696) 2020-09-28 12:14:11 +02:00
Bartek Iwańczuk
dd1cd4d952
fix: clearing timers race condition (#7617) 2020-09-22 19:33:29 +02:00
Bartek Iwańczuk
92edc36442
refactor: use futures and serde_json from deno_core (#7614) 2020-09-21 18:36:37 +02:00
Bartek Iwańczuk
b657d743a2
refactor: remove CliState, use OpState, add CliModuleLoader (#7588)
- remove "CliState.workers" and "CliState.next_worker_id", instead
store them on "OpState" using type aliases.
- remove "CliState.global_timer" and "CliState.start_time", instead
store them on "OpState" using type aliases.
- remove "CliState.is_internal", instead pass it to Worker::new
- move "CliState::permissions" to "OpState"
- move "CliState::main_module" to "OpState"
- move "CliState::global_state" to "OpState"
- move "CliState::check_unstable()" to "GlobalState"
- change "cli_state()" to "global_state()"
- change "deno_core::ModuleLoader" trait to pass "OpState" to callbacks
- rename "CliState" to "CliModuleLoader"
2020-09-20 01:17:35 +02:00
Bartek Iwańczuk
f44522eac9
refactor: move fields from CliState to OpState (#7558)
- move rng to OpState
- move GlobalTimer to OpState
- move Metrics to OpState
2020-09-18 20:39:47 +02:00
Ryan Dahl
0cb64cef76 Remove unnecessary serde_derive dependency 2020-09-16 13:29:42 -04:00
Bert Belder
f5b40c918c
refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476) 2020-09-15 01:50:52 +02:00
Ryan Dahl
7c2e7c6608
Use gotham-like state for ops (#7385)
Provides a concrete state type that can be dynamically added. This is necessary for op crates.
* renames BasicState to OpState
* async ops take `Rc<RefCell<OpState>>`
* sync ops take `&mut OpState`
* removes `OpRegistry`, `OpRouter` traits
* `get_error_class_fn` moved to OpState
* ResourceTable moved to OpState
2020-09-10 09:57:45 -04:00
Bert Belder
c821e8f2f1
Move JSON ops to deno_core (#7336) 2020-09-06 02:34:02 +02:00
Bartek Iwańczuk
7e946858a4
refactor: migrate ops to new dispatch wrapper (#7118) 2020-08-28 17:08:24 +02:00
Bert Belder
9bfb0df805
refactor: remove OpError, use ErrBox everywhere (#7187)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-08-26 00:22:15 +02:00
Bert Belder
27f4aeb924
Make Rc/Arc wrapper around State/GlobalState visible (#7104) 2020-08-19 02:01:48 +02:00
Nayeem Rahman
015fa0bd41
refactor: permissions (#7074) 2020-08-18 16:29:32 -04:00
Valentin Anger
becbb56b19
feat(core): Ops can take several zero copy buffers (#4788) 2020-06-01 14:20:47 -04:00
Ryan Dahl
d8711155ca
Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
Kitson Kelly
f527407287
clippy (#4618) 2020-04-03 22:41:16 -04:00
Ryan Dahl
91b606aaae
Clean up how we use opIds (#4118) 2020-02-25 09:14:27 -05:00
Bartek Iwańczuk
4e1abb4f3a
refactor: use OpError instead of ErrBox for errors in ops (#4058)
To better reflect changes in error types in JS from #3662 this PR changes 
default error type used in ops from "ErrBox" to "OpError".

"OpError" is a type that can be sent over to JSON; it has all 
information needed to construct error in JavaScript. That
made "GetErrorKind" trait useless and so it was removed altogether.

To provide compatibility with previous use of "ErrBox" an implementation of
"From<ErrBox> for OpError" was added, however, it is an escape hatch and
ops implementors should strive to use "OpError" directly.
2020-02-23 14:51:29 -05:00
Bartek Iwańczuk
cdba5ab6fc refactor: rename ThreadSafeState, use RefCell for mutable state (#3931)
* rename ThreadSafeState to State
* State stores InnerState wrapped in Rc and RefCell
2020-02-08 20:34:31 +01:00
Ryan Dahl
161cf7cdfd
refactor: Use Tokio's single-threaded runtime (#3844)
This change simplifies how we execute V8. Previously V8 Isolates jumped
around threads every time they were woken up. This was overly complex and
potentially hurting performance in a myriad ways. Now isolates run on
their own dedicated thread and never move.

- blocking_json spawns a thread and does not use a thread pool
- op_host_poll_worker and op_host_resume_worker are non-operational
- removes Worker::get_message and Worker::post_message
- ThreadSafeState::workers table contains WorkerChannel entries instead
  of actual Worker instances.
- MainWorker and CompilerWorker are no longer Futures.
- The multi-threaded version of deno_core_http_bench was removed.
- AyncOps no longer need to be Send + Sync

This PR is very large and several tests were disabled to speed
integration:
- installer_test_local_module_run
- installer_test_remote_module_run
- _015_duplicate_parallel_import
- _026_workers
2020-02-03 18:08:44 -05:00
Ryan Dahl
5e32c5ea44
s/PinnedBuf/ZeroCopyBuf (#3782) 2020-01-24 15:10:49 -05:00
Ry Dahl
76e44ddfd0
Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600) 2020-01-05 11:56:18 -05:00
Ry Dahl
bfab4ed0df
Happy new year! (#3578) 2020-01-02 15:13:47 -05:00
Kevin (Kun) "Kassimo" Qian
bca23e6433 refactor: Elevate DenoPermissions lock to top level (#3398) 2019-11-24 10:42:30 -05:00
Bartek Iwańczuk
8f9a942cb9 Use futures 0.3 API (#3358) 2019-11-16 19:17:47 -05:00
Yoshiya Hinosawa
efd7e78af3 Use web standard Permissions API (#3200) 2019-10-27 11:22:53 -04:00
Ryan Dahl
97d8498d46
Add init methods for each op module (#3087) 2019-10-11 11:41:54 -07:00
Bert Belder
93b7acf99d
js: reschedule global timer if it fires earlier than expected (#2989)
When the global timer fires earlier than expected, which apparently
happens sometimes on server editions of Windows, we didn't call any
setTimeout callbacks, but we *also* didn't reschedule the global timer
to fire again later.

When this situation occurred it would make deno exit abruptly if there
were no other asynchronous ops running on the event loop. It could also
lead to application hangs if the upcoming setTimeout callback was
critical for the application to make progress.
2019-09-20 19:00:12 +02:00
Bartek Iwańczuk
520f9631e0 bring back json ops (#2815) 2019-08-26 08:50:21 -04:00
Ryan Dahl
2235dd795d
Revert json ops (#2814)
* Revert "port more ops to JSON (#2809)"

This reverts commit 137f33733d.

* Revert "port ops to JSON: compiler, errors, fetch, files (#2804)"

This reverts commit 79f82cf10e.

* Revert "Port rest of os ops to JSON (#2802)"

This reverts commit 5b2baa5c99.
2019-08-24 13:20:48 -07:00
Bartek Iwańczuk
137f33733d port more ops to JSON (#2809) 2019-08-24 08:31:14 -07:00
Ryan Dahl
bdc97b3976
Organize dispatch a bit (#2796)
Just some clean up reorganization around flatbuffer/minimal dispatch
code. This is prep for adding a JSON dispatcher.
2019-08-21 20:42:48 -04:00
Bartek Iwańczuk
e6c349af9f split up ops.rs (#2753)
Note cli/dispatch_minimal.rs ops are not yet included in cli/ops.

This is part of work towards #2730
2019-08-14 11:03:02 -04:00