summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)Author
2022-10-15refactor(core): use isolate get_data/set_data instead of slots (#16286)Bartek Iwańczuk
2022-10-15bench: avoid port collision (#16285)Bartek Iwańczuk
2022-10-15chore: upgrade rusty_v8 to 0.53.0 (#16272)Bartek Iwańczuk
2022-10-10feat(core): add Deno.core.writeAll(rid, chunk) (#16228)Luca Casonato
This commit adds a new op_write_all to core that allows writing an entire chunk in a single async op call. Internally this calls `Resource::write_all`. The `writableStreamForRid` has been moved to `06_streams.js` now, and uses this new op. Various other code paths now also use this new op. Closes #16227
2022-10-09feat(core): improve resource read & write traits (#16115)Luca Casonato
This commit introduces two new buffer wrapper types to `deno_core`. The main benefit of these new wrappers is that they can wrap a number of different underlying buffer types. This allows for a more flexible read and write API on resources that will require less copying of data between different buffer representations. - `BufView` is a read-only view onto a buffer. It can be backed by `ZeroCopyBuf`, `Vec<u8>`, and `bytes::Bytes`. - `BufViewMut` is a read-write view onto a buffer. It can be cheaply converted into a `BufView`. It can be backed by `ZeroCopyBuf` or `Vec<u8>`. Both new buffer views have a cursor. This means that the start point of the view can be constrained to write / read from just a slice of the view. Only the start point of the slice can be adjusted. The end point is fixed. To adjust the end point, the underlying buffer needs to be truncated. Readable resources have been changed to better cater to resources that do not support BYOB reads. The basic `read` method now returns a `BufView` instead of taking a `ZeroCopyBuf` to fill. This allows the operation to return buffers that the resource has already allocated, instead of forcing the caller to allocate the buffer. BYOB reads are still very useful for resources that support them, so a new `read_byob` method has been added that takes a `BufViewMut` to fill. `op_read` attempts to use `read_byob` if the resource supports it, which falls back to `read` and performs an additional copy if it does not. For Rust->JS reads this change should have no impact, but for Rust->Rust reads, this allows the caller to avoid an additional copy in many scenarios. This combined with the support for `BufView` to be backed by `bytes::Bytes` allows us to avoid one data copy when piping from a `fetch` response into an `ext/http` response. Writable resources have been changed to take a `BufView` instead of a `ZeroCopyBuf` as an argument. This allows for less copying of data in certain scenarios, as described above. Additionally a new `Resource::write_all` method has been added that takes a `BufView` and continually attempts to write the resource until the entire buffer has been written. Certain resources like files can override this method to provide a more efficient `write_all` implementation.
2022-10-07feat(core): Reorder extension initialization (#16136)Jakub Łabor
2022-10-07chore: upgrade rusty_v8 to 0.52.0 (#16183)Bartek Iwańczuk
2022-10-06chore: forward v1.26.1 release commit to main (#16178)denobot
This is the release commit being forwarded back to main for 1.26.1 Please ensure: - [x] Everything looks ok in the PR - [x] The release has been published To make edits to this PR: ```shell git fetch upstream forward_v1.26.1 && git checkout -b forward_v1.26.1 upstream/forward_v1.26.1 ``` Don't need this PR? Close it. cc @cjihrig Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-10-05feat(npm): implement Node API (#13633)Divy Srivastava
This PR implements the NAPI for loading native modules into Deno. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-10-04perf(ext/fetch): consume body using ops (#16038)Marcos Casagrande
This commit adds a fast path to `Request` and `Response` that make consuming request bodies much faster when using `Body#text`, `Body#arrayBuffer`, and `Body#blob`, if the body is a FastStream. Because the response bodies for `fetch` are FastStream, this speeds up consuming `fetch` response bodies significantly.
2022-10-02fix(serde_v8): serialize objects with numeric keys correctly (#15946)Darshan Sen
Signed-off-by: Darshan Sen <raisinten@gmail.com>
2022-09-30refactor(ext/http): remove op_http_read (#16096)Luca Casonato
We can use Resource::read_return & op_read instead. This allows HTTP request bodies to participate in FastStream. To make this work, `readableStreamForRid` required a change to allow non auto-closing resources to be handled. This required some minor changes in our FastStream paths in ext/http and ext/flash.
2022-09-291.26.0denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-09-28feat(core): add Deno.core.setPromiseHooks (#15475)Guilherme Bernal
2022-09-28feat: implement Web Cache API (#15829)Satya Rohith
2022-09-23feat(ops): Fallible fast ops (#15989)Aapo Alasuutari
2022-09-22chore: forward v1.25.4 release commit to main (#16001)David Sherret
2022-09-22examples(core): panik (#15983)Aaron O'Mullan
2022-09-22feat(ops): Automatic fast ops creation (#15527)Aapo Alasuutari
2022-09-19perf(core): use single ObjectTemplate for ops in `initialize_ops` (#15959)Divy Srivastava
2022-09-19chore: fix clippy warnings (#15944)Ben Noordhuis
Stop allowing clippy::derive-partial-eq-without-eq and fix warnings about deriving PartialEq without also deriving Eq. In one case I removed the PartialEq because it a) wasn't necessary, and b) sketchy because it was comparing floating point numbers. IMO, that's a good argument for enforcing the lint rule, because it would most likely have been caught during review if it had been enabled.
2022-09-17chore: upgrade rusty_v8 to v0.50.0 (#15762)Darshan Sen
Signed-off-by: Darshan Sen <raisinten@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-09-16upgrade deps (#15914)Ryan Dahl
2022-09-15chore: forward v1.25.3 release commit to main (#15919)Colin Ihrig
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: cjihrig <cjihrig@users.noreply.github.com>
2022-09-10perf: optimize URL serialization (#15663)Divy Srivastava
2022-09-09chore: forward v1.25.2 release commit to main (#15831)denobot
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2022-09-08chore: update url crate to 2.3.1 (#15818)Leo Kettmeir
2022-09-07fix: upgrade deno_ast to 0.19 (#15808)David Sherret
2022-09-07chore: bump url crate to 2.3.0 (#15800)Divy Srivastava
2022-09-07fix(core): make errors more resistant to tampering (#15789)Colin Ihrig
This commit makes error objects more resistant to prototype tampering. This bug was found when updating the deno_std Node compatibility layer to Node 18. The Node test 'parallel/test-assert-fail.js' was breaking std's assertion library. Refs: https://github.com/denoland/deno_std/pull/2585
2022-09-07perf(ops): inline &[u8] arguments and enable fast API (#15731)Divy Srivastava
2022-09-07fix(ext/flash): use utf8 length as Content-Length (#15793)Divy Srivastava
2022-09-07fix(core): opAsync leaks a promise on type error (#15795)Aapo Alasuutari
2022-09-06perf(runtime): short-circuit `queue_async_op` for Poll::Ready (#15773)Divy Srivastava
2022-09-06fix(core): Register external references for imports to the SnapshotCreator ↵Giovanny Gutiérrez
(#15621) Several functions used for handling of dynamic imports and "import.meta" object were not registered as external references and caused V8 to crash during snapshotting. These functions are now registered as external refs and aborts are no longer happening.
2022-09-06fix(watch): ignore unload errors on drop (#15782)Nayeem Rahman
2022-09-02refactor(test): grab runTests() and runBenchmarks() from __bootstrap (#15420)Nayeem Rahman
2022-09-02fix(ext/timers): create primordial `eval` (#15110)Garcia
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).