mirror of https://github.com/boa-dev/boa.git
Tree:
e89803a51f
add-vhs-ci
benchmarks
control-flow-graph
expect-lints
feature/node_span
feature/snapshot
features
gh-readonly-queue/main/pr-2877-b0ddf5eed00a53281d67fc7d846233fc0d99ce9c
gh-readonly-queue/main/pr-3144-8e48cec73fae708420b9af88813d4870243c491a
main
nan-boxing
optimization/static-shapes
real_conformance
reduce-environment-allocations
refactor/interner
refactor/register-vm
release-0.20
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.3.0
v0.4.0
v0.5.0
v0.5.1
v0.6.0
v0.7.0
v0.8.0
v0.9.0
${ noResults }
238 Commits (e89803a51f5f88412bc323633bbd2a98a3c00ea7)
Author | SHA1 | Message | Date |
---|---|---|---|
Haled Odat | 85b2861b3e |
Implement static shapes
|
2 years ago |
Haled Odat |
67c5652911
|
Remove unneded `num_bindings` in `Opcode`s and `CodeBlock` (#2967)
* Remove redundant `num_bindings` field from `CodeBlock` * Remove redundant num_bindings parameter from push_function_inherits * Remove redundant num_bindings operand from environment opcodes * Make pop_compile_environment() return an index * Move boolean `CodeBlock` flags to bitflags * Fix ci * Add doc |
2 years ago |
dependabot[bot] |
8486c28fdc
|
Bump regex from 1.8.2 to 1.8.3 (#2964)
Bumps [regex](https://github.com/rust-lang/regex) from 1.8.2 to 1.8.3. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.8.2...1.8.3) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
2 years ago |
dependabot[bot] |
8753406504
|
Bump regex from 1.8.1 to 1.8.2 (#2958)
Bumps [regex](https://github.com/rust-lang/regex) from 1.8.1 to 1.8.2. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.8.1...1.8.2) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
2 years ago |
José Julián Espina |
09658b02bc
|
Implement dynamic imports (#2932)
* WIP: 76d7eceed6 Implement dynamic imports * Expand `ActiveRunnable` to missing places * Fix memory leak * Fix docs * Parse `import` as call expression * Fix regressions * Fix copypasted doc * clippy fix * Adjust ignored features * Migrate away from `top_level_*` operations * Fix more module tests * Fix doc link |
2 years ago |
dependabot[bot] |
43d4324bcb
|
Bump clap from 4.2.7 to 4.3.0 (#2953)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.7 to 4.3.0. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.2.7...clap_complete-v4.3.0) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
2 years ago |
José Julián Espina |
06161edcbd
|
Implement module execution (#2922)
* Implement draft of module execution * Fix recursion bug * Re-enable JsObject's debug printing * Modify API and document some methods * Add missing documentation * Add newline to module scripts * npx prettier * Apply reviews * Add reference to parent struct on source module * Document more steps on the example * cargo clippy * Revert `BoaGc` changes * Lower `GcRefCell` to `Inner` of `SourceTextModule` * Replace weak ref to module with strong ref * Apply review * Clarify reasoning of manual `Trace` impl * Apply review pt. 2 * Revert gc changes |
2 years ago |
José Julián Espina |
ab87b2fd5b
|
Extract "About Boa" section into a separate file (#2938)
* Extract "About Boa" section into a separate file * Add newline * cargo fmt |
2 years ago |
Haled Odat |
b4b77e77b4
|
Implement runtime limits for recursion (#2904)
* Implement runtime limits for recursion * Remove "tail-call-optimization" from ignore list * Run prettier * Add example and tests |
2 years ago |
Haled Odat |
802d796d51
|
Implement runtime limits for loops (#2857)
|
2 years ago |
dependabot[bot] |
c0daf11141
|
Bump clap from 4.2.5 to 4.2.7 (#2896)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.5 to 4.2.7. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.2.5...v4.2.7) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
2 years ago |
dependabot[bot] | 04ddeeb3b3 |
Bump clap from 4.2.4 to 4.2.5 (#2879)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.4 to 4.2.5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.2.5</h2> <h2>[4.2.5] - 2023-04-27</h2> <h3>Fixes</h3> <ul> <li>Improve panic when a group requires a non-existent ID</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.2.5] - 2023-04-27</h2> <h3>Fixes</h3> <ul> <li>Improve panic when a group requires a non-existent ID</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Haled Odat | ed37448175 |
Implement `Hidden classes` (#2723)
This PR implements `Hidden Classes`, I named them as `Shapes` (like Spidermonkey does), calling them maps like v8 seems confusing because there already is a JS builtin, likewise with `Hidden classes` since there are already classes in JS. There are two types of shapes: `shared` shapes that create the transition tree, and are shared between objects, this is mainly intended for user defined objects this makes more sense because shapes can create transitions trees, doing that for the builtins seems wasteful (unless users wanted to creating an object with the same property names and the same property attributes in the same order... which seems unlikely). That's why I added `unique` shapes, only one object has it. This is similar to previous solution, but this architecture enables us to use inline caching. There will probably be a performance hit until we implement inline caching. There still a lot of work that needs to be done, on this: - [x] Move Property Attributes to shape - [x] Move Prototype to shape - [x] ~~Move extensible flag to shape~~, On further evaluation this doesn't give any benefit (at least right now), since it isn't used by inline caching also adding one more transition. - [x] Implement delete for unique shapes. - [x] If the chain is too long we should probably convert it into a `unique` shape - [x] Figure out threshold ~~(maybe more that 256 properties ?)~~ curently set to an arbitrary number (`1024`) - [x] Implement shared property table between shared shapes - [x] Add code Document - [x] Varying size storage for properties (get+set = 2, data = 1) - [x] Add shapes to more object: - [x] ordinary object - [x] Arrays - [x] Functions - [x] Other builtins - [x] Add `shapes.md` doc explaining shapes in depth with mermaid diagrams :) - [x] Add `$boa.shape` module - [x] `$boa.shape.id(o)` - [x] `$boa.shape.type(o)` - [x] `$boa.shape.same(o1, o2)` - [x] add doc to `boa_object.md` |
2 years ago |
Iban Eguia Moraza | 63d9d67ecb |
Added a Boa runtime (#2743)
This Pull Request fixes/closes #718. It changes the following: - Adds a new `boa_runtime` crate, that will only include `console` for now - Changes the `boa_cli` crate to use the new `boa_runtime` crate for the console, instead of the `console` feature of `boa_engine` - Removes the `console` feature in `boa_engine` - Adds a new `boa_testing` helper crate with some useful functions for testing `boa`. This part duplicates the code from `boa_engine`, but I could not make `boa_engine` work with this crate as a dependency due to circular dependencies. Maybe doing it a bit generic could work, but didn't have enough time to check it. To be checked: wether the WASM example works as expected with the console. |
2 years ago |
José Julián Espina | 53e4825a19 |
Implement var initializers in for-in loops (#2842)
This Pull Request implements [Initializers in ForIn Statement Heads](https://tc39.es/ecma262/#sec-initializers-in-forin-statement-heads) from the Annex B. This also cleans up the "annex-b" feature to be able to disable it with `--no-default-features`, since I couldn't test the error messages when the feature is disabled. |
2 years ago |
dependabot[bot] | 3db79f61a6 |
Bump regex from 1.7.3 to 1.8.0 (#2855)
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.3 to 1.8.0. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-lang/regex/blob/master/CHANGELOG.md">regex's changelog</a>.</em></p> <blockquote> <h1>1.8.0 (2023-04-20)</h1> <p>This is a sizeable release that will be soon followed by another sizeable release. Both of them will combined close over 40 existing issues and PRs.</p> <p>This first release, despite its size, essentially represent preparatory work for the second release, which will be even bigger. Namely, this release:</p> <ul> <li>Increases the MSRV to Rust 1.60.0, which was released about 1 year ago.</li> <li>Upgrades its dependency on <code>aho-corasick</code> to the recently release 1.0 version.</li> <li>Upgrades its dependency on <code>regex-syntax</code> to the simultaneously released <code>0.7</code> version. The changes to <code>regex-syntax</code> principally revolve around a rewrite of its literal extraction code and a number of simplifications and optimizations to its high-level intermediate representation (HIR).</li> </ul> <p>The second release, which will follow ~shortly after the release above, will contain a soup-to-nuts rewrite of every regex engine. This will be done by bringing <a href="https://github.com/BurntSushi/regex-automata"><code>regex-automata</code></a> into this repository, and then changing the <code>regex</code> crate to be nothing but an API shim layer on top of <code>regex-automata</code>'s API.</p> <p>These tandem releases are the culmination of about 3 years of on-and-off work that <a href="https://redirect.github.com/rust-lang/regex/issues/656">began in earnest in March 2020</a>.</p> <p>Because of the scale of changes involved in these releases, I would love to hear about your experience. Especially if you notice undocumented changes in behavior or performance changes (positive <em>or</em> negative).</p> <p>Most changes in the first release are listed below. For more details, please see the commit log, which reflects a linear and decently documented history of all changes.</p> <p>New features:</p> <ul> <li>[FEATURE <a href="https://redirect.github.com/rust-lang/regex/issues/501">#501</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/501">rust-lang/regex#501</a>): Permit many more characters to be escaped, even if they have no significance. More specifically, any ASCII character except for <code>[0-9A-Za-z<>]</code> can now be escaped. Also, a new routine, <code>is_escapeable_character</code>, has been added to <code>regex-syntax</code> to query whether a character is escapeable or not.</li> <li>[FEATURE <a href="https://redirect.github.com/rust-lang/regex/issues/547">#547</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/547">rust-lang/regex#547</a>): Add <code>Regex::captures_at</code>. This filles a hole in the API, but doesn't otherwise introduce any new expressive power.</li> <li>[FEATURE <a href="https://redirect.github.com/rust-lang/regex/issues/595">#595</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/595">rust-lang/regex#595</a>): Capture group names are now Unicode-aware. They can now begin with either a <code>_</code> or any "alphabetic" codepoint. After the first codepoint, subsequent codepoints can be any sequence of alpha-numeric codepoints, along with <code>_</code>, <code>.</code>, <code>[</code> and <code>]</code>. Note that replacement syntax has not changed.</li> <li>[FEATURE <a href="https://redirect.github.com/rust-lang/regex/issues/810">#810</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/810">rust-lang/regex#810</a>):</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li>See full diff in <a href="https://github.com/rust-lang/regex/commits">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=regex&package-manager=cargo&previous-version=1.7.3&new-version=1.8.0)](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> |
2 years ago |
dependabot[bot] | f97ad0dde7 |
Bump clap from 4.2.3 to 4.2.4 (#2851)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.3 to 4.2.4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.2.4</h2> <h2>[4.2.4] - 2023-04-19</h2> <h3>Documentation</h3> <ul> <li>Corrected docs for <code>Command::style</code></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.2.4] - 2023-04-19</h2> <h3>Documentation</h3> <ul> <li>Corrected docs for <code>Command::style</code></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 95a81984a0 |
Bump clap from 4.2.2 to 4.2.3 (#2844)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.2 to 4.2.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.2.3</h2> <h2>[4.2.3] - 2023-04-18</h2> <h3>Features</h3> <ul> <li><code>Command::styles</code> for theming help/errors (behind <code>unstable-styles</code>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.2.3] - 2023-04-18</h2> <h3>Features</h3> <ul> <li><code>Command::styles</code> for theming help/errors (behind <code>unstable-styles</code>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Iban Eguia Moraza | b1f4e0db6b |
Updated README (#2825)
This Pull Request updates the README by including the latest output of the `--help` command line argument in boa_cli. |
2 years ago |
José Julián Espina | 6d3550d0cb |
Implement async functions using generators (#2821)
This should hopefully fix more async/futures issues related to resuming execution in the future, since we can leverage generator logic to handle this for us. It changes the following: - Refactors `GeneratorContext` to handle context preparation. - Reuses the functionality of `GeneratorContext` in `Await`. - Removes `EarlyReturnType` in favour of a single `r#await` bool flag in `CallFrame`. |
2 years ago |
dependabot[bot] | 236012d853 |
Bump serde_json from 1.0.95 to 1.0.96 (#2815)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.95 to 1.0.96. <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.96</h2> <ul> <li>Guarantee that <code>to_writer</code> only writes valid UTF-8 strings (<a href="https://redirect.github.com/serde-rs/json/issues/1011">#1011</a>, thanks <a href="https://github.com/stepancheg"><code>@stepancheg</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | b6f929508d |
Bump clap from 4.2.1 to 4.2.2 (#2818)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.1 to 4.2.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.2.2</h2> <h2>[4.2.2] - 2023-04-13</h2> <h3>Internal</h3> <ul> <li>Update dependencies</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.2.2] - 2023-04-13</h2> <h3>Internal</h3> <ul> <li>Update dependencies</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
José Julián Espina | 0d6ba53ff2 |
Allow passing owned `HostHooks` and `JobQueues` to `Context` (#2811)
This allows `thread_local` contexts to have owned `HostHooks` and `JobQueues`. It changes the following: - Creates a new `MaybeShared` struct that can hold either a reference or an `Rc`. - Changes the `job_queue` and `host_hooks` parameters of `Context` to use `MaybeShared`. This PR also allows us to make `SimpleJobQueue` the default promise runner, which I think it's pretty cool :) cc @lastmjs |
2 years ago |
José Julián Espina | 34d6b93f36 |
Fix cross-realm construction bugs (#2786)
This Pull Request fixes test [`assert-throws-same-realm.js`](
|
2 years ago |
Haled Odat | 570bc85ebe |
Implement debug object for CLI (#2772)
Currently some debugging stuff in JavaScript land is difficult to impossible, like triggering a GC collect, this is not impossible to do in JavaScript the way I triggered it was by creating a huge amount of object `for (let i = 0; i < 100000; ++i) { ({}) }` but this is cumbersome and not guaranteed to trigger a gc. This PR implements `--debug-object` flag that injects the `$boa` debug object in the context, the object is separated into modules currently `gc`, `function`, `object`. We can now do `$boa.gc.collect()`, which force triggers a GC collect. Or sometimes I wanted a trace (the current solution is great, you can trace stuff like `>>> 1 + 1` but that is also it's limitation), it traces everything, I sometimes have a scenario and just want to trace a single function in that scenario, that's why I added the `$boa.function.trace(func, this, ...args)` It only traces the function. ```js >> $boa.function.trace((a, b) => a + b, undefined, 1, 2) -------------------------Compiled Output: ''-------------------------- Location Count Opcode Operands 000000 0000 DefInitArg 0000: 'a' 000005 0001 DefInitArg 0001: 'b' 000010 0002 RestParameterPop 000011 0003 GetName 0000: 'a' 000016 0004 GetName 0001: 'b' 000021 0005 Add 000022 0006 Return 000023 0007 PushUndefined 000024 0008 Return ... (cut for brevity) ... ``` It also implements `$boa.function.flowgraph(func, options)`: ```js $boa.function.flowgraph(func, 'graphviz') $boa.function.flowgraph(func, { format: 'mermaid', direction: 'TopBottom' }) ``` Printing the object pointer: ```js $boa.object.id({}) // '0x566464F33' ``` It currently implements some functionality which we can grow it with our debugging needs since we are not restricted by a spec we can add whatever we want :) I was originally going to implement this in #2723 (but the PR is too big), for shapes having functions like: ```js $boa.shape.type({}) // Shared shape $boa.shape.id({}) // 0x8578FG355 (objects, shape pointer) $boa.shape.flowgraph({}) // printing the shape transition chain, like $boa.function.flowgraph ``` Shapes chains are very hard to debug once they are big... so having this type of debugging capability would make it much easier. |
2 years ago |
José Julián Espina | 0babe195fb |
Implement `escape` and `unescape` (#2768)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> This Pull Request implements the [`escape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/escape) and [`unescape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape) functions. Both are technically deprecated, but they're also part of the [Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers) section, so it is preferable to have them in place. |
2 years ago |
dependabot[bot] | d119934f98 |
Bump clap from 4.2.0 to 4.2.1 (#2766)
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.0 to 4.2.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.2.1</h2> <h2>[4.2.1] - 2023-03-28</h2> <h3>Fixes</h3> <ul> <li>Don't highlight uninteresting parts of the error message</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.2.1] - 2023-03-28</h2> <h3>Fixes</h3> <ul> <li>Don't highlight uninteresting parts of the error message</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Haled Odat | 6c438b5516 |
Implement constant folding optimization (#2679)
This PR implements an optimizer, It currently implements the [constant folding optimization][cfo]. this optimization is responsible for "folding"/evaluating constant expressions. For example: ```js let x = ((1 + 2 + -4) * 8) << 4 ``` Generates the following instruction(s) (`cargo run -- -t`): ``` 000000 0000 PushOne 000001 0001 PushInt8 2 000003 0002 Add 000004 0003 PushInt8 4 000006 0004 Neg 000007 0005 Add 000008 0006 PushInt8 8 000010 0007 Mul 000011 0008 PushInt8 4 000013 0009 ShiftLeft 000014 0010 DefInitLet 0000: 'x' ``` With constant folding it generates the following instruction(s) (`cargo run -- -t -O`): ``` 000000 0000 PushInt8 -128 000002 0001 DefInitLet 0000: 'x' ``` It changes the following: - Implement ~~WIP~~ constant folding optimization, ~~only works with integers for now~~ - Add `--optimize, -O` flag to boa_cli - Add `--optimizer-statistics` flag to boa_cli for optimizer statistics - Add `--optimize, -O` flag to boa_tester After I finish with this, will try to implement other optimizations :) [cfo]: https://en.wikipedia.org/wiki/Constant_folding |
2 years ago |
dependabot[bot] | f6724566cc |
Bump clap from 4.1.14 to 4.2.0 (#2759)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.14 to 4.2.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.2.0</h2> <h2>[4.2.0] - 2023-03-28</h2> <h3>Compatibility</h3> <ul> <li>Removed the languishing <code>unstable-replace</code> feature (open to discussion at <a href="https://redirect.github.com/clap-rs/clap/issues/2836">#2836</a>)</li> <li>Removed the stablized <code>unstable-grouped</code> feature</li> </ul> <h3>Features</h3> <ul> <li>Allow any <code>StyledStr</code> to accept text styled with ANSI escape codes</li> <li>Respect <code>CLICOLOR</code>, <code>CLICOLOR_FORCE</code></li> </ul> <h3>Fixes</h3> <ul> <li>Lighten the tone for "unexpected argument" errors (open to discussion at <a href="https://redirect.github.com/clap-rs/clap/issues/4638">#4638</a>)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.2.0] - 2023-03-28</h2> <h3>Compatibility</h3> <ul> <li>Removed the languishing <code>unstable-replace</code> feature (open to discussion at <a href="https://redirect.github.com/clap-rs/clap/issues/2836">#2836</a>)</li> <li>Removed the stablized <code>unstable-grouped</code> feature</li> </ul> <h3>Features</h3> <ul> <li>Allow any <code>StyledStr</code> to accept text styled with ANSI escape codes</li> <li>Respect <code>CLICOLOR</code>, <code>CLICOLOR_FORCE</code></li> </ul> <h3>Fixes</h3> <ul> <li>Lighten the tone for "unexpected argument" errors (open to discussion at <a href="https://redirect.github.com/clap-rs/clap/issues/4638">#4638</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | ea7557dee7 |
Bump serde_json from 1.0.94 to 1.0.95 (#2753)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.94 to 1.0.95. <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.95</h2> <ul> <li>Preserve f32 precision when serializing f32 -> serde_json::Value -> JSON string in "arbitrary_precision" mode (<a href="https://redirect.github.com/serde-rs/json/issues/1004">#1004</a>, <a href="https://redirect.github.com/serde-rs/json/issues/1005">#1005</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 0d262a762b |
Bump clap from 4.1.13 to 4.1.14 (#2756)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.13 to 4.1.14. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.1.14</h2> <h2>[4.1.14] - 2023-03-28</h2> <h3>Features</h3> <ul> <li><em>(derive)</em> <code>#[group]</code> raw attribute support</li> </ul> <h3>Performance</h3> <ul> <li><em>(derive)</em> <code>clap_builder</code> was pulled out of <code>clap</code> so it could build in parallel to <code>clap_derive</code></li> <li><code>os_str_bytes</code> dependency was removed for faster builds and smaller binaries</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.1.14] - 2023-03-28</h2> <h3>Features</h3> <ul> <li><em>(derive)</em> <code>#[group]</code> raw attribute support</li> </ul> <h3>Performance</h3> <ul> <li><em>(derive)</em> <code>clap_builder</code> was pulled out of <code>clap</code> so it could build in parallel to <code>clap_derive</code></li> <li><code>os_str_bytes</code> dependency was removed for faster builds and smaller binaries</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 0a0a72722c |
Bump regex from 1.7.2 to 1.7.3 (#2748)
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.2 to 1.7.3. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-lang/regex/blob/master/CHANGELOG.md">regex's changelog</a>.</em></p> <blockquote> <h1>1.7.3 (2023-03-24)</h1> <p>This is a small release that fixes a bug in <code>Regex::shortest_match_at</code> that could cause it to panic, even when the offset given is valid.</p> <p>Bug fixes:</p> <ul> <li>[BUG <a href="https://redirect.github.com/rust-lang/regex/issues/969">#969</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/969">rust-lang/regex#969</a>): Fix a bug in how the reverse DFA was called for <code>Regex::shortest_match_at</code>.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | f52ca6b1c2 |
Bump clap from 4.1.11 to 4.1.13 (#2735)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.11 to 4.1.13. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.1.13</h2> <h2>[4.1.13] - 2023-03-18</h2> <h3>Performance</h3> <ul> <li>Reduce repeated alloc calls when building a <code>Command</code></li> <li>Reduce duplicate dependencies for faster builds</li> </ul> <h2>v4.1.12</h2> <h2>[4.1.12] - 2023-03-18</h2> <h3>Internal</h3> <ul> <li><em>(derive)</em> Update to <code>syn</code> v2</li> </ul> <h3>Performance</h3> <ul> <li><em>(derive)</em> Faster build times by dropping <code>proc-macro-error</code> dependency</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.1.13] - 2023-03-18</h2> <h3>Performance</h3> <ul> <li>Reduce repeated alloc calls when building a <code>Command</code></li> <li>Reduce duplicate dependencies for faster builds</li> </ul> <h2>[4.1.12] - 2023-03-18</h2> <h3>Internal</h3> <ul> <li><em>(derive)</em> Update to <code>syn</code> v2</li> </ul> <h3>Performance</h3> <ul> <li><em>(derive)</em> Faster build times by dropping <code>proc-macro-error</code> dependency</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | ff94d5c8e3 |
Bump regex from 1.7.1 to 1.7.2 (#2721)
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.1 to 1.7.2. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/rust-lang/regex/blob/master/CHANGELOG.md">regex's changelog</a>.</em></p> <blockquote> <h1>1.7.2 (2023-03-21)</h1> <p>This is a small release that fixes a failing test on FreeBSD.</p> <p>Bug fixes:</p> <ul> <li>[BUG <a href="https://redirect.github.com/rust-lang/regex/issues/967">#967</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/967">rust-lang/regex#967</a>): Fix "no stack overflow" test which can fail due to the small stack size.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Haled Odat | 3b5122635f |
Make tracing an opt-in feature (#2709)
This PR adds the `"trace"` feature flag that enables vm opcode tracing (off by default), most users aren't interested in tracing/debugging that's why I think it should be made out-in. |
2 years ago |
dependabot[bot] | af6b41e802 |
Bump clap from 4.1.9 to 4.1.11 (#2699)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.9 to 4.1.11. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.1.11</h2> <h2>[4.1.11] - 2023-03-17</h2> <h3>Internal</h3> <ul> <li>Update <code>bitflags</code></li> </ul> <h2>v4.1.10</h2> <h2>[4.1.10] - 2023-03-17</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> On Windows, avoid underlined text artifacts</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.1.11] - 2023-03-17</h2> <h3>Internal</h3> <ul> <li>Update <code>bitflags</code></li> </ul> <h2>[4.1.10] - 2023-03-17</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> On Windows, avoid underlined text artifacts</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Haled Odat | 7e6d3c9209 |
Add `--strict` flag to cli (#2689)
This PR adds the `--strict` flag to the CLI that enables strict mode on file/interactive mode execution. It's a bit annoying to have to prefix with `'use strict';` when trying to debug in interactive mode ```js >>> 'use strict'; .... // :( ``` It changes the following: - Adds `--strict` flag to CLI - update `README.md` |
2 years ago |
dependabot[bot] | 7ecf8becd4 |
Bump clap from 4.1.8 to 4.1.9 (#2684)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.8 to 4.1.9. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.1.9] - 2023-03-16</h2> <h3>Fixes</h3> <ul> <li><em>(assert)</em> Improve the assert when using the wrong action with <code>get_count</code> / <code>get_flag</code></li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Haled Odat | c9ae4dc2e3 |
Update `README.md` cli options (#2678)
It changes the following: - Remove Just-in-time compilation from description in `Cargo.toml` - Change `FlowgraphFormat` to be terminal friendly - Update `README.md` cli options section |
2 years ago |
dependabot[bot] | b87930349d |
Bump serde_json from 1.0.93 to 1.0.94 (#2637)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.93 to 1.0.94. <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.94</h2> <ul> <li>Fix message duplication between serde_json::Error's <code>Display</code> and <code>source()</code> (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/991">#991</a>, <a href="https://github-redirect.dependabot.com/serde-rs/json/issues/992">#992</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 23d1aa8e49 |
Bump clap from 4.1.7 to 4.1.8 (#2625)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.7 to 4.1.8. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.1.8</h2> <h2>[4.1.8] - 2023-02-27</h2> <h3>Fixes</h3> <ul> <li><em>(derive)</em> Don't <code>deny</code> lints on the users behalf</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.1.8] - 2023-02-27</h2> <h3>Fixes</h3> <ul> <li><em>(derive)</em> Don't <code>deny</code> lints on the users behalf</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 423c16af34 |
Bump clap from 4.1.6 to 4.1.7 (#2623)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.6 to 4.1.7. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.1.7</h2> <h2>[4.1.7] - 2023-02-27</h2> <h3>Fixes</h3> <ul> <li><em>(derive)</em> Hide some nightly clippy warnings</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.1.7] - 2023-02-27</h2> <h3>Fixes</h3> <ul> <li><em>(derive)</em> Hide some nightly clippy warnings</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 096f65410f |
Bump rustyline from 10.1.1 to 11.0.0 (#2612)
Bumps [rustyline](https://github.com/kkawakam/rustyline) from 10.1.1 to 11.0.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/kkawakam/rustyline/releases">rustyline's releases</a>.</em></p> <blockquote> <h2>11.0.0</h2> <h2>What's Changed</h2> <ul> <li>Refactor listeners by <a href="https://github.com/gwenn"><code>@gwenn</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/666">kkawakam/rustyline#666</a></li> <li>Introduce History trait by <a href="https://github.com/gwenn"><code>@gwenn</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/604">kkawakam/rustyline#604</a></li> <li>Fix cargo test --no-default-features by <a href="https://github.com/gwenn"><code>@gwenn</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/667">kkawakam/rustyline#667</a></li> <li>Don't set height for skim by <a href="https://github.com/figsoda"><code>@figsoda</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/668">kkawakam/rustyline#668</a></li> <li>Turn off skim's default features by <a href="https://github.com/figsoda"><code>@figsoda</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/669">kkawakam/rustyline#669</a></li> <li>Add derive feature that reexports rustyline-derive's API by <a href="https://github.com/figsoda"><code>@figsoda</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/670">kkawakam/rustyline#670</a></li> <li>docs: update branch for wez/wezterm by <a href="https://github.com/LeoDog896"><code>@LeoDog896</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/674">kkawakam/rustyline#674</a></li> <li>Upgrade to Rust edition 2021 by <a href="https://github.com/gwenn"><code>@gwenn</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/675">kkawakam/rustyline#675</a></li> <li>Replace memchr::memchr by matches! by <a href="https://github.com/gwenn"><code>@gwenn</code></a> in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/676">kkawakam/rustyline#676</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/figsoda"><code>@figsoda</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/668">kkawakam/rustyline#668</a></li> <li><a href="https://github.com/LeoDog896"><code>@LeoDog896</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/kkawakam/rustyline/pull/674">kkawakam/rustyline#674</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/kkawakam/rustyline/compare/v10.1.0...v11.0.0">https://github.com/kkawakam/rustyline/compare/v10.1.0...v11.0.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
José Julián Espina | 280199b07a |
API to construct a `NativeFunction` from a native async function (#2542)
~~Builds off of #2529.~~ Merged. This Pull Request allows passing any function returning `impl Future<Output = JsResult<JsValue>>` to the `NativeFunction` constructor, allowing native concurrency hooks into the engine. It changes the following: - Adds a `NativeFunction::from_async_fn` function. - Adds a new `JobQueue::enqueue_future_job` method. - Adds an example usage on `boa_examples`. |
2 years ago |
dependabot[bot] | e93b927e70 |
Bump clap from 4.1.4 to 4.1.6 (#2603)
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.4 to 4.1.6. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.1.6</h2> <h2>[4.1.6] - 2023-02-15</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> Don't show long help for <code>--help</code> just because hidden possible values include a description</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p> <blockquote> <h2>[4.1.6] - 2023-02-15</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> Don't show long help for <code>--help</code> just because hidden possible values include a description</li> </ul> <h2>[4.1.5] - 2023-02-15</h2> <h3>Fixes</h3> <ul> <li><em>(help)</em> Don't show long help for <code>--help</code> just because a hidden arg has a possible value with a description</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 0ca8ce23b7 |
Bump serde_json from 1.0.92 to 1.0.93 (#2594)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.92 to 1.0.93. <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.93</h2> <ul> <li>Support 128-bit integers in serde_json::to_value (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/982">#982</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 10adeeb49e |
Bump serde_json from 1.0.91 to 1.0.92 (#2588)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.91 to 1.0.92. <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.92</h2> <ul> <li>Documentation improvements</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Iban Eguia Moraza | 3f9f6f0fce |
Module parsing (#2411)
I'm creating this draft PR, since I wanted to have some early feedback, and because I though I would have time to finish it last week, but I got caught up with other stuff. Feel free to contribute :) The main thing here is that I have divided `eval()`, `parse()` and similar functions so that they can decide if they are parsing scripts or modules. Let me know your thoughts. Then, I was checking the import & export parsing, and I noticed we are using `TokenKind::Identifier` for `IdentifierName`, so I changed that name. An `Identifier` is an `IdentifierName` that isn't a `ReservedWord`. This means we should probably also adapt all `IdentifierReference`, `BindingIdentifier` and so on parsing. I already created an `Identifier` parser. Something interesting there is that `await` is not a valid `Identifier` if the goal symbol is `Module`, as you can see in the [spec](https://tc39.es/ecma262/#prod-LabelIdentifier), but currently we don't have that information in the `InputElement` enumeration, we only have `Div`, `RegExp` and `TemplateTail`. How could we approach this? Co-authored-by: jedel1043 <jedel0124@gmail.com> |
2 years ago |
José Julián Espina | c03928309a |
Cleanup intrinsics and move to realm (#2555)
Small (ish?) step towards having proper realm records This PR changes the following: - Moves `Intrinsics` to `Realm`. - Cleans up the initialization logic of our intrinsics to not depend on `Context`, unblocking things like #2314. - Adds hooks to initialize the global object and the global this per the corresponding [`InitializeHostDefinedRealm ( )`](https://tc39.es/ecma262/#sec-initializehostdefinedrealm) hook. Though, this is currently broken because the vm uses `GlobalPropertyMap` instead of the `JsObject` API to initialize global properties. |
2 years ago |
José Julián Espina | 515d28f0a2 |
Create `Source` to abstract JS code sources (#2579)
Slightly related to #2411 since we need an API to pass module files, but more useful for #1760, #1313 and other error reporting issues. It changes the following: - Introduces a new `Source` API to store the path of a provided file or `None` if the source is a plain string. - Improves the display of `boa_tester` to show the path of the tests being run. This also enables hyperlinks to directly jump to the tested file from the VS terminal. - Adjusts the repo to this change. Hopefully, this will improve our error display in the future. |
2 years ago |