Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: test/mjsunit/fixed-context-shapes-when-recompiling.js

Issue 2502333002: Preparsing inner functions: add regression tests for parameters. (Closed)
Patch Set: moar Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/fixed-context-shapes-when-recompiling.js
diff --git a/test/mjsunit/fixed-context-shapes-when-recompiling.js b/test/mjsunit/fixed-context-shapes-when-recompiling.js
index 6afc07a4886110bf6b878c1d19415d548440219d..b78b5562bf1be5b8fa6efc72b65f591bfb07925a 100644
--- a/test/mjsunit/fixed-context-shapes-when-recompiling.js
+++ b/test/mjsunit/fixed-context-shapes-when-recompiling.js
@@ -102,6 +102,100 @@
}
})();
+(function TestInnerFunctionDestructuredParameter_1() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ function inner([d, a]) {
+ a; b; c;
+ }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
+(function TestInnerFunctionDestructuredParameter_2() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ function inner({d, a}) {
+ a; b; c;
+ }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
+(function TestInnerArrowFunctionParameter() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ (a) => { a; b; c; }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
+(function TestInnerArrowFunctionRestParameter() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ (...a) => { a; b; c; }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
+(function TestInnerArrowFunctionDestructuredParameter_1() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ ([d, a]) => { a; b; c; }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
+(function TestInnerArrowFunctionDestructuredParameter_2() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ ({d, a}) => { a; b; c; }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
(function TestInnerInnerFunctionParameter() {
var a = 1;
var b = 2;
@@ -136,7 +230,41 @@
}
})();
-(function TestInnerArrowFunctionParameter() {
+(function TestInnerInnerFunctionDestructuredParameter_1() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ function inner() {
+ function innerinner({d, a}) { a; b; c; }
+ }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
+(function TestInnerInnerFunctionDestructuredParameter_2() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ function inner() {
+ function innerinner([d, a]) { a; b; c; }
+ }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
+(function TestInnerInnerArrowFunctionParameter() {
var a = 1;
var b = 2;
var c = 3;
@@ -153,7 +281,7 @@
}
})();
-(function TestInnerArrowFunctionRestParameter() {
+(function TestInnerInnerArrowFunctionRestParameter() {
var a = 1;
var b = 2;
var c = 3;
@@ -170,6 +298,40 @@
}
})();
+(function TestInnerInnerArrowFunctionDestructuredParameter_1() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ function inner() {
+ var f = ([d, a]) => a + b + c;
+ }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
+(function TestInnerInnerArrowFunctionDestructuredParameter_2() {
+ var a = 1;
+ var b = 2;
+ var c = 3;
+ function inner() {
+ var f = ({d, a}) => a + b + c;
+ }
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ assertEquals(1, a);
+ assertEquals(2, b);
+ assertEquals(3, c);
+ }
+})();
+
(function TestInnerFunctionInnerFunction() {
var a = 1;
var b = 2;
@@ -605,24 +767,90 @@
}
})();
-(function TestRegress650969_9() {
+(function TestRegress650969_9_parameter() {
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ var a;
+ function inner(a) {}
+ }
+})();
+
+(function TestRegress650969_9_restParameter() {
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ var a;
+ function inner(...a) {}
+ }
+})();
+
+(function TestRegress650969_9_destructuredParameter_1() {
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ var a;
+ function inner([d, a]) {}
+ }
+})();
+
+(function TestRegress650969_9_destructuredParameter_2() {
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ var a;
+ function inner({d, a}) {}
+ }
+})();
+
+(function TestRegress650969_10_parameter() {
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ var a;
+ function inner() {
+ function innerinner(a) {}
+ }
+ }
+})();
+
+(function TestRegress650969_10_restParameter() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
- function inner(a) {
+ function inner() {
+ function innerinner(...a) {}
}
}
})();
-(function TestRegress650969_10() {
+(function TestRegress650969_10_destructuredParameter_1() {
for (var i = 0; i < 3; ++i) {
if (i == 1) {
%OptimizeOsr();
}
var a;
- function inner(...a) {
+ function inner() {
+ function innerinner([d, a]) {}
+ }
+ }
+})();
+
+(function TestRegress650969_10_destructuredParameter_2() {
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ var a;
+ function inner() {
+ function innerinner({d, a}) {}
}
}
})();
@@ -879,6 +1107,30 @@
}
})();
+(function TestRegress650969_18() {
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ var a;
+ function inner() {
+ function innerinner([a, b]) {}
+ }
+ }
+})();
+
+(function TestRegress650969_18() {
+ for (var i = 0; i < 3; ++i) {
+ if (i == 1) {
+ %OptimizeOsr();
+ }
+ var a;
+ function inner() {
+ function innerinner(a) {}
+ }
+ }
+})();
+
// Regression tests for an intermediate stage where unresolved references were
// discarded too aggressively.
(function TestRegress650969_sidetrack_var() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698