summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)Author
2022-09-02fix(repl): don't terminate on unhandled error events (#15548)Nayeem Rahman
2022-09-02chore: forward v1.25.1 release commit to main (#15735)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2022-09-01refactor(core): Move optional callbacks from `JsRuntimeState` to ↵Andreu Botella
`ContextState` (#15599) The `JsRuntimeState` struct stores a number of JS callbacks that are used either in the event loop or when interacting with V8. Some of these callback fields are vectors of callbacks, and therefore could plausibly store at least one callback per realm. However, some of those fields are `Option<v8::Global<v8::Function>>`, which would make the callbacks set by a realm override the one that might have been set by a different realm. As it turns out, all of the current such optional callbacks (`js_promise_reject_cb`, `js_format_exception_cb` and `js_wasm_streaming_cb`) are only used from inside a realm, and therefore this change makes it so such callbacks can only be set from inside a realm, and will only affect that realm.
2022-09-01fix(serde_v8): no panic on reading large text file (#15494)Geert-Jan Zwiers
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2022-09-01chore(serde_v8): take mutable reference in `ToV8::to_v8` (#15707)Divy Srivastava
2022-08-30perf: use fast api for `core.isProxy` (#15682)Divy Srivastava
2022-08-27perf(runtime): optimize allocations in read/write checks (#15631)Divy Srivastava
2022-08-25v1.25.0Bartek Iwańczuk
2022-08-23chore: upgrade rusty_v8 to v0.49.0 (#15547)Bartek Iwańczuk
2022-08-23refactor(core/runtime): clean up extra type cast (#15539)Geert-Jan Zwiers
2022-08-21fix: Free up JsRuntime state global handles before snapshot (#15491)Giovanny Gutiérrez
2022-08-21feat: `queueMicrotask()` error handling (#15522)Nayeem Rahman
Adds error event dispatching for queueMicrotask(). Consequently unhandled errors are now reported with Deno.core.terminate(), which is immune to the existing quirk with plainly thrown errors (#14158).
2022-08-21chore: use Rust 1.63.0 (#15464)Mathias Lafeldt
2022-08-21feat(ops): V8 Fast Calls (#15291)Divy Srivastava
2022-08-21fix(core/runtime): always cancel termination in exception handling (#15514)Nayeem Rahman
2022-08-18feat(ext/flash): An optimized http/1.1 server (#15405)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-08-15chore: upgrade rusty_v8 to 0.48.1 (#15310)Bartek Iwańczuk
2022-08-11chore: forward v1.24.3 release commit to main (#15462)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-08-11perf(ops): Monomorphic sync op calls (#15337)Aapo Alasuutari
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params). Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple: ``` opSync("op_foo", param1, param2); // -> turns to ops.op_foo(param1, param2); ``` This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path. Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-08-11refactor(core): unwrap sync ops in rust (#15449)Nayeem Rahman
2022-08-10feat(core): Add support for async ops in realms (#14734)Andreu Botella
Pull request #14019 enabled initial support for realms, but it did not include support for async ops anywhere other than the main realm. The main issue was that the `js_recv_cb` callback, which resolves promises corresponding to async ops, was only set for the main realm, so async ops in other realms would never resolve. Furthermore, promise ID's are specific to each realm, which meant that async ops from other realms would result in a wrong promise from the main realm being resolved. This change creates a `ContextState` struct, similar to `JsRuntimeState` but stored in a slot of each `v8::Context`, which contains a `js_recv_cb` callback for each realm. Combined with a new list of known realms, which stores them as `v8::Weak<v8::Context>`, and a change in the `#[op]` macro to pass the current context to `queue_async_op`, this makes it possible to send the results of promises for different realms to their realm, and prevent the ID's from getting mixed up. Additionally, since promise ID's are no longer unique to the isolate, having a single set of unrefed ops doesn't work. This change therefore also moves `unrefed_ops` from `JsRuntimeState` to `ContextState`, and adds the lengths of the unrefed op sets for all known realms to get the total number of unrefed ops to compare in the event loop. Co-authored-by: Luis Malheiro <luismalheiro@gmail.com>
2022-08-05chore: forward v1.24.2 release commit to main (#15410)denobot
2022-08-03core: remove heapStats type definition (#15393)Zach
2022-08-01refactor(core/error): use evaluated call sites for formatting (#15369)Nayeem Rahman
2022-07-31core: Add types for `Deno.core.print()` (#15283)Zicklag
2022-07-30fix(core): BorrowMutError in nested error (#15352)Bartek Iwańczuk
2022-07-29Forward 1.24.1 to main (#15333) (#15336)Colin Ihrig
1.24.1 (#15333) Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-07-28serde_v8: improvements to avoid hitting unimplemented codepaths (#13915)Arthur Silva
2022-07-27chore: upgrade rusty_v8 to 0.47.1 (#15324)Bartek Iwańczuk
2022-07-25refactor(core): remove unneeded ops for uncaughtException (#15296)Bartek Iwańczuk
2022-07-23fix: unhandledrejection handling for sync throw in top level (#15279)Bartek Iwańczuk
Fixes an edge in "unhandledrejection" event that prevent synchronous errors being surfaced when throw from a top-level scope.
2022-07-22Revert "feat(ops): V8 Fast Calls (#15122)" (#15276)Divy Srivastava
This reverts commit 03dc3b8972f460e40d0b75fc3207cae9fe4f60da.
2022-07-22feat(ops): V8 Fast Calls (#15122)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-07-211.24.0 (#15262)denobot
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-07-20Reland "feat: add "unhandledrejection" event support" (#15211)Bartek Iwańczuk
2022-07-19chore: upgrade rusty_v8 to 0.47.0 (#15247)Bartek Iwańczuk
2022-07-19feat: emit files on demand and fix racy emit (#15220)David Sherret
2022-07-18reland: "fix(core): unhandled rejection in top-level scope" (#15236)Bartek Iwańczuk
Reland #15204
2022-07-18feat: import.meta.resolve() (#15074)Bartek Iwańczuk
This commit adds new "import.meta.resolve()" API which allows to resolve specifiers relative to the module the API is called in. This API supports resolving using import maps.
2022-07-18Revert "fix(core): unhandled rejection in top-level scope (#15204)" (#15226)Bartek Iwańczuk
This reverts commit 48a7312f3871e3b76c51eb0143ca1c48da43b20c.
2022-07-15Revert "feat: add "unhandledrejection" event support (#12994) (#15080)" (#15210)Bartek Iwańczuk
This reverts commit 1a7259b04b7229f6350a7a7c21b50497b5c80c17.
2022-07-14feat: add "unhandledrejection" event support (#12994) (#15080)Bartek Iwańczuk
Relanding #12994 This commit adds support for "unhandledrejection" event. This event will trigger event listeners registered using: "globalThis.addEventListener("unhandledrejection") "globalThis.onunhandledrejection" This is done by registering a default handler using "Deno.core.setPromiseRejectCallback" that allows to handle rejected promises in JavaScript instead of Rust. This commit will make it possible to polyfill "process.on("unhandledRejection")" in the Node compat layer. Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-07-14fix(core): unhandled rejection in top-level scope (#15204)Bartek Iwańczuk
Update "deno_core" to not forward rejection of top level module if it was already handled by appropriate handlers. Co-authored-by: Colin Ihrig cjihrig@gmail.com
2022-07-14chore: upgrade rusty_v8 to v0.46.0 (#15200)Bartek Iwańczuk
2022-07-12chore: forward v1.23.4 release commit to main (#15172)Colin Ihrig
1.23.4 (#15168) Co-authored-by: cjihrig <cjihrig@users.noreply.github.com> Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-07-11fix: upgrade deno_ast to 0.17 (#15152)David Sherret
2022-07-11chore(web, worker): Use `DetachedBuffer` for `postMessage` ops (#15133)Andreu Botella
This commit uses `DetachedBuffer` instead of `ZeroCopyBuf` in the ops that back `Worker.prototype.postMessage` and `MessagePort.prototype.postMessage`. This is done because the serialized buffer is then copied to the destination isolate, even though it is internal to runtime code and not used for anything else, so detaching it and transferring it instead saves an unnecessary copy.
2022-07-11chore(core): Deduplicate code related to `op_event_loop_has_more_work` (#15147)Andreu Botella
The `op_event_loop_has_more_work` op, introduced in #14830, duplicates code from `JsRuntime::poll_event_loop`. That PR also added the unused method `JsRuntime::event_loop_has_work`, which is another duplication of that same code, and which isn't used anywhere. This change deduplicates this by renaming `JsRuntime::event_loop_has_work` to `event_loop_pending_state`, and making it the single place to determine what in the event loop is pending. This result is then returned in a struct which is used both in the event loop and in the `op_event_loop_has_more_work` op.
2022-07-09fix(ext/ffi): Avoid keeping JsRuntimeState RefCell borrowed for event loop ↵Aapo Alasuutari
middleware calls (#15116)
2022-07-08perf(ext/ffi): leverage V8 Fast Calls (#15125)Divy Srivastava