summaryrefslogtreecommitdiff
path: root/core/lib.deno_core.d.ts
AgeCommit message (Collapse)Author
2023-07-02refactor(core): Extract deno_core (#19658)Matt Mastracci
`deno_core` is moving out! You'll find it at https://github.com/denoland/deno_core/ once this PR lands.
2023-04-30perf(core): async op pseudo-codegen and performance work (#18887)Matt Mastracci
Performance: ``` async_ops.js: 760k -> 1030k (!) async_ops_deferred.js: 730k -> 770k Deno.serve bench: 118k -> 124k WS test w/ third_party/prebuilt/mac/load_test 100 localhost 8000 0 0: unchanged Startup time: approx 0.5ms slower (13.7 -> 14.2ms) ```
2023-04-06feat(core): sync io ops in core (#18603)Luca Casonato
This commit adds op_read_sync and op_write_sync to core. These ops are similar to op_read and op_write, but they are synchronous. Just like the async ops, they operate on generic `deno_core::Resource` objects. These now have new `read_byob_sync` and `write_sync` methods, with default implementations throwing "NotSupported" errors, just like the async counterparts. There are no `write_all` or `read` equivalents, because the optimizations they unlock are not useful in synchronous contexts.
2023-03-05refactor: move "pathFromURL" to deno_web extension (#18037)Bartek Iwańczuk
This API is required by several extensions like "ext/node", "ext/ffi" and also FS APIs that we want to move to a separate crate. Because of that "pathFromURL" API was moved to "deno_web" extension so other extension crates can rely on it.
2023-02-22fix(ext/ffi): Fix re-ref'ing UnsafeCallback (#17704)Aapo Alasuutari
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
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-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-09-28feat(core): add Deno.core.setPromiseHooks (#15475)Guilherme Bernal
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-03core: remove heapStats type definition (#15393)Zach
2022-07-31core: Add types for `Deno.core.print()` (#15283)Zicklag
2022-02-16feat(test): improved op sanitizer errors + traces (#13676)Luca Casonato
This commit improves the error messages for the `deno test` async op sanitizer. It does this in two ways: - it uses handwritten error messages for each op that could be leaking - it includes traces showing where each op was started This "async op tracing" functionality is a new feature in deno_core. It likely has a significant performance impact, which is why it is only enabled in tests.
2022-01-20chore: update copyright year (#13434)Yoshiya Hinosawa
2022-01-06fix: Get lib.deno_core.d.ts to parse correctly (#13238)Rafael Ávila de Espíndola
2021-11-28feat(core): intercept unhandled promise rejections (#12910)Ben Noordhuis
Provide a programmatic means of intercepting rejected promises without a .catch() handler. Needed for Node compat mode. Also do a first pass at uncaughtException support because they're closely intertwined in Node. It's like that Frank Sinatra song: you can't have one without the other. Stepping stone for #7013.
2021-11-25feat(core): Add ability to "ref" and "unref" pending ops (#12889)Bartek Iwańczuk
This commit adds an ability to "ref" or "unref" pending ops. Up to this point Deno had a notion of "async ops" and "unref async ops"; the former keep event loop alive, while the latter do not block event loop from finishing. It was not possible to change between op types after dispatching, one had to decide which type to use before dispatch. Instead of storing ops in two separate "FuturesUnordered" collections, now ops are stored in a single collection, with supplemental "HashSet" storing ids of promises that were "unrefed". Two APIs were added to "Deno.core": "Deno.core.refOp(promiseId)" which allows to mark promise id to be "refed" and keep event loop alive (the default behavior) "Deno.core.unrefOp(promiseId)" which allows to mark promise id as "unrefed" which won't block event loop from exiting
2021-11-16feat(core): Deno.core.setNextTickCallback (#12771)Bartek Iwańczuk
This commit adds several new "Deno.core" bindings: * "setNextTickCallback" * "hasScheduledTick" * "setHasScheduledTick" * "runMicrotasks" Additionally it changes "Deno.core.setMacrotaskCallback" to allow registering multiple callbacks. All these changes were necessary to polyfill "process.nextTick" in Node compat layer. Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
2021-11-09feat(core): streams (#12596)Aaron O'Mullan
This allows resources to be "streams" by implementing read/write/shutdown. These streams are implicit since their nature (read/write/duplex) isn't known until called, but we could easily add another method to explicitly tag resources as streams. `op_read/op_write/op_shutdown` are now builtin ops provided by `deno_core` Note: this current implementation is simple & straightforward but it results in an additional alloc per read/write call Closes #12556
2021-10-10feat: Show the URL of streaming WASM modules in stack traces (#12268)Andreu Botella
WebAssembly modules compiled through `WebAssembly.compile()` and similar non-streaming APIs don't have a URL associated to them, because they have been compiled from a buffer source. In stack traces, V8 will use a URL such as `wasm://wasm/d1c677ea`, with a hash of the module. However, wasm modules compiled through streaming APIs, like `WebAssembly.compileStreaming()`, do have a known URL, which can be obtained from the `Response` object passed into the streaming APIs. And as per the developer-facing display conventions in the WebAssembly Web API spec, this URL should be used in stack traces. This change implements that.
2021-09-13refactor(core): Turn the `wasm_streaming_feed` binding into ops (#11985)Andreu Botella
Async WebAssembly compilation was implemented by adding two bindings: `set_wasm_streaming_callback`, which registered a callback to be called whenever a streaming wasm compilation was started, and `wasm_streaming_feed`, which let the JS callback modify the state of the v8 wasm compiler. `set_wasm_streaming_callback` cannot currently be implemented as anything other than a binding, but `wasm_streaming_feed` does not really need to use anything specific to bindings, and could indeed be implemented as one or more ops. This PR does that, resulting in a simplification of the relevant code. There are three operations on the state of the v8 wasm compiler that `wasm_streaming_feed` allowed: feeding new bytes into the compiler, letting it know that there are no more bytes coming from the network, and aborting the compilation. This PR provides `op_wasm_streaming_feed` to feed new bytes into the compiler, and `op_wasm_streaming_abort` to abort the compilation. It doesn't provide an op to let v8 know that the response is finished, but closing the resource with `Deno.core.close()` will achieve that.
2021-09-11refactor: use Deno.core.tryClose (#11980)Bartek Iwańczuk
2021-07-03feat: enable WebAssembly.instantiateStreaming and wasm async compilation ↵Andreu Botella
(#11200) The WebAssembly streaming APIs used to be enabled, but used to take buffer sources as their first argument (see #6154 and #7259). This change re-enables them, requiring a Promise<Response> instead, as well as enabling asynchronous compilation of WebAssembly modules.
2021-06-05refactor(web): use encoding_rs for text encoding (#10844)Luca Casonato
This commit removes all JS based text encoding / text decoding. Instead encoding now happens in Rust via encoding_rs (already in tree). This implementation retains stream support, but adds the last missing encodings. We are incredibly close to 100% WPT on text encoding now. This should reduce our baseline heap by quite a bit.
2021-04-12refactor(deno): remove concept of bin & json ops (#10145)Aaron O'Mullan
2021-03-31refactor: new optimized op-layer using serde_v8 (#9843)Aaron O'Mullan
- Improves op performance. - Handle op-metadata (errors, promise IDs) explicitly in the op-layer vs per op-encoding (aka: out-of-payload). - Remove shared queue & custom "asyncHandlers", all async values are returned in batches via js_recv_cb. - The op-layer should be thought of as simple function calls with little indirection or translation besides the conceptually straightforward serde_v8 bijections. - Preserve concepts of json/bin/min as semantic groups of their inputs/outputs instead of their op-encoding strategy, preserving these groups will also facilitate partial transitions over to v8 Fast API for the "min" and "bin" groups
2021-03-23feat(core): Deno.core.heapStats() (#9659)Aaron O'Mullan
This commit implements "Deno.core.heapStats()" function that allows to programatically measure isolate heap-usage.
2021-02-13refactor(core): Strongly typed deserialization of JSON ops (#9423)Jared Beller
This PR makes json_op_sync/async generic to all Deserialize/Serialize types instead of the loosely-typed serde_json::Value. Since serde_json::Value implements Deserialize/Serialize, very little existing code needs to be updated, however as json_op_sync/async are now generic, type inference is broken in some cases (see cli/build.rs:146). I've found this reduces a good bit of boilerplate, as seen in the updated deno_core examples. This change may also reduce serialization and deserialization overhead as serde has a better idea of what types it is working with. I am currently working on benchmarks to confirm this and I will update this PR with my findings.
2021-02-07chore: fix typo in lib.deno_core.d.ts (#9416)Ikko Ashimine
2021-01-28chore: add jsdoc to 26_fetch.js and enable some fetch tests (#9305)Luca Casonato