aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/cctest/interpreter/test-bytecode-generator.cc')
-rw-r--r--deps/v8/test/cctest/interpreter/test-bytecode-generator.cc97
1 files changed, 97 insertions, 0 deletions
diff --git a/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc b/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc
index 0ec28d3653..e81b0cf981 100644
--- a/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc
+++ b/deps/v8/test/cctest/interpreter/test-bytecode-generator.cc
@@ -627,6 +627,69 @@ TEST(IIFEWithOneshotOpt) {
return arguments.callee;
})();
)",
+ // CallNoFeedback instead of CallProperty
+ R"(
+ this.f0 = function() {};
+ this.f1 = function(a) {};
+ this.f2 = function(a, b) {};
+ this.f3 = function(a, b, c) {};
+ this.f4 = function(a, b, c, d) {};
+ this.f5 = function(a, b, c, d, e) {};
+ (function() {
+ this.f0();
+ this.f1(1);
+ this.f2(1, 2);
+ this.f3(1, 2, 3);
+ this.f4(1, 2, 3, 4);
+ this.f5(1, 2, 3, 4, 5);
+ return arguments.callee;
+ })();
+ )",
+ // CallNoFeedback instead of CallUndefinedReceiver
+ R"(
+ function f0() {}
+ function f1(a) {}
+ function f2(a, b) {}
+ function f3(a, b, c) {}
+ function f4(a, b, c, d) {}
+ function f5(a, b, c, d, e) {}
+ (function() {
+ f0();
+ f1(1);
+ f2(1, 2);
+ f3(1, 2, 3);
+ f4(1, 2, 3, 4);
+ f5(1, 2, 3, 4, 5);
+ return arguments.callee;
+ })();
+ )",
+ R"(
+ var t = 0;
+ function f2() {};
+ if (t == 0) {
+ (function(){
+ l = {};
+ l.a = 3;
+ l.b = 4;
+ f2();
+ return arguments.callee;
+ })();
+ }
+ )",
+ // No one-shot opt for IIFE`s within a function
+ R"(
+ function f2() {};
+ function f() {
+ return (function(){
+ l = {};
+ l.a = 3;
+ l.b = 4;
+ f2();
+ return arguments.callee;
+ })();
+ }
+ f();
+ )",
};
CHECK(CompareTexts(BuildActual(printer, snippets),
LoadGolden("IIFEWithOneshotOpt.golden")));
@@ -663,6 +726,40 @@ TEST(IIFEWithoutOneshotOpt) {
return arguments.callee;
})();
)",
+ R"(
+ this.f0 = function() {};
+ this.f1 = function(a) {};
+ this.f2 = function(a, b) {};
+ this.f3 = function(a, b, c) {};
+ this.f4 = function(a, b, c, d) {};
+ this.f5 = function(a, b, c, d, e) {};
+ (function() {
+ this.f0();
+ this.f1(1);
+ this.f2(1, 2);
+ this.f3(1, 2, 3);
+ this.f4(1, 2, 3, 4);
+ this.f5(1, 2, 3, 4, 5);
+ return arguments.callee;
+ })();
+ )",
+ R"(
+ function f0() {}
+ function f1(a) {}
+ function f2(a, b) {}
+ function f3(a, b, c) {}
+ function f4(a, b, c, d) {}
+ function f5(a, b, c, d, e) {}
+ (function() {
+ f0();
+ f1(1);
+ f2(1, 2);
+ f3(1, 2, 3);
+ f4(1, 2, 3, 4);
+ f5(1, 2, 3, 4, 5);
+ return arguments.callee;
+ })();
+ )",
};
CHECK(CompareTexts(BuildActual(printer, snippets),
LoadGolden("IIFEWithoutOneshotOpt.golden")));