summaryrefslogtreecommitdiff
path: root/core
AgeCommit message (Collapse)Author
2023-03-03feat(ops): reland fast zero copy string arguments (#17996)Divy Srivastava
Reland https://github.com/denoland/deno/pull/16777 The codegen is disabled in async ops and when fallback to slow call is possible (return type is a Result) to avoid hitting this V8 bug: https://github.com/denoland/deno/issues/17159
2023-03-01fix(core): introduce `SafeRegExp` to primordials (#17592)Kenta Moriuchi
2023-02-24chore: forward v1.31.1 release commit to main (#17939)denobot
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-241.31.0 (#17906)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-23fix(core): remove async op inlining optimization (#17899)Divy Srivastava
Runtime generation of async op wrappers contributed to increased startup time and core became unusable with `--disallow-code-generation-from-strings` flag. The optimization only affects very small microbenchmarks so this revert will not cause any regressions.
2023-02-22fix(ext/ffi): Fix re-ref'ing UnsafeCallback (#17704)Aapo Alasuutari
2023-02-22fix(core): rebuild when JS sources for snapshotting change (#17876)Bartek Iwańczuk
2023-02-22perf(core, runtime): Further improve startup time (#17860)Bartek Iwańczuk
This commit further improves startup time by: - no relying on "JsRuntime::execute_script" for runtime bootstrapping, this is instead done using V8 APIs directly - registering error classes during the snapshot time, instead of on startup Further improvements can be made, mainly around removing "core.initializeAsyncOps()" which takes around 2ms. This commit should result in ~1ms startup time improvement.
2023-02-21refactor(core): More efficient serde for ES modules in snapshot (#17856)Bartek Iwańczuk
Instead of relying on "serde_v8" which is very inefficient in serializing enums, I'm hand rolling serde for "ModuleMap" data that is stored in the V8 snapshot to make ES modules snapshottable. ``` // this branch Benchmark #2: ./target/release/deno run empty.js Time (mean ± σ): 21.4 ms ± 0.9 ms [User: 15.6 ms, System: 6.4 ms] Range (min … max): 20.2 ms … 24.4 ms // main branch Benchmark #2: ./target/release/deno run empty.js Time (mean ± σ): 23.1 ms ± 1.2 ms [User: 17.0 ms, System: 6.2 ms] Range (min … max): 21.0 ms … 26.0 ms ```
2023-02-20build: add "include_js_files_for_snapshotting" Cargo feature (#17826)Bartek Iwańczuk
This allows to not include source code into the binary (because it will already be included in the V8 snapshot). Nothing changes for the embedders - everything should still build the same. This commit brings the binary size from 87Mb to 82Mb on M1. Alternative to https://github.com/denoland/deno/pull/17820 and https://github.com/denoland/deno/pull/17653 --------- Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2023-02-20refactor(core): definition of "ExtensionFileSource" (#17823)Bartek Iwańczuk
This commit changes definition of "ExtensionFileSource", by changing "code" field to being "ExtensionFileSourceCode" enum. Currently the enum has only a single variant "IncludedInBinary". It is done in preparation to allow embedders to decide if they want to include the source code in the binary when snapshotting (in most cases they shouldn't do that). In the follow up commit we'll add more variants to "ExtensionFileSourceCode". "include_js_files_dir!" macro was removed in favor "include_js_files!" macro which can now accept "dir" option.
2023-02-16test: add unit tests from std/node (#17794)Bartek Iwańczuk
Adds two test files: "cli/tests/unit_node/process_test.ts" and "cli/tests/unit_node/child_process_test.ts" --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-02-15feat: wire up ext/node to the Node compatibility layer (#17785)Bartek Iwańczuk
This PR changes Node.js/npm compatibility layer to use polyfills for built-in Node.js embedded in the snapshot (that are coming from "ext/node" extension). As a result loading `std/node`, either from "https://deno.land/std@<latest>/" or from "DENO_NODE_COMPAT_URL" env variable were removed. All code that is imported via "npm:" specifiers now uses code embedded in the snapshot. Several fixes were applied to various modules in "ext/node" to make tests pass. --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-02-14chore(build): don't compress TSC snapshot in debug build (#17772)Bartek Iwańczuk
Compressing the TSC snapshot in debug build took ~45s on M1 MacBook Pro; without compression it took ~1s. Thus we're not not using compressed snapshot, trading off a lot of build time for some startup time in debug build.
2023-02-14feat(core): allow to specify entry point for snapshotted ES modules (#17771)Bartek Iwańczuk
This commit adds "ExtensionBuilder::esm_entry_point()" function that allows to specify which of the extension files should be treated as an entry point. If the entry point is not provided all modules are loaded and evaluated, but if it is provided then only the entry point is explicitly loaded and evaluated. Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2023-02-12fix: add WouldBlock error (#17339)Leo Kettmeir
2023-02-11docs: fix minor typo in AsyncRefCell comment (#17732)Mike Mulchrone
2023-02-10chore: upgrade rusty_v8 to 0.63.0 (#17705)Bartek Iwańczuk
2023-02-10perf(core): speed up promise hook dispatch (#17616)Bert Belder
2023-02-08refactor: internal runtime code TS support (#17672)Leo Kettmeir
This is a proof of concept for being able to snapshot TypeScript files. Currently only a single runtime file is authored in TypeScript - "runtime/js/01_version.ts". Not needed infrastructure was removed from "core/snapshot_util.rs". --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-08fix(core): don't allow to import internal code is snapshot is loaded (#17694)Bartek Iwańczuk
Addressing Luca concerns from https://github.com/denoland/deno/pull/17648#discussion_r1099352286
2023-02-08refactor(core): change SourcePair to ExtensionFileSource (#17686)Bartek Iwańczuk
2023-02-07 refactor: remove prefix from include_js_files & use extension name (#17683)Leo Kettmeir
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-07chore: upgrade rusty_v8 to 0.62.2 (#17604)Bartek Iwańczuk
Co-authored-by: Bert Belder <bertbelder@gmail.com>
2023-02-07chore: forward v1.30.3 release commit to main (#17677)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-06refactor: create JsRuntime outside of run_in_task (#17667)Leo Kettmeir
2023-02-05 refactor: rename `deno` specifiers to `internal` (#17655)Leo Kettmeir
2023-02-05chore(core): improve error message in module loader example (#17654)Waldir Pimenta
Just a small tweak to the error message to avoid confusion.
2023-02-03chore: forward v1.30.2 release commit to main (#17641)denobot
This is the release commit being forwarded back to main for 1.30.2 Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-02-03Revert "chore(core): remove have_unpolled_ops on rt state (#17601)" (#17631)Bartek Iwańczuk
This reverts commit e85ca8be0dafdab28e6283aed64c8ee0eb3a338d. This commit caused a huge spike in various benchmarks we track at https://deno.land/benchmarks
2023-02-02chore: forward v1.30.1 release commit to main (#17623)denobot
This is the release commit being forwarded back to main for 1.30.1
2023-01-31chore(core): remove have_unpolled_ops on rt state (#17601)Luca Casonato
It's not needed - `!state.have_unpolled_ops.is_empty()` does the same thing. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-29fix(ext): internal `structuredClone` for `ArrayBuffer` and `TypedArray` ↵Kenta Moriuchi
subclasses (#17431)
2023-01-29refactor(core): derive equality traits for `ResolutionKind` enum (#17578)Satya Rohith
The commit derives Eq, PartialEq, and Debug traits for the `ResolutionKind` enum to make it possible for external implementors to assert ResolutionKind.
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-26fix(core): Add lint check for core (#17223)Kenta Moriuchi
The prefer-primordials lint was skipped for `core/*.js`.
2023-01-26chore(core): fix typo in runtime.rs (#17537)Ikko Eltociear Ashimine
determinstic -> deterministic
2023-01-261.30.0 (#17532)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-25Revert "chore: upgrade rusty_v8 to 0.62.0 (#17200)" (#17523)Bartek Iwańczuk
This reverts commit e2d75491d5fc6fbac67da89c7350c4c9ca99d8e9.
2023-01-25chore: upgrade rusty_v8 to 0.62.0 (#17200)Bartek Iwańczuk
2023-01-19refactor(core): Overwrite `ArrayPrototypeToString` in primordials (#17470)Kenta Moriuchi
2023-01-19refactor: cleanup ModuleMap (#17469)Leo Kettmeir
- changes module id to be usize & 0 based instead of 1 based - merges `ids_by_handle` & `handles_by_id` to be a single `handles` vector - removes `next_module_id`, as vector is used - turns `info` into a vector
2023-01-19feat: ES module snapshotting (#17460)Leo Kettmeir
This commit adds support for snapshotting ES modules. This is done by adding an ability to serialize and deserialize a "ModuleMap" and attach it to the snapshot, using "add_context_data" API. This has been tested with 400 modules and seems to not have a limit on the number of modules that might be snapshotted. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-18Optimize http_bench_json_ops example (#16505)Divy Srivastava
2023-01-17chore: forward v1.29.4 release commit to main (#17453)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-16refactor(core): Move `pending_promise_rejections` to `ContextState` (#17447)Andreu Botella
This is a requirement before supporting modules in realms.
2023-01-16refactor(core): rename pending_promise_exception to ↵Bartek Iwańczuk
pending_promise_rejection (#17441) These are technically rejections - a rejection can then raise an exception.
2023-01-15fix(core): Add `Generator` and `AsyncGenerator` to promordials (#17241)Kenta Moriuchi
2023-01-14chore: use rustfmt imports_granularity option (#17421)Divy Srivastava
Closes https://github.com/denoland/deno/issues/2699 Closes https://github.com/denoland/deno/issues/2347 Uses unstable rustfmt features. Since dprint invokes `rustfmt` we do not need to switch the cargo toolchain to nightly. Do we care about formatting stability of our codebase across Rust versions? (I don't)