summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)Author
2023-04-01chore: forward v1.32.2 release commit to main (#18539)denobot
This is the release commit being forwarded back to main for 1.32.2
2023-03-31perf(ext/websocket): use opAsync2 to avoid spread deopt (#18525)Divy Srivastava
This commit adds a new core API `opAsync2` to call an async op with atmost 2 arguments. Spread argument iterators has a pretty big perf hit when calling ops. | name | avg msg/sec/core | | --- | --- | | 1.32.1 | `127820.750000` | | #18506 | `140079.000000` | | #18506 + #18509 | `150104.250000` | | #18506 + #18509 + this | `157340.000000` |
2023-03-31perf: `const` op declaration (#18288)Divy Srivastava
Co-authored-by: Levente Kurusa <lkurusa@kernelstuff.org> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-24chore: fix located_script_name test (#18418)David Sherret
Closes #18417
2023-03-23fix(core): located_script_name macro was using format syntax (#18388)Matt Mastracci
2023-03-23fix(core): panic at build time if extension code contains anything other ↵Matt Mastracci
than 7-bit ASCII (#18372) This will improve diagnostics and catch any non-ASCII extension code early. This will use `debug_assert!` rather than `assert!` to avoid runtime costs, and ensures (in debug_assert mode only) that all extension source files are ASCII as we load them.
2023-03-23chore: forward v1.32.1 release commit to main (#18399)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-23core: disable resizable ArrayBuffer and growable SharedArrayBuffer (#18395)Bartek Iwańczuk
2023-03-23refactor(core): move setting up snapshot context to JsRuntime::snapshot (#18383)Bartek Iwańczuk
2023-03-221.32.0 (#18367)denobot
Bumped versions for 1.32.0 --------- Co-authored-by: mmastrac <mmastrac@users.noreply.github.com> Co-authored-by: Matt Mastracci <matthew@mastracci.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-03-22docs(JsRealm.execute_script): adding info and doc test about the isolate ↵Vagelis Prokopiou
parameter (#18280)
2023-03-21perf(core) Reduce script name and script code copies (#18298)Matt Mastracci
Reduce the number of copies and allocations of script code by carrying around ownership/reference information from creation time. As an advantage, this allows us to maintain the identity of `&'static str`-based scripts and use v8's external 1-byte strings (to avoid incorrectly passing non-ASCII strings, debug `assert!`s gate all string reference paths). Benchmark results: Perf improvements -- ~0.1 - 0.2ms faster, but should reduce garbage w/external strings and reduces data copies overall. May also unlock some more interesting optimizations in the future. This requires adding some generics to functions, but manual monomorphization has been applied (outer/inner function) to avoid code bloat.
2023-03-21feat: TypeScript 5.0.2 (except decorators) (#18294)David Sherret
This upgrades TypeScript to 5.0.2, but does not have ES decorator support because swc does not support that yet.
2023-03-21chore(core): remove stray log statement (#18322)Bartek Iwańczuk
2023-03-18Reland "perf(core): preserve ops between snapshots (#18080)" (#18272)Bartek Iwańczuk
Relanding 4b6305f4f25fc76f974bbdcc9cdb139d5ab8f5f4
2023-03-18perf(core): use static specifier in ExtensionFileSource (#18271)Bartek Iwańczuk
Relanding #18264 ------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-03-18Revert "perf(core): use static specifier in ExtensionFileSource (#182… ↵Bartek Iwańczuk
(#18270) …64)" This reverts commit 8af0c8351935ea7c6c0441055d5164908322c9d6. Causes bench stage to fail on CI.
2023-03-18Revert "perf(core): preserve ops between snapshots (#18080)" (#18267)Bartek Iwańczuk
This reverts commit 4b6305f4f25fc76f974bbdcc9cdb139d5ab8f5f4.
2023-03-18perf(core): use static specifier in ExtensionFileSource (#18264)Divy Srivastava
Closes #18085 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-18perf(core): preserve ops between snapshots (#18080)Bartek Iwańczuk
This commit changes the build process in a way that preserves already registered ops in the snapshot. This allows us to skip creating hundreds of "v8::String" on each startup, but sadly there is still some op registration going on startup (however we're registering 49 ops instead of >200 ops). This situation could be further improved, by moving some of the ops from "runtime/" to a separate extension crates. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-03-18chore(core): simplify extension config codegen (#18263)Divy Srivastava
Avoid creating an extra closure when no config needed. I eventually want to make OpStateFn fixed sized to avoid boxing it.
2023-03-17refactor(core): don't require Clone trait bounds in deno_core::extension ↵Bartek Iwańczuk
(#18257) These bounds were needlessly strict.
2023-03-17perf(core) Reduce copying and cloning in extension initialization (#18252)Matt Mastracci
Follow-up to #18210: * we are passing the generated `cfg` object into the state function rather than passing individual config fields * reduce cloning dramatically by making the state_fn `FnOnce` * `take` for `ExtensionBuilder` to avoid more unnecessary copies * renamed `config` to `options`
2023-03-17feat(core) deno_core::extension! macro to simplify extension registration ↵Matt Mastracci
(#18210) This implements two macros to simplify extension registration and centralize a lot of the boilerplate as a base for future improvements: * `deno_core::ops!` registers a block of `#[op]`s, optionally with type parameters, useful for places where we share lists of ops * `deno_core::extension!` is used to register an extension, and creates two methods that can be used at runtime/snapshot generation time: `init_ops` and `init_ops_and_esm`. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-16chore: bump rusty_v8 to 0.65.0 (#18231)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-16refactor(core): op initialization and snapshot creator (#18221)Bartek Iwańczuk
This PR cleans up APIs related to snapshot creation and how ops are initialized. Prerequisite for #18080 --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-03-16chore: forward v1.31.3 release commit to main (#18222)denobot
Co-authored-by: kt3k <kt3k@users.noreply.github.com>
2023-03-15chore(core): don't print cargo directives if not creating snapshot (#18205)Bartek Iwańczuk
2023-03-14refactor: deno_core not using std::env::current_dir (#18173)Bartek Iwańczuk
This commit changes "deno_core" to not rely on implicitly calling "std::env::current_dir()" when resolving module specifiers using APIs from "deno_core::modules_specifier". Supersedes https://github.com/denoland/deno/pull/15454
2023-03-14refactor(core): remove "resolve_url_or_path_deprecated" (#18174)Bartek Iwańczuk
Remove remaining usages of "resolve_url_or_path_deprecated" in favor of "resolve_url_or_path" with explicit calls to "std::env::current_dir()". Towards landing https://github.com/denoland/deno/pull/15454
2023-03-14fix(core/internal): fix typo in primordial type definitions (#18125)Nicholas Berlette
This PR resolves a very small typo in the primordial typedefs file `./core/internal.d.ts`. The correct reference now reads `typeof FinalizationRegistry.prototype.register`. Before this PR the type alias pointed to `registar`, which obviously doesn't exist.
2023-03-14refactor(core): resolve_url_or_path and resolve_url_or_path_deprecated (#18170)Bartek Iwańczuk
This commit changes current "deno_core::resolve_url_or_path" API to "resolve_url_or_path_deprecated" and adds new "resolve_url_or_path" API that requires to explicitly pass the directory from which paths should be resolved to. Some of the call sites were updated to use the new API, the reminder of them will be updated in a follow up PR. Towards landing https://github.com/denoland/deno/pull/15454
2023-03-13refactor(core): pass cwd explicitly to resolve_path (#18092)Bartek Iwańczuk
Towards landing #15454
2023-03-13Revert "feat(core): prevent isolate drop for CLI main worker (#18059)" (#18157)Ryan Dahl
Fixes https://github.com/denoland/deno/issues/18120 https://github.com/denoland/deno/issues/18137 https://github.com/denoland/fresh/issues/1073 This reverts commit 0cce9c2bcc9667935a571d30847e66ef5d01a196.
2023-03-13fix(core): `SafePromiseAll` to be unaffected by `Array#@@iterator` (#17542)Kenta Moriuchi
2023-03-10chore: forward v1.31.2 release commit to main (#18114)denobot
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-03-09refactor(core): remove RuntimeOptions::extensions_with_js (#18099)Bartek Iwańczuk
This commit removes "deno_core::RuntimeOptions::extensions_with_js". Now it's embedders' responsibility to properly register extensions that will not contains JavaScript sources when running from an existing snapshot. Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-09refactor(core): Extension::builder_with_deps (#18093)Bartek Iwańczuk
Prerequisite for https://github.com/denoland/deno/pull/18080
2023-03-09perf(core): over-allocate in ModuleMap when running from snapshot (#18083)Bartek Iwańczuk
This commit changes "ModuleMap" initialization to over-allocate by 16 for vectors storing module information and module V8 handles. In 99% cases there's gonna be at least one additional module loaded, so it's very wasteful to have to reallocate when the module is executed (IIRC Rust will double the size of the vector) and move all of the elements.
2023-03-08feat(core): prevent isolate drop for CLI main worker (#18059)Divy Srivastava
``` Benchmark 1: deno run -A ../empty.js Time (mean ± σ): 20.5 ms ± 0.5 ms [User: 13.4 ms, System: 5.1 ms] Range (min … max): 19.8 ms … 24.0 ms 119 runs Benchmark 2: target/release/deno run -A ../empty.js Time (mean ± σ): 18.8 ms ± 0.3 ms [User: 13.0 ms, System: 4.9 ms] Range (min … max): 18.3 ms … 19.9 ms 129 runs ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-03-07refactor(core): don't use Result in ExtensionBuilder::state (#18066)Bartek Iwańczuk
There's no point for this API to expect result. If something fails it should result in a panic during build time to signal to embedder that setup is wrong.
2023-03-06refactor: use v8::String::new_external_onebyte_static where appropriate (#18051)Bartek Iwańczuk
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-03-05refactor(core): InternalModuleLoader checks if all files were used (#18005)Bartek Iwańczuk
This commit changes "InternalModuleLoader" from "deno_core" to store a list of used modules during snapshotting. If a module was not used during snapshotting "InternalModuleLoader" will panic in its "Drop" handler signaling to the embedder that they made a mistake somewhere.
2023-03-05refactor: move definition of Deno.build from "runtime" to "core" (#18036)Bartek Iwańczuk
We use information about build in several extension crates like "ext/node" or "runtime/". In an effort to move "fs" APIs to a separate crate it is a prerequisite to have this information available outside of the "runtime/" crate. This commit moves definition of "build" object to "Deno.core" that is later forwarded to "Deno.build".
2023-03-05chore(core): remove argc field from OpDecl (#18024)Divy Srivastava
https://github.com/denoland/deno/pull/18023#discussion_r1125611859
2023-03-05refactor(core): include_js_files! 'dir' option doesn't change specifiers ↵Bartek Iwańczuk
(#18019) This commit changes "include_js_files!" macro from "deno_core" in a way that "dir" option doesn't cause specifiers to be rewritten to include it. Example: ``` include_js_files! { dir "js", "hello.js", } ``` The above definition required embedders to use: `import ... from "internal:<ext_name>/js/hello.js"`. But with this change, the "js" directory in which the files are stored is an implementation detail, which for embedders results in: `import ... from "internal:<ext_name>/hello.js"`. The directory the files are stored in, is an implementation detail and in some cases might result in a significant size difference for the snapshot. As an example, in "deno_node" extension, we store the source code in "polyfills" directory; which resulted in each specifier to look like "internal:deno_node/polyfills/<module_name>", but with this change it's "internal:deno_node/<module_name>". Given that "deno_node" has over 100 files, many of them having several import specifiers to the same extension, this change removes 10 characters from each import specifier.
2023-03-04refactor: remove `Semaphore::new(1)` and use `TaskQueue` (#18014)David Sherret
2023-03-05refactor: move TaskQueue from deno_runtime to deno_core (#18016)Bartek Iwańczuk
This utility is useful in several contexts so it seems reasonable to have it in `deno_core`.