Summary:
Release notes: None
- Fixing type of `quasis` in Babel and as field
- Instead of storing callTemplate as a derived function, store instead the source string (working towards having a human-readable generator intermediate format)
Pull Request resolved: https://github.com/facebook/prepack/pull/2490
Differential Revision: D9540696
Pulled By: NTillmann
fbshipit-source-id: d7ab8c68857d4b8b4e584894edb3781dce3db2b2
Summary:
Release notes: Fixing source map support.
I kept getting seemingly garbage source locations in error messages, and looked into that.
I found various issues:
- We in-place update positions, but they are actually shared between locations, and thus we may revisit positions. When we do, we map them again, and so on...
- Locations are also shared between nodes, so we kept revisiting and rewriting yet again.
- The actual mapping doesn't pay attention to the filename, so we apply the wrong mapping altogether, especially in the presence of multiple input files. I am not fixing this, but added a TODO, and opened #2353.
- Another remaining but not blocking issue is that something goes wrong with end-positions: They are sometimes mapped to some seemingly random position in the right line. If anyone knows anything about this, please let me know...
Pull Request resolved: https://github.com/facebook/prepack/pull/2356
Differential Revision: D9141809
Pulled By: NTillmann
fbshipit-source-id: d765e99706d69e3c792fba4c553d4110963067eb
Summary:
Release notes: upgrades Prepack to use Babel 7.0.0-beta.53
This is a big PR that updates all of Prepack to Babel 7. Babylon is now `babel/parser` and pretty much all of the the previous Babel packages are now located in scoped packages. I had to make a bunch of changes around Jest/Flow/Webpack to get this all working. The build times of building Prepack itself seem considerably faster (easily twice as fast locally). I followed most of the Babel 6 -> 7 upgrade guide from the Babel site in terms of changing nodes and type definitions to match the new ones.
Pull Request resolved: https://github.com/facebook/prepack/pull/2256
Differential Revision: D8850583
Pulled By: trueadm
fbshipit-source-id: 2d2aaec25c6a1ccd1ec0c08c5e7e2a71f78ac2d8
Summary:
Release notes: Speeding up Prepack by 22%, saving 8% memory.
This closes#1812.
This completely refactors the `ClosureRefReplacer` into a new
standalone `ResidualFunctionInstantiator`.
By avoiding babel-traverse, this visitor implementation is way faster.
Also, it only clones those nodes which are being changes, preserving all others,
insteading of cloning an entire function if any node needs to change; in this way,
memory is saved as well.
On a large internal benchmark (27MB minified JavaScript bundle with 31MB sourcemaps file), this change reduces overall time from 200s down to 157s: 22% faster. This due to savings during serialization, which goes down from 71s to 23s (while making the visitor 6s slower due to additional work).
Also, overall memory usage goes down from 3582MB to 3307MB, a 8% savings. Again, mostly due to savings in serialization, where surviving allocations going down from 337MB to 51MB, while slightly increasing allocations in the visitor.
Closes https://github.com/facebook/prepack/pull/1947
Differential Revision: D7990897
Pulled By: NTillmann
fbshipit-source-id: 93ffa0a06e75566db1d5564924c3f840cc2262df
Summary:
Release notes: New --repro command line option for easier bug reporting
This new option creates a handy .zip file with everything in it to reproduce an issue.
Closes https://github.com/facebook/prepack/pull/1499
Differential Revision: D7086115
Pulled By: NTillmann
fbshipit-source-id: be9e84ea246689dd1073a2fd713ec2599c98350c
Summary:
Release Note: Avoid duplicate nested function body(Part1)
Avoids duplicating the nested function body with other residual functions. Currently the implementation has the following limitations:
1. Did not deal with the situation that nested function duplicates with a residual function did not use factory function.
2. Did not deal with function declaration
I will address these limitations in later PR.
Closes https://github.com/facebook/prepack/pull/1081
Differential Revision: D6078328
Pulled By: yinghuitan
fbshipit-source-id: 3a6b6dd0b99a5cdb8cffeeba85d257682c3db40e
Summary:
Progress towards #632.
There's a lot more that can be done here - for example, we could also eliminate `if (0) foo()` - but presumably that should be done by partial evaluators in a less ad-hoc way.
Closes https://github.com/facebook/prepack/pull/1061
Differential Revision: D6012613
Pulled By: NTillmann
fbshipit-source-id: a7dd6b64a42be34dddf1a59f363ed101feefda64