Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ESTree-based optimizer for core JS passes, to support ES6+ inputs #7973

Merged
merged 96 commits into from
Feb 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
d4ea3c1
start [ci skip]
kripken Jan 26, 2019
e1faf99
setup [ci skip]
kripken Jan 26, 2019
edfbb6d
prepare for actual work [ci skip]
kripken Jan 26, 2019
f174667
thoughts [ci skip]
kripken Jan 26, 2019
0bed0b0
possibility
kripken Jan 27, 2019
7ed7a91
Revert "possibility"
kripken Jan 27, 2019
cb75609
start to work [ci skip]
kripken Jan 27, 2019
713f20a
progress? [ci skip]
kripken Jan 27, 2019
7f6ebb1
prep for testing [ci skip]
kripken Jan 27, 2019
f8286ae
fixes
kripken Jan 27, 2019
c02e28b
fixes [ci skip]
kripken Jan 27, 2019
da905fe
first test sort of passes [ci skip]
kripken Jan 27, 2019
726ea62
more wip [ci skip]
kripken Jan 27, 2019
9fd22bc
main jsdce tests pass..? [ci skip]
kripken Jan 27, 2019
5a0625f
more acorn, and fixes [ci skip]
kripken Jan 27, 2019
1bd8b7f
without acorn-walk [ci skip]
kripken Jan 27, 2019
c1234f6
get tests passing with our new walks [ci skip]
kripken Jan 27, 2019
4f131c1
wip
kripken Jan 27, 2019
dd5c524
USEFUL ccall/cwrap into library [ci skip]
kripken Jan 27, 2019
dfeab97
remove unused code
kripken Jan 27, 2019
8e1b204
remove logging
kripken Jan 27, 2019
8823277
acornify applyImportAndExportNameChanges [ci skip]
kripken Jan 27, 2019
f63c3a5
USEFUL : standardize process debug logging and use run_process in js_…
kripken Jan 27, 2019
ac9f1f9
acornify applyDCEGraphRemovals [ci skip]
kripken Jan 27, 2019
55ac470
use acornified applyDCEGraphRemovals [ci skip]
kripken Jan 27, 2019
c64b2a9
acornify emitDCEGraph [ci skip]
kripken Jan 28, 2019
2a29628
fix, but all broken [ci skip]
kripken Jan 28, 2019
375e3f8
restore [ci skip]
kripken Jan 28, 2019
2708710
fix [ci skip]
kripken Jan 28, 2019
9a7fe4e
real fix [ci skip]
kripken Jan 28, 2019
43c8c0c
handle empty var inits in fors [ci skip]
kripken Jan 28, 2019
af2ede8
last fix for hello libcxx -O2 [ci skip]
kripken Jan 28, 2019
3f6b824
don't infinite loop due to restoring vars, and add Arrows [ci skip]
kripken Jan 28, 2019
8707014
fix and cleanup [ci skip]
kripken Jan 28, 2019
ef3c899
USEFUL ccall/cwrap into library [ci skip]
kripken Jan 27, 2019
b2e7f6b
fixes
kripken Jan 28, 2019
b33d7fb
Merge remote-tracking branch 'origin/incoming' into ccall
kripken Jan 28, 2019
02d14b2
fix
kripken Jan 28, 2019
b85a5ec
merge [ci skip]
kripken Jan 28, 2019
fb156ea
fix test
kripken Jan 28, 2019
fb2b86f
fixes
kripken Jan 28, 2019
feafaaa
Merge remote-tracking branch 'origin/incoming' into ccall
kripken Jan 28, 2019
790fa55
update test
kripken Jan 28, 2019
c81e986
Merge remote-tracking branch 'origin/incoming' into ccall
kripken Jan 30, 2019
fe0abf9
test fixes
kripken Jan 30, 2019
0b90d37
Merge remote-tracking branch 'origin/ccall' into acorn
kripken Jan 30, 2019
3ce83ab
fixes
kripken Jan 30, 2019
795e531
remove some silly logging
kripken Jan 30, 2019
d1e9cd1
customize acorn with an error message, get other.test_js_optimizer_pa…
kripken Jan 30, 2019
2725697
fix other.test_js_optimizer_parse_error for wasm backend
kripken Jan 30, 2019
c93c764
add test
kripken Jan 30, 2019
4bab7a7
flake8
kripken Jan 30, 2019
dd27a92
Merge remote-tracking branch 'origin/incoming' into acorn
kripken Jan 30, 2019
d3a1f76
revert bad change to temp file handling
kripken Jan 30, 2019
5bdbee2
cleanup
kripken Jan 30, 2019
2f7ba52
Merge remote-tracking branch 'origin/incoming' into acorn
kripken Jan 30, 2019
766c46d
test fixes
kripken Jan 30, 2019
64ff0e5
avoid races in leak detection
kripken Jan 30, 2019
802d51b
get terser working for minified output at least
kripken Jan 30, 2019
5481ef4
package.json
kripken Jan 30, 2019
9be160e
other.test_js_optimizer with terser
kripken Jan 31, 2019
6d48288
hack [ci skip]
kripken Jan 31, 2019
db84bf9
update tests
kripken Jan 31, 2019
e766dc3
dag [ci skip]
kripken Jan 31, 2019
163c036
terser prep
kripken Jan 31, 2019
d3f8ba2
preserve quotes in terser
kripken Jan 31, 2019
f0c4237
comment
kripken Jan 31, 2019
d8eb382
update test [ci skip]
kripken Jan 31, 2019
90ff8c8
Merge branch 'incoming' into acorn
kripken Jan 31, 2019
171d5af
cleanup
kripken Jan 31, 2019
26af1cf
cleanup
kripken Jan 31, 2019
83d5872
restore missing
kripken Jan 31, 2019
2b09735
Merge remote-tracking branch 'origin/incoming' into acorn
kripken Jan 31, 2019
90f07ee
wip
kripken Jan 31, 2019
2d5309c
cleanup
kripken Jan 31, 2019
463c72b
document
kripken Jan 31, 2019
ce869e1
remove unneeded files
kripken Jan 31, 2019
29afbfd
revert
kripken Feb 1, 2019
1dc3b7d
revert
kripken Feb 1, 2019
f7cdc6c
revert
kripken Feb 1, 2019
a616dc6
revert
kripken Feb 1, 2019
b9e35c1
revert
kripken Feb 1, 2019
1e170ee
revert
kripken Feb 1, 2019
abf0529
revert
kripken Feb 1, 2019
fa76303
revert
kripken Feb 1, 2019
82e86fc
fix
kripken Feb 1, 2019
017fd7a
links to prs
kripken Feb 1, 2019
36dc024
test fix
kripken Feb 1, 2019
637a1b8
Merge remote-tracking branch 'origin/incoming' into acorn
kripken Feb 5, 2019
fe8db9b
fix
kripken Feb 5, 2019
8f4ca82
Merge remote-tracking branch 'origin/incoming' into acorn
kripken Feb 5, 2019
a559a99
update after Module.asmLibraryArg => var asmLibraryArg change
kripken Feb 5, 2019
0323c72
wip
kripken Feb 6, 2019
ca4f365
Add test case for full MINIMAL_RUNTIME JS optimizer applyImportAndExp…
juj Feb 6, 2019
33af0db
Fix acorn optimizer to run on MINIMAL_RUNTIME global initializer case
juj Feb 6, 2019
7dc9909
Merge remote-tracking branch 'origin/incoming' into acorn
kripken Feb 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions tests/optimizer/AJSDCE-output.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@

var z = fleefl();

var zz = fleefl();

function g(a) {
return a + 1;
}

Module["g"] = g;

function h(a) {
return a + 1;
}

print(h(123));
((function() {

(function() {
var z = fleefl();
var zz = fleefl();
function g(a) {
Expand All @@ -20,8 +25,9 @@ print(h(123));
return a + 1;
}
print(hh(123));
}))();
})();

function glue() {
}
glue();

glue();
3 changes: 3 additions & 0 deletions tests/optimizer/JSDCE-fors-output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
for (var i in x) {}

for (var j = 0; ;) {}
4 changes: 4 additions & 0 deletions tests/optimizer/JSDCE-fors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

for (var i in x) {}
for (var j = 0;;) {}

1 change: 1 addition & 0 deletions tests/optimizer/JSDCE-hasOwnProperty-output.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}

if (hasOwnProperty({}, "prop_name")) {
console.log("yeah");
}
26 changes: 20 additions & 6 deletions tests/optimizer/JSDCE-output.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@

var z = fleefl();

var zz = fleefl();

var keeperObj = {
x: fleefl()
};

var keeperArray = [ 1, 2, "3", four() ];

function g(a) {
return a + 1;
}

Module["g"] = g;

function h(a) {
return a + 1;
}

print(h(123));
((function() {

(function() {
var z = fleefl();
var zz = fleefl();
function g(a) {
Expand All @@ -24,31 +31,38 @@ print(h(123));
return a + 1;
}
print(hh(123));
}))();
})();

function glue() {
function lookup() {
throw 1;
}
}

glue();

function _glCreateShader() {
return 1;
}

function emulate() {
_glCreateShader = function _glCreateShader(shaderType) {
return glCreateShader();
};
}

emulate();

___cxa_find_matching_catch_before();

function ___cxa_find_matching_catch_before() {
if (!___cxa_find_matching_catch_before.buffer) ___cxa_find_matching_catch_before.buffer = {};
}

function ___cxa_find_matching_catch_after() {
if (!___cxa_find_matching_catch_after.buffer) ___cxa_find_matching_catch_after.buffer = {};
}
___cxa_find_matching_catch_after();
var dotOther = Side.effect;


___cxa_find_matching_catch_after();

var dotOther = Side.effect;
54 changes: 0 additions & 54 deletions tests/optimizer/JSDCE-uglifyjsNodeTypes-output.js

This file was deleted.

47 changes: 0 additions & 47 deletions tests/optimizer/JSDCE-uglifyjsNodeTypes.js

This file was deleted.

32 changes: 23 additions & 9 deletions tests/optimizer/applyDCEGraphRemovals-output.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
var name;

var asmLibraryArg = {
"save1": 1,
"save2": 2
};

var expD1 = Module["expD1"] = asm["expD1"];

var expD2 = Module["expD2"] = asm["expD2"];

var expD3 = Module["expD3"] = asm["expD3"];
var expD4 = undefined;
var expI1 = Module["expI1"] = (function() {

var expD4;

var expI1 = Module["expI1"] = function() {
return Module["asm"]["expI1"].apply(null, arguments);
});
var expI2 = Module["expI2"] = (function() {
};

var expI2 = Module["expI2"] = function() {
return Module["asm"]["expI2"].apply(null, arguments);
});
var expI3 = Module["expI3"] = (function() {
};

var expI3 = Module["expI3"] = function() {
return Module["asm"]["expI3"].apply(null, arguments);
});
var expI4 = undefined;
};

var expI4;

expD1;

Module["expD2"];

asm["expD3"];

expI1;

Module["expI2"];
asm["expI3"];

asm["expI3"];
10 changes: 5 additions & 5 deletions tests/optimizer/applyImportAndExportNameChanges-output.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var name;

var asmLibraryArg = {
"a": 1,
"A": 33,
Expand All @@ -12,10 +13,9 @@ var asmLibraryArg = {
"d": ___syscall140,
"q": ___syscall146
};
var expD1 = Module["expD1"] = asm["c"];
var expI1 = Module["expI1"] = (function() {
return Module["asm"]["d"].apply(null, arguments);
});


var expD1 = Module["expD1"] = asm["c"];

var expI1 = Module["expI1"] = function() {
return Module["asm"]["d"].apply(null, arguments);
};