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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2541113004: [Ignition/turbo] Add a NewWithSpread bytecode. (Closed)
Patch Set: Add todo Created 4 years 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 | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 5565e01f547fc2db137c61a1c82d8594b4cdef41..0d7c1408c54738fe997bf342dba93fe77f15e6d1 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -2493,25 +2493,12 @@ void BytecodeGenerator::VisitCallSuper(Call* expr) {
// When a super call contains a spread, a CallSuper AST node is only created
// if there is exactly one spread, and it is the last argument.
if (!args->is_empty() && args->last()->IsSpread()) {
- // Prepare the spread arguments.
- RegisterList spread_prepare_args =
- register_allocator()->NewRegisterList(args->length());
- VisitArguments(args, spread_prepare_args);
-
- builder()->CallRuntime(Runtime::kSpreadIterablePrepareVarargs,
- spread_prepare_args);
-
- // Call ReflectConstruct to do the actual super constructor call.
- RegisterList reflect_construct_args =
- register_allocator()->NewRegisterList(4);
- builder()
- ->StoreAccumulatorInRegister(reflect_construct_args[2])
- .LoadUndefined()
- .StoreAccumulatorInRegister(reflect_construct_args[0])
- .MoveRegister(constructor, reflect_construct_args[1]);
- VisitForRegisterValue(super->new_target_var(), reflect_construct_args[3]);
- builder()->CallJSRuntime(Context::REFLECT_CONSTRUCT_INDEX,
- reflect_construct_args);
+ RegisterList args_regs =
+ register_allocator()->NewRegisterList(args->length() + 2);
+ builder()->MoveRegister(constructor, args_regs[0]);
+ VisitForRegisterValue(super->new_target_var(), args_regs[1]);
+ VisitArguments(args, args_regs, 2);
+ builder()->NewWithSpread(args_regs);
} else {
RegisterList args_regs =
register_allocator()->NewRegisterList(args->length());
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698