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

Side by Side Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 2629363002: [Ignition/turbo] Add a CallWithSpread bytecode. (Closed)
Patch Set: reparent on the bytecode CL Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <fstream> 5 #include <fstream>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "src/interpreter/bytecode-array-iterator.h" 9 #include "src/interpreter/bytecode-array-iterator.h"
10 #include "src/interpreter/bytecode-generator.h" 10 #include "src/interpreter/bytecode-generator.h"
(...skipping 2325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 " constructor(...args) { super(1, ...args, 1); }\n" 2336 " constructor(...args) { super(1, ...args, 1); }\n"
2337 " }\n" 2337 " }\n"
2338 " test = new B(1, 2, 3).constructor;\n" 2338 " test = new B(1, 2, 3).constructor;\n"
2339 "})();\n", 2339 "})();\n",
2340 }; 2340 };
2341 2341
2342 CHECK(CompareTexts(BuildActual(printer, snippets), 2342 CHECK(CompareTexts(BuildActual(printer, snippets),
2343 LoadGolden("SuperCallAndSpread.golden"))); 2343 LoadGolden("SuperCallAndSpread.golden")));
2344 } 2344 }
2345 2345
2346 TEST(CallAndSpread) {
2347 InitializedIgnitionHandleScope scope;
2348 BytecodeExpectationsPrinter printer(CcTest::isolate());
2349 const char* snippets[] = {"Math.max(...[1, 2, 3]);\n",
2350 "Math.max(0, ...[1, 2, 3]);\n",
2351 "Math.max(0, ...[1, 2, 3], 4);\n"};
2352
2353 CHECK(CompareTexts(BuildActual(printer, snippets),
2354 LoadGolden("CallAndSpread.golden")));
2355 }
2356
2357 TEST(NewAndSpread) {
2358 InitializedIgnitionHandleScope scope;
2359 BytecodeExpectationsPrinter printer(CcTest::isolate());
2360 const char* snippets[] = {
2361 "class A { constructor(...args) { this.args = args; } }\n"
2362 "new A(...[1, 2, 3]);\n",
2363
2364 "class A { constructor(...args) { this.args = args; } }\n"
2365 "new A(0, ...[1, 2, 3]);\n",
2366
2367 "class A { constructor(...args) { this.args = args; } }\n"
2368 "new A(0, ...[1, 2, 3], 4);\n"};
2369
2370 CHECK(CompareTexts(BuildActual(printer, snippets),
2371 LoadGolden("NewAndSpread.golden")));
2372 }
2373
2346 } // namespace interpreter 2374 } // namespace interpreter
2347 } // namespace internal 2375 } // namespace internal
2348 } // namespace v8 2376 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/NewAndSpread.golden ('k') | test/mjsunit/regress/regress-682242.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698