summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)Author
2022-10-29fix(core): fix APIs not to be affected by `Promise.prototype.then` ↵Kenta Moriuchi
modification (#16326)
2022-10-28feat(core): support creating snapshots from existing snapshots (#14744)Bartek Iwańczuk
2022-10-28Reland "perf(core): generate inlined wrappers for async ops" (#16455)Divy Srivastava
Reland https://github.com/denoland/deno/pull/16428
2022-10-28chore(core): remove TODO in bindings.rs (#16456)Divy Srivastava
2022-10-271.27.0 (#16442)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-27Revert "perf(core): generate inlined wrappers for async ops (#16428)" (#16443)Divy Srivastava
2022-10-27perf(core): generate inlined wrappers for async ops (#16428)Divy Srivastava
V8's JIT can do a better job knowing the argument count and also enable fast call path (in future). This also lets us call async ops without `opAsync`: ```js const { ops } = Deno.core; await ops.op_void_async(); ``` this patch: 4405286 ops/sec main: 3508771 ops/sec
2022-10-26fix(core) Include causes when converting anyhow errors to JS exceptions (#16397)Jan Špaček
When an op returns an `anyhow` error with a cause (usually added using the `.context()` method), the `Error` thrown into JavaScript contains only the message of the outernmost error in the chain. This PR simply changes the formatting of `anyhow::Error` from `"{}"` to `"{:#}"`: This significantly improves errors for code that embeds Deno and defines custom ops. For example, in [chiselstrike/chiselstrike](https://github.com/chiselstrike/chiselstrike), this PR improves an error message like ``` Error: could not plan migration ``` to ``` Error: could not plan migration: could not migrate table for entity "E": could not add column for field "title": the field does not have a default value ```
2022-10-26core: enable --harmony-change-array-by-copy V8 flag (#16429)Bartek Iwańczuk
Enables [Change Array by copy proposal](https://github.com/tc39/proposal-change-array-by-copy) via a V8 flag.
2022-10-26feat(cli): show error cause recursion information (#16384)Cre3per
2022-10-26perf(core): do not drive JsInspector by default (#16410)Divy Srivastava
Part of https://github.com/denoland/deno/pull/16377
2022-10-25fix: upgrade swc_ecma_parser to 0.122.19 - deno_ast 0.20 (#16406)David Sherret
2022-10-25perf(core): avoid isolate slots for ModuleMap (#16409)Divy Srivastava
2022-10-25feat(ext/web): use ArrayBuffer.was_detached() (#16307)Marcos Casagrande
This PR adds a way to reliably check if an ArrayBuffer was detached
2022-10-24perf(ext/streams): fast path when consuming body of tee'd stream (#16329)Marcos Casagrande
Add a fast path for consuming the body of cloned `Request`/`Response`, which is very common specially when using `cache` API.
2022-10-21perf(core): don't access isolate slots for JsRuntimeState (#16376)Divy Srivastava
example writeFile benchmark: ``` # before time 188 ms rate 53191 time 168 ms rate 59523 time 167 ms rate 59880 time 166 ms rate 60240 time 168 ms rate 59523 time 173 ms rate 57803 time 183 ms rate 54644 # after time 157 ms rate 63694 time 152 ms rate 65789 time 151 ms rate 66225 time 151 ms rate 66225 time 152 ms rate 65789 ```
2022-10-21chore(core): remove `core.opSync` (#16379)Divy Srivastava
This patch removes the last uses of `core.opSync` from Deno. The new and JIT-friendly way to call sync ops is `core.ops.op_name()`.
2022-10-21Revert realms from deno_core (#16366)Divy Srivastava
This revert has been discussed at length out-of-band (including with @andreubotella). The realms work in impeding ongoing event loop and performance work. We very much want to land realms but it needs to wait until these lower-level refactors are complete. We hope to bring realms back in a couple weeks.
2022-10-20chore: upgrade rusty_v8 to 0.54.0 (#16368)Bartek Iwańczuk
<!-- Before submitting a PR, please read http://deno.land/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. -->
2022-10-20perf(core): avoid creating global handles in `op_queue_microtask` (#16359)Divy Srivastava
2022-10-18fix(ext/net): return an error from `startTls` and `serveHttp` if the ↵Yusuke Tanaka
original connection is captured elsewhere (#16242) This commit removes the calls to `expect()` on `std::rc::Rc`, which caused Deno to panic under certain situations. We now return an error if `Rc` is referenced by other variables. Fixes #9360 Fixes #13345 Fixes #13926 Fixes #16241 Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-17chore: forward v1.26.2 to main (#16331)Bartek Iwańczuk
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> <!-- Before submitting a PR, please read http://deno.land/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. --> Co-authored-by: denobot <33910674+denobot@users.noreply.github.com> Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2022-10-16fix: add error cause in recursive cause tail (#16306)Cre3per
2022-10-16chore: upgrade rusty_v8 to 0.53.1 (#16303)Bartek Iwańczuk
This commit fixes startup time regression, caused by update to rusty_v8 v0.50.0.
2022-10-15fix(docs): Documentation improvements related to `JsRealm`. (#16247)Andreu Botella
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