mirror of https://github.com/boa-dev/boa.git
Tree:
1356a5efd6
add-vhs-ci
benchmarks
bump-test262
control-flow-graph
dependabot/cargo/rust-dependencies-50dc4690b8
expect-lints
feature/node_span
feature/snapshot
features
gh-readonly-queue/main/pr-2877-b0ddf5eed00a53281d67fc7d846233fc0d99ce9c
gh-readonly-queue/main/pr-3144-8e48cec73fae708420b9af88813d4870243c491a
local-parameters-if-mapped-arguments-object-not-accessed
main
nan-boxing
optimization/static-shapes
real_conformance
refactor/interner
refactor/register-vm
releases/0.17
releases/0.19
semver_checks
tco
utility-crate
wasm-debugger
nightly
v0.10
v0.11
v0.12
v0.13
v0.14
v0.15
v0.16
v0.17
v0.17.1
v0.17.2
v0.17.3
v0.18
v0.19
v0.19.1
v0.2.0
v0.2.1
v0.20
v0.3.0
v0.4.0
v0.5.0
v0.5.1
v0.6.0
v0.7.0
v0.8.0
v0.9.0
${ noResults }
477 Commits (1356a5efd688cfcde68fa1ca537f144d78d8170d)
Author | SHA1 | Message | Date |
---|---|---|---|
creampnx_x | 573ac14458 |
Add unicode terminator to line comment (#2301)
This PR sloves the unicode terminator to single line comment + [{u+2028}](https://unicode-table.com/en/2028/) + [{u+2029}](https://unicode-table.com/en/2029/) + [related test]( |
2 years ago |
Iban Eguia | f5be60975b |
Updated dependencies for 0.16 release (#2300)
This Pull Request updates the dependencies for the 0.16 release. Co-authored-by: José Julián Espina <jedel0124@gmail.com> |
2 years ago |
dependabot[bot] | c4c608c17a |
Bump serde from 1.0.144 to 1.0.145 (#2298)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.144 to 1.0.145. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.145</h2> <ul> <li>Allow RefCell<T>, Mutex<T>, and RwLock<T> to be serialized regardless of whether T is <code>Sized</code> (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2282">#2282</a>, thanks <a href="https://github.com/ChayimFriedman2"><code>@ChayimFriedman2</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Iban Eguia | 77e739c5da |
Upgrading to Unicode 15 (#2291)
This Pull Request overrides #2288.
It changes the following:
- Updates dependencies to use Unicode 15
- Updates the boa_unicode crate to use Unicode 15
It's still waiting on the unicode-general-category 0.6 release, which was tagged 3 days ago:
|
2 years ago |
dependabot[bot] | 198dfcc394 |
Bump once_cell from 1.14.0 to 1.15.0 (#2296)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.14.0 to 1.15.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/matklad/once_cell/blob/master/CHANGELOG.md">once_cell's changelog</a>.</em></p> <blockquote> <h2>1.15.0</h2> <ul> <li>Increase minimal supported Rust version to 1.56.0.</li> <li>Implement <code>UnwindSafe</code> even if the <code>std</code> feature is disabled.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | d28633925c |
Implement `for await...of` loops (#2286)
This Pull Request changes the following: - Implement `for await...of` loop parsing - Implement `for await...of` execution |
2 years ago |
raskad | db8a299386 |
Implement missing global object internal methods (#2287)
This Pull Request fixes/closes #1987. It changes the following: - Add a prototype to the global object. - Implement `__get_prototype_of__`, `__set_prototype_of__`, `__get_own_property__`, and `__own_property_keys__` for the global object |
2 years ago |
creampnx_x | dbbcc57809 |
Fix labelled block statement (#2285)
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->
This Pull Request fixes [x-after-break-to-label](
|
2 years ago |
Iban Eguia | 779384d87f |
Add URI encoding and decoding functions (#2267)
This Pull Request closes #894.
It changes the following:
- Adds the `encodeURI()`, `decodeURI()`, `encodeURIComponent()` and `decodeURIComponent()` functions
- Passes all the tests except for those depending on #1987 or on the comment below.
Things to discuss:
- I'm unable to find in the spec information regarding the only failing tests, which relate to [this](
|
2 years ago |
raskad | 09e35a85a2 |
Implement Async-from-Sync Iterator Objects (#2234)
This Pull Request changes the following: - Implement [Async-from-Sync Iterator Objects](https://tc39.es/ecma262/#sec-async-from-sync-iterator-objects) - Give the proper `async` hint to `GetIterator` when executing a delegate yield expression in an async generator function |
2 years ago |
Iban Eguia | af35be683e |
Fixed assignment expression parsing (#2268)
This Pull Request fixes/closes #2148. It changes the following: - When we start an assignment expression, the `/` token must be a regular expression literal. The division can only occur between expressions after the assignment operator. - Added tests for the new behaviour, taken from #2177 This overrides #2177 |
2 years ago |
Iban Eguia | f4d88b7942 |
Added a bit more integer operation consistency to ByteDataBlock creation (#2272)
This Pull Request fixes a potential overflow when trying to convert a `u64` into a `usize` and then trying to create a byte data block. Related to this, we seem to be using a `u64` and `i64` as a general approach for an "integer", but ECMAScript doesn't have bounds for them, so they could be as big as infinite. Should we use `u128` and `i128` to have a bigger range? This would add a performance penalty, though, and we don't have 128-bit platforms usually, so the benefit would probably be minimal, at least when trying to allocate. |
2 years ago |
dependabot[bot] | fb68a8d734 |
Update criterion requirement from 0.3.5 to 0.4.0 in /boa_engine (#2279)
Updates the requirements on [criterion](https://github.com/bheisler/criterion.rs) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/bheisler/criterion.rs/blob/master/CHANGELOG.md">criterion's changelog</a>.</em></p> <blockquote> <h2>[0.4.0] - 2022-09-10</h2> <h3>Removed</h3> <ul> <li>The <code>Criterion::can_plot</code> function has been removed.</li> <li>The <code>Criterion::bench_function_over_inputs</code> function has been removed.</li> <li>The <code>Criterion::bench_functions</code> function has been removed.</li> <li>The <code>Criterion::bench</code> function has been removed.</li> </ul> <h3>Changed</h3> <ul> <li>HTML report hidden behind non-default feature flag: 'html_reports'</li> <li>Standalone support (ie without cargo-criterion) feature flag: 'cargo_bench_support'</li> <li>MSRV bumped to 1.57</li> <li><code>rayon</code> and <code>plotters</code> are optional (and default) dependencies.</li> <li>Status messages ('warming up', 'analyzing', etc) are printed to stderr, benchmark results are printed to stdout.</li> <li>Accept subsecond durations for <code>--warm-up-time</code>, <code>--measurement-time</code> and <code>--profile-time</code>.</li> <li>Replaced serde_cbor with ciborium because the former is no longer maintained.</li> <li>Upgrade clap to v3 and regex to v1.5.</li> </ul> <h3>Added</h3> <ul> <li>A <code>--discard-baseline</code> flag for discarding rather than saving benchmark results.</li> <li>Formal support for benchmarking code compiled to web-assembly.</li> <li>A <code>--quiet</code> flag for printing just a single line per benchmark.</li> <li>A <code>Throughput::BytesDecimal</code> option for measuring throughput in bytes but printing them using decimal units like kilobytes instead of binary units like kibibytes.</li> </ul> <h3>Fixed</h3> <ul> <li>When using <code>bench_with_input</code>, the input parameter will now be passed through <code>black_box</code> before passing it to the benchmark.</li> </ul> <h2>[0.3.6] - 2022-07-06</h2> <h3>Changed</h3> <ul> <li>MSRV bumped to 1.49</li> <li>Symbol for microseconds changed from ASCII 'us' to unicode 'µs'</li> <li>Documentation fixes</li> <li>Clippy fixes</li> </ul> <h2>[0.3.5] - 2021-07-26</h2> <h3>Fixed</h3> <ul> <li>Corrected <code>Criterion.toml</code> in the book.</li> <li>Corrected configuration typo in the book.</li> </ul> <h3>Changed</h3> <ul> <li>Bump plotters dependency to always include a bug-fix.</li> <li>MSRV bumped to 1.46.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Choongwoo Han | 43c7d7748a |
Fix regex literal /[/]/ (#2277)
This PR fixes a case where a forward slash is located in a regex class: `let regex = /[/]/;`. In this case, the forward slash should not close the regex literal. This fixes `test/built-ins/RegExp/regexp-class-chars.js` |
2 years ago |
creampnx_x | c43539a428 |
fix computed property methods can call super methods (#2274)
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->
This Pull Request fixes:
|
2 years ago |
Choongwoo Han | 2072f51faf |
Allow some keywords as identifiers (#2269)
This PR fixes #2275 There are keywords that are allowed as identifiers. https://tc39.es/ecma262/#sec-keywords-and-reserved-words > Those that are always allowed as identifiers, but also appear as keywords within certain syntactic productions, at places where Identifier is not allowed: as, async, from, get, meta, of, set, and target. This PR adds test cases for them, and fixes some cases such as `class A { set(a, b) { } }` `function of() { }` `let obj = {async: true}` `async()` |
2 years ago |
Choongwoo Han | 90ec460b3f |
Fix property access of call expression (#2273)
Fix a syntax error when accessing literal-like property names of call expression. e.g.) `fn().true` |
2 years ago |
Choongwoo Han | b63d04c48b |
Do not auto-insert semicolon in VariableDeclarationList (#2266)
There can be a line terminator in the middle of variable declaration statement. For example, ```js var a , b; ``` In this case, we should not insert semicolon automatically. This fixes: - test262/test/language/asi/S7.9_A7_T8.js - test262/test/language/asi/S7.9_A7_T9.js |
2 years ago |
Choongwoo Han | 3983363124 |
Add integer type to fast path of to_property_key (#2261)
Skip `to_string` for integer type primitives in `to_property_key`. It's unnecessary to convert the integer value to string and convert back to `Index(u32)` type. In this example code, it improves around 10% of runtime. ```js let arr = [1,2,3,4,5]; for (let i = 0; i < 10000000; i++) { arr[0] = 123; } ``` Before: 6.24s After: 5.38s |
2 years ago |
dependabot[bot] | 5858d82989 |
Bump once_cell from 1.13.1 to 1.14.0 (#2263)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.13.1 to 1.14.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/matklad/once_cell/blob/master/CHANGELOG.md">once_cell's changelog</a>.</em></p> <blockquote> <h2>1.14.0</h2> <ul> <li>Add extension to <code>unsync</code> and <code>sync</code> <code>Lazy</code> mut API: <ul> <li><code>force_mut</code></li> <li><code>get_mut</code></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | ab9f0d6052 |
Bump serde_json from 1.0.83 to 1.0.85 (#2247)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.83 to 1.0.85. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p> <blockquote> <h2>v1.0.85</h2> <ul> <li>Make <code>Display</code> for <code>Number</code> produce the same representation as serializing (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/919">#919</a>)</li> </ul> <h2>v1.0.84</h2> <ul> <li>Make <code>Debug</code> impl of <code>serde_json::Value</code> more compact (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/918">#918</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | eb5d24ed4a |
Bump serde from 1.0.143 to 1.0.144 (#2249)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.143 to 1.0.144. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.144</h2> <ul> <li>Change atomic ordering used by Serialize impl of atomic types to match ordering used by Debug impl of those same types (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2263">#2263</a>, thanks <a href="https://github.com/taiki-e"><code>@taiki-e</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | ae10d40dc0 |
Fix `arguments` object iterator function (#2231)
This Pull Request changes the following: - Create the `%Array.prototype.values%` function object once and use it in both the `Array` prototype and as the `@@iterator` value of `arguments` objects. This fixes a test where `arguments[Symbol.iterator]` and `[][Symbol.iterator]` would not be equal. |
2 years ago |
raskad | 95042557b5 |
Fix spread arguments in function calls (#2216)
Currently we only spread spread-expressions if they are the last argument in the function call. With this fix all arguments are spread if needed. The downside is that an array object is allocated to store all arguments if the arguments contain a spread-expression. But with dense indexed properties inplemented in #2167 this should be reasonably fast. |
2 years ago |
dependabot[bot] | a18e9130f9 |
Bump once_cell from 1.13.0 to 1.13.1 (#2242)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.13.0 to 1.13.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/matklad/once_cell/blob/master/CHANGELOG.md">once_cell's changelog</a>.</em></p> <blockquote> <h2>1.13.1</h2> <ul> <li>Make implementation compliant with <a href="https://github-redirect.dependabot.com/rust-lang/rust/issues/95228">strict provenance</a>.</li> <li>Upgrade <code>atomic-polyfill</code> to <code>1.0</code></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Iban Eguia | 47ab7e0a80 |
Removed some unsafe_empty_trace!() calls to improve performance (#2233)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel neccesary. ---> This Pull Request fixes #1615. It changes the following: - Removes the `Trace` implementation from types that don't need it (except for `JsSymbol` and `JsString`, which are needed elsewere). - Uses `#[unsafe_ignore_trace]` in places where we need to implement `Trace` for part of a structure. - Implements a custom `Trace` in enums where deriving it is not possible, since `#[unsafe_ignore_trace]` doesn't work for enums. Co-authored-by: raskad <32105367+raskad@users.noreply.github.com> |
2 years ago |
dependabot[bot] | e444f8bff3 |
Bump chrono from 0.4.21 to 0.4.22 (#2238)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.21 to 0.4.22. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/releases">chrono's releases</a>.</em></p> <blockquote> <h2>0.4.22</h2> <p>Unfortunately the introduction of the iana-time-zone dependency in 0.4.21 caused some new regressions with lesser known platforms. This release fixes all of the issues we've encountered, improving the situation on some WebAssembly targets, SGX and on macOS/iOS. We've improved our CI setup to hopefully catch more of these issues before release in the future.</p> <ul> <li>Make wasm-bindgen optional on <code>wasm32-unknown-unknown</code> target (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/771">#771</a>)</li> <li>Avoid iana-time-zone dependency on <code>x86_64-fortanix-unknown-sgx</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/767">#767</a>, thanks to <a href="https://github.com/trevor-crypto"><code>@trevor-crypto</code></a>)</li> <li>Update <code>iana-time-zone</code> version to 0.1.44 to avoid cyclic dependencies (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/773">#773</a>, thanks to <a href="https://github.com/Kijewski"><code>@Kijewski</code></a> for the upstream PRs)</li> <li>Clarify documentation about year range in formatting/parsing (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/765">#765</a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/blob/main/CHANGELOG.md">chrono's changelog</a>.</em></p> <blockquote> <h2>0.4.22</h2> <ul> <li>Allow wasmbindgen to be optional on <code>wasm32-unknown-unknown</code> target [(<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/771">#771</a>)](<a href="https://github-redirect.dependabot.com/chronotope/chrono/pull/771">chronotope/chrono#771</a>)</li> <li>Fix compile error for <code>x86_64-fortanix-unknown-sgx</code> [(<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/767">#767</a>)](<a href="https://github-redirect.dependabot.com/chronotope/chrono/pull/767">chronotope/chrono#767</a>)</li> <li>Update <code>iana-time-zone</code> version to 1.44 [(<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/773">#773</a>)](<a href="https://github-redirect.dependabot.com/chronotope/chrono/pull/773">chronotope/chrono#773</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | 2dcdf51407 |
Add field accessors to destructing assignment (#2213)
This Pull Request changes the following: - Implement parsing/cover-conversion for field accessor member expressions in [DestructuringAssignmentTarget](https://tc39.es/ecma262/#prod-DestructuringAssignmentTarget). - Modify the `CopyDataProperties` opcode to account for excluded keys that are only known at runtime. |
2 years ago |
raskad | 492d843ae0 |
Fix `yield` expression to end on line terminator (#2232)
This Pull Request changes the following: - Fix `yield` expression to end on line terminator |
2 years ago |
raskad | 5909e9a963 |
Implement Async Generators (#2200)
This Pull Request fixes #1560. It changes the following: - Implement `AsyncGeneratorFunction` builtin object. - Implement `AsyncGenerator` builtin object. - Implement async generator execution. - Add some parse errors for async generators. The `AsyncGenerator.prototype.return()` method currently does not work correctly with `finally` blocks, but I think we should merge this first to not increase the complexity of the pr too much. |
2 years ago |
raskad | d6fc7af2a1 |
Fix Rust 1.63 clippy lints (#2230)
This Pull Request changes the following: - Fix Rust 1.63 clippy lints |
2 years ago |
dependabot[bot] | f3e5ccbcdc |
Bump chrono from 0.4.20 to 0.4.21 (#2227)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.20 to 0.4.21. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/releases">chrono's releases</a>.</em></p> <blockquote> <p>0.4.21 is a bugfix release that mainly fixes one regression from 0.4.20:</p> <ul> <li>Fall back to UTC in case no timezone is found. Unfortunately this is a regression from the changes we made in 0.4.20 where we now parse the timezone database ourselves. Before 0.4.20, <code>TimeZone::now()</code> fell back to UTC in the case it could not find the current timezone, but the new implementation panicked in that case.</li> <li>Correctly detect timezone on Android (also <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/756">#756</a>). Android does have the timezone database installed, but it's in a different path, and it does not use <code>/etc/localtime</code> to keep track of the current timezone. Instead we now use the iana-time-zone crate as a dependency, since it already has quite a bit of logic for finding the current timezone on a host of platforms.</li> </ul> <p>Additionally, there is a documentation fix that reverts an incorrect guarantee:</p> <ul> <li>Document that <code>%Y</code> can have a negative value, both in formatting and in parsing (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/760">#760</a>, thanks to <a href="https://github.com/alex"><code>@alex</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/blob/main/CHANGELOG.md">chrono's changelog</a>.</em></p> <blockquote> <h1>ChangeLog for Chrono</h1> <p>This documents all notable changes to <a href="https://github.com/chronotope/chrono">Chrono</a>.</p> <p>Chrono obeys the principle of <a href="http://semver.org/">Semantic Versioning</a>, with one caveat: we may move previously-existing code behind a feature gate and put it behind a new feature. This new feature will always be placed in the <code>previously-default</code> feature, which you can use to prevent breakage if you use <code>no-default-features</code>.</p> <p>There were/are numerous minor versions before 1.0 due to the language changes. Versions with only mechanical changes will be omitted from the following list.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | a15dd2f305 |
Bump serde from 1.0.142 to 1.0.143 (#2225)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.142 to 1.0.143. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.143</h2> <ul> <li>Invert build.rs cfgs in serde_test to produce the most modern configuration in the default case (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2253">#2253</a>, thanks <a href="https://github.com/taiki-e"><code>@taiki-e</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | 3d6a8d5232 |
Parse class private async generator methods (#2220)
Currently async generator class methods are not being parsed correctly. In comparison to the current main branch this only fixes a few tests, but after #2200 is merged, it should be aroud 1000 additional passing tests. |
2 years ago |
dependabot[bot] | a1f52ef51d |
Bump chrono from 0.4.19 to 0.4.20 (#2222)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.19 to 0.4.20. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/releases">chrono's releases</a>.</em></p> <blockquote> <h2>0.4.20</h2> <p>chrono is a date and time library for Rust and 0.4.20 is the first chrono release since Sep 2020. There has been a long hiatus since the previous maintainer was no longer able to spend much time on the crate; thanks to <a href="https://github.com/quodlibetor"><code>@quodlibetor</code></a> for their stewardship of the chrono crate for many years! The new maintainers are <a href="https://github.com/djc"><code>@djc</code></a> and <a href="https://github.com/esheppa"><code>@esheppa</code></a>. Our first priority has been fixing the soundness issues with calls to <code>localtime_r()</code> as first reported in <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/499">#499</a> and the <a href="https://rustsec.org/advisories/RUSTSEC-2020-0159">RUSTSEC-2020-0159 </a> advisory. In order to do this we adapted code from the tz-rs crate maintained by <a href="https://github.com/x-hgg-x"><code>@x-hgg-x</code></a> for use within chrono -- thanks for working on that! With the new implementation, chrono uses safe Rust code to parse the timezone data files on Unix platforms directly instead of relying on libc.</p> <p>Due to compatibility reasons, this release does not yet remove the time 0.1 dependency, though chrono 0.4.20 does not depend on the vulnerable parts of the time 0.1.x versions. In a future 0.5 release, we will remove the time dependency.</p> <p>The minimum supported Rust version for 0.4.20 is 1.32.0, which is intentionally still quite conservative. If you are using chrono 0.4 with a Rust version older than 1.52, we'd like to hear from you since we'd like to further modernize the code base to ease maintenance.</p> <h2>Fixes</h2> <ul> <li>Fix unsound call to <code>localtime_r()</code> by parsing timezone files in Rust on Unix (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/677">#677</a> and <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/728">#728</a>)</li> <li>Allow RFC 2822 parser to deal with comments (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/733">#733</a> then <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/737">#737</a>, thanks to <a href="https://github.com/Finomnis"><code>@Finomnis</code></a>)</li> <li>Avoid panicking during parsing (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/686">#686</a>, thanks to <a href="https://github.com/botahamec"><code>@botahamec</code></a>)</li> <li>Avoid panics when rounding durations (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/659">#659</a>, thanks to <a href="https://github.com/ARBaart"><code>@ARBaart</code></a>)</li> <li>Fix <code>Duration::abs()</code> behavior in case of negative durations with nanoseconds (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/734">#734</a>, thanks to <a href="https://github.com/abreis"><code>@abreis</code></a>)</li> </ul> <h2>Additions</h2> <ul> <li>Make <code>ParserErrorKind</code> public and available through <code>ParseError::kind()</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/588">#588</a>, thanks to <a href="https://github.com/sbrocket"><code>@sbrocket</code></a>)</li> <li>Expose associated <code>MIN</code> and <code>MAX</code> const values in favor of free-standing consts (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/726">#726</a>)</li> <li>Add (optional) support for rkyv (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/644">#644</a> and <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/701">#701</a>, thanks to <a href="https://github.com/dovahcrow"><code>@dovahcrow</code></a>)</li> <li>Support month-based calculations against <code>NaiveDate</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/732">#732</a> with follow up in <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/752">#752</a>, thanks to <a href="https://github.com/avantgardnerio"><code>@avantgardnerio</code></a>)</li> <li>Add <code>NaiveWeek</code> type to facilitate week-based calculations (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/666">#666</a>, thanks to <a href="https://github.com/sestrella"><code>@sestrella</code></a>)</li> <li>Add <code>NaiveDateTime::and_local_timezone()</code> method (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/711">#711</a>, thanks to <a href="https://github.com/botahamec"><code>@botahamec</code></a>)</li> <li>Add <code>DateTime::from_local()</code> method (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/572">#572</a>, thanks to <a href="https://github.com/retrhelo"><code>@retrhelo</code></a>)</li> <li>Extend serde integration for <code>NaiveDateTime</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/664">#664</a>, thanks to <a href="https://github.com/nickelc"><code>@nickelc</code></a>)</li> <li>Implement <code>DoubleEndedIterator</code> for <code>NaiveDateDaysIterator</code>/<code>NaiveDateWeeksIterator</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/697">#697</a>, thanks to <a href="https://github.com/teobouvard"><code>@teobouvard</code></a>)</li> <li>Implement <code>std::iter::Sum</code> for <code>Duration</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/522">#522</a>, thanks to <a href="https://github.com/jakevossen5"><code>@jakevossen5</code></a>)</li> <li>Add <code>years_since()</code> method to <code>DateTime</code>/<code>Date</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/557">#557</a> then <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/707">#707</a>, thanks to <a href="https://github.com/yozhgoor"><code>@yozhgoor</code></a>)</li> <li>Implement <code>AddAssign</code>/<code>SubAssign</code> for <code>DateTime</code>/<code>Date</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/698">#698</a>, thanks to <a href="https://github.com/MrGunflame"><code>@MrGunflame</code></a>)</li> <li>Fix imports on WASM targets (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/672">#672</a>, thanks to <a href="https://github.com/danielalvsaaker"><code>@danielalvsaaker</code></a>)</li> <li>Implement std::error::Error for ParseWeekdayError (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/745">#745</a>)</li> </ul> <h2>Non-functional improvements</h2> <ul> <li>Improve CI to better exercise WASM targets (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/662">#662</a>, thanks to <a href="https://github.com/AmateurECE"><code>@AmateurECE</code></a>)</li> <li>More WASM testing improvements, enable dependencies by default (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/746">#746</a>)</li> <li>Fix compiling for wasm32-unknown-emscripten target (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/568">#568</a>, thanks to <a href="https://github.com/orion78fr"><code>@orion78fr</code></a>)</li> <li>Use stub implementation for anything not unix and not windows (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/593">#593</a>, thanks to <a href="https://github.com/yu-re-ka"><code>@yu-re-ka</code></a>)</li> <li>Remove now unused libc dependency (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/710">#710</a>, thanks to <a href="https://github.com/metent"><code>@metent</code></a>)</li> <li>Clean up some clippy warnings (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/721">#721</a>, thanks to <a href="https://github.com/botahamec"><code>@botahamec</code></a>)</li> <li>Clarify documentation for <code>Utc::now()</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/647">#647</a>, thanks to <a href="https://github.com/ModProg"><code>@ModProg</code></a>)</li> <li>Clarify documentation for <code>DateTime::with_timezone()</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/747">#747</a>, thanks to <a href="https://github.com/kevincox"><code>@kevincox</code></a>)</li> <li>Improve examples for <code>naive</code> serde integration (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/616">#616</a>, thanks to <a href="https://github.com/nickelc"><code>@nickelc</code></a>)</li> <li>Clean up <code>extern crate</code> statements and outdated comments (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/665">#665</a>, thanks to <a href="https://github.com/nickelc"><code>@nickelc</code></a>)</li> <li>Fix typo in deprecation notice (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/744">#744</a>, thanks to <a href="https://github.com/Mike-Dax"><code>@Mike-Dax</code></a>)</li> <li>Fix some typos in documentation (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/680">#680</a> and <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/695">#695</a>, thanks to <a href="https://github.com/cuishuang"><code>@cuishuang</code></a> and <a href="https://github.com/fxredeemer"><code>@fxredeemer</code></a>)</li> <li>Implement caching for CI (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/609">#609</a>, thanks to <a href="https://github.com/Milo123459"><code>@Milo123459</code></a>)</li> </ul> <h2>0.4.20-rc.1</h2> <p>0.4.20 is the first chrono release since Sep 2020. There has been a long hiatus since the previous maintainer was no longer able to spend much time on the crate; thanks to <a href="https://github.com/quodlibetor"><code>@quodlibetor</code></a> for their stewardship of the chrono crate for many years! The new maintainers are <a href="https://github.com/djc"><code>@djc</code></a> and <a href="https://github.com/esheppa"><code>@esheppa</code></a>. Our first priority has been fixing the soundness issues with calls to <code>localtime_r()</code> as first reported in <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/499">#499</a> and the <a href="https://rustsec.org/advisories/RUSTSEC-2020-0159">RUSTSEC-2020-0159 </a> advisory. In order to do this we adapted code from the tz-rs crate maintained by <a href="https://github.com/x-hgg-x"><code>@x-hgg-x</code></a> for use within chrono -- thanks for working on that! With the new implementation, chrono uses safe Rust code to parse the timezone data files on Unix platforms directly instead of relying on libc.</p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/blob/main/CHANGELOG.md">chrono's changelog</a>.</em></p> <blockquote> <h2>0.4.20 (unreleased)</h2> <ul> <li>Add more formatting documentation and examples.</li> <li>Add support for microseconds timestamps serde serialization/deserialization (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/304">#304</a>)</li> <li>Fix <code>DurationRound</code> is not TZ aware (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/495">#495</a>)</li> <li>Implement <code>DurationRound</code> for <code>NaiveDateTime</code></li> <li>Implement <code>std::iter::Sum</code> for <code>Duration</code></li> <li>Add <code>DateTime::from_local()</code> to construct from given local date and time (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/572">#572</a>)</li> <li>Add a function that calculates the number of years elapsed between now and a given <code>Date</code> or <code>DateTime</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/557">#557</a>)</li> <li>Correct build for wasm32-unknown-emscripten target (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/568">#568</a>)</li> <li>Change <code>Local::now()</code> and <code>Utc::now()</code> documentation from "current date" to "current date and time" (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/647">#647</a>)</li> <li>Fix <code>duration_round</code> panic on rounding by <code>Duration::zero()</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/658">#658</a>)</li> <li>Add optional rkyv support.</li> <li>Add support for microseconds timestamps serde serialization for <code>NaiveDateTime</code>.</li> <li>Add support for optional timestamps serde serialization for <code>NaiveDateTime</code>.</li> <li>Fix build for wasm32-unknown-emscripten (<a href="https://github.com/yu-re-ka"><code>@yu-re-ka</code></a> <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/593">#593</a>)</li> <li>Make <code>ParseErrorKind</code> public and available through <code>ParseError::kind()</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/588">#588</a>)</li> <li>Implement <code>DoubleEndedIterator</code> for <code>NaiveDateDaysIterator</code> and <code>NaiveDateWeeksIterator</code></li> <li>Fix panicking when parsing a <code>DateTime</code> (<a href="https://github.com/botahamec"><code>@botahamec</code></a>)</li> <li>Add support for getting week bounds based on a specific <code>NaiveDate</code> and a <code>Weekday</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/666">#666</a>)</li> <li>Remove libc dependency from Cargo.toml.</li> <li>Add the <code>and_local_timezone</code> method to <code>NaiveDateTime</code></li> <li>Fix the behavior of <code>Duration::abs()</code> for negative durations with non-zero nanos</li> <li>Add compatibility with rfc2822 comments (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/733">#733</a>)</li> <li>Make <code>js-sys</code> and <code>wasm-bindgen</code> enabled by default when target is <code>wasm32-unknown-unknown</code> for ease of API discovery</li> <li>Add the <code>Months</code> struct and associated <code>Add</code> and <code>Sub</code> impls</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | fc885f19ac |
Bump serde from 1.0.141 to 1.0.142 (#2219)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.141 to 1.0.142. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.142</h2> <ul> <li>Add keywords to crates.io metadata</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 02f956e87e |
Bump dyn-clone from 1.0.8 to 1.0.9 (#2218)
Bumps [dyn-clone](https://github.com/dtolnay/dyn-clone) from 1.0.8 to 1.0.9. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/dyn-clone/releases">dyn-clone's releases</a>.</em></p> <blockquote> <h2>1.0.9</h2> <ul> <li>Add categories and keywords to crates.io metadata</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 6ee33c552f |
Bump serde_json from 1.0.82 to 1.0.83 (#2217)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.82 to 1.0.83. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p> <blockquote> <h2>v1.0.83</h2> <ul> <li>Add categories to crates.io metadata</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 3a28eb400c |
Bump serde from 1.0.140 to 1.0.141 (#2212)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.140 to 1.0.141. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.141</h2> <ul> <li>Add <code>no-std</code> category to crates.io metadata</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | e0df739b5a |
Bump serde from 1.0.139 to 1.0.140 (#2198)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.139 to 1.0.140. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.140</h2> <ul> <li>Invert serde_derive cfgs to convenience non-Cargo builds on a modern toolchain (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2251">#2251</a>, thanks <a href="https://github.com/taiki-e"><code>@taiki-e</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Halid Odat | efff9d6269 |
Fix length/index in `32bit` architectures (#2196)
This PR fixes the length/index types from `usize` to `u64`, because in JavaScript the length can be from `0` to `2^53 - 1` it cannot be represented in a `usize`. On `64-bit` architectures this is fine because it is already a unsigned 64bit number and these changes essentially do nothing. But on 32bit architectures this was causing the length to be truncated giving an unexpected result. fixes/closes #2182 It changes the following: - Make length a `u64` to be able to represent all possible length values - Change `JsValue::to_length()` t return `u64` - Change `JsValue::to_index()` t return `u64` |
2 years ago |
dependabot[bot] | 709cc343da |
Bump dyn-clone from 1.0.7 to 1.0.8 (#2188)
Bumps [dyn-clone](https://github.com/dtolnay/dyn-clone) from 1.0.7 to 1.0.8. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/dyn-clone/releases">dyn-clone's releases</a>.</em></p> <blockquote> <h2>1.0.8</h2> <ul> <li>Add functions that do <code>Arc::make_mut</code> and <code>Rc::make_mut</code> but work with element type <code>dyn Trait</code> (<a href="https://github-redirect.dependabot.com/dtolnay/dyn-clone/issues/21">#21</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 32e0446738 |
Bump dyn-clone from 1.0.6 to 1.0.7 (#2178)
Bumps [dyn-clone](https://github.com/dtolnay/dyn-clone) from 1.0.6 to 1.0.7. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/dyn-clone/releases">dyn-clone's releases</a>.</em></p> <blockquote> <h2>1.0.7</h2> <ul> <li>Add support for <code>str</code> and <code>[T]</code> to implements traits that have <code>DynClone</code> as a supertrait (<a href="https://github-redirect.dependabot.com/dtolnay/dyn-clone/issues/19">#19</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | 6e377d6467 |
Implement Generator Function Constructor (#2174)
This Pull Request changes the following: - Modify `CreateDynamicFunction` to work with generator functions. - Add the name `anonymus` to functions created via `CreateDynamicFunction` to comply with the spec. - Fix a bug in the `Yield` parser where the parser would expect a token when no token is a legal case. - Change the `Yield::new` function to require less turbofishes. |
2 years ago |
raskad | d8af7b4ee5 |
Implement arrow function parsing based on `CoverParenthesizedExpressionAndArrowParameterList` (#2171)
Previously we parsed arrow functions without the relevant cover grammar `CoverParenthesizedExpressionAndArrowParameterList`. This leads to either arrow functions or parenthesized expressions not being parsed correctly. Implementing this is a bit tricky, as the cover grammar is being parsed in `PrimaryExpression` while arrow functions are parsed in `AssignmentExpression`. This means that we have to return the covered parameter list that was parsed via `CoverParenthesizedExpressionAndArrowParameterList` in `PrimaryExpression` to `AssignmentExpression`. Fortunately this works pretty good and now the full arrow function test suite, with the exception of a few tests that require other features, passes. This Pull Request changes the following: - Implement `CoverParenthesizedExpressionAndArrowParameterList` parsing. - Implement `CoverInitializedName` parsing in object literals. - Fix a bug where an environment would be wrongly removed from the environment stack when an expression in default function parameters throws. - Add more valid cases where on object literal can be converted to an object declaration pattern. - Implement `Expression` parsing manually to avoid some cases where the parser would prematurely throw an error. - Implement parsing of arrow functions via `CoverParenthesizedExpressionAndArrowParameterList`. - Remove unneeded `AllowIn` flag on array and object declaration pattern parsers. - Fix an of-by-one bug in the trace output. |
3 years ago |
dependabot[bot] | 6c65aa350b |
Bump serde from 1.0.138 to 1.0.139 (#2173)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.138 to 1.0.139. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p> <blockquote> <h2>v1.0.139</h2> <ul> <li>Add <code>new</code> constructor function for all <code>IntoDeserializer</code> impls (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2246">#2246</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
3 years ago |
Halid Odat | 48d8b420c5 |
Implement `JsArrayBuffer` (#2170)
This PR adds the `ArrayBuffer` rust wrapper. It also provides a capability to construct a `JsArrayBuffer` from a user defined blob of data ( `Vec<u8>` ) and it is not cloned, it is directly used as the internal buffer. This allows us to replace the inifficent `Vec<u8>` to `JsArray` then to `TypedArray` (in typed arrays `from_iter`), with a `JsArrayBuffer` created from user data to `TypedArray`. With this `Vec<u8>` to `JsTypedArray` should be fully fixed as discussed in #2058. |
3 years ago |
Anuvrat Singh | 52bc15bc23 |
Safe wrapper for `JsSet` (#2162)
This PR adds a safe wrapper around JavaScript `JsSet` from `builtins::set`, and is being tracked at #2098. Implements following methods - [x] `Set.prototype.size` - [x] `Set.prototype.add(value)` - [x] `Set.prototype.clear()` - [x] `Set.prototype.delete(value)` - [x] `Set.prototype.has(value)` - [x] `Set.prototype.forEach(callbackFn[, thisArg])` Implement wrapper for `builtins::set_iterator`, to be used by following. - [x] `Set.prototype.values()` - [x] `Set.prototype.keys()` - [x] `Set.prototype.entries()` *Note: Are there any other functions that should be added? Also adds `set_create()` and made `get_size()` public in `builtins::set`. |
3 years ago |
dependabot[bot] | d7fb049082 |
Bump unicode-normalization from 0.1.20 to 0.1.21 (#2160)
Bumps [unicode-normalization](https://github.com/unicode-rs/unicode-normalization) from 0.1.20 to 0.1.21. <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/unicode-rs/unicode-normalization/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=unicode-normalization&package-manager=cargo&previous-version=0.1.20&new-version=0.1.21)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> |
3 years ago |
Halid Odat | 5bbc225b24 |
Dense/Packed JavaScript arrays (#2167)
This PR implements an optimization done by V8 and spidermonkey. Which stores indexed properties in two class storage methods dense and sparse. The dense method stores the property in a contiguous array ( `Vec<T>` ) where the index is the property key. This storage method is the default. While on the other hand we have sparse storage method which stores them in a hash map with key `u32` (like we currently do). This storage method is a backup and is slower to access because we have to do a hash map lookup, instead of an array access. In the dense array we can store only data descriptors that have a value field and are `writable`, `configurable` and `enumerable` (which by default array elements are). Since all the fields of the property descriptor are the same except value field, we can omit them an just store the `JsValue`s in `Vec<JsValue>` this decreases the memory consumption and because it is smaller we are less likely to have cache misses. There are cases where we have to convert from dense to sparse (the slow case): - If we insert index elements in a non-incremental way, like `array[1000] = 1000` (inserting an element to an index that is already occupied only replaces it does not make it sparse) - If we delete from the middle of the array (making a hole), like `delete array[10]` (only converts if there is actualy an element there, so calling delete on a non-existent index property will do nothing) Once it becomes sparse is *stays* sparse there is no way to convert it again. (the computation needed to check whether it can be converted outweighs the benefits of this optimization) I did some local benchmarks and on array creation/pop and push there is ~45% speed up and the impact _should_ be bigger the more elements we have. For example the code below on `main` takes `~21.5s` while with this optimization is `~3.5s` (both on release build). ```js let array = []; for (let i = 0; i < 50000; ++i) { array[i] = i; } ``` In addition I also made `Array::create_array_from_list` do a direct setting of the properties (small deviation from spec but it should have the same behaviour), with this #2058 should be fixed, conversion from `Vec` to `JsArray`, not `JsTypedArray` for that I will work on next :) |
3 years ago |