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

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 2629363002: [Ignition/turbo] Add a CallWithSpread bytecode. (Closed)
Patch Set: refactor OnlyLastArgIsSpread Created 3 years, 11 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 "src/compiler/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/compiler-source-position-table.h" 10 #include "src/compiler/compiler-source-position-table.h"
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 interpreter::Register first_return = 1331 interpreter::Register first_return =
1332 bytecode_iterator().GetRegisterOperand(3); 1332 bytecode_iterator().GetRegisterOperand(3);
1333 1333
1334 // Create node to perform the runtime call. 1334 // Create node to perform the runtime call.
1335 const Operator* call = javascript()->CallRuntime(functionId, arg_count); 1335 const Operator* call = javascript()->CallRuntime(functionId, arg_count);
1336 Node* return_pair = ProcessCallRuntimeArguments(call, first_arg, arg_count); 1336 Node* return_pair = ProcessCallRuntimeArguments(call, first_arg, arg_count);
1337 environment()->BindRegistersToProjections(first_return, return_pair, 1337 environment()->BindRegistersToProjections(first_return, return_pair,
1338 Environment::kAttachFrameState); 1338 Environment::kAttachFrameState);
1339 } 1339 }
1340 1340
1341 void BytecodeGraphBuilder::VisitCallWithSpread() {
1342 PrepareEagerCheckpoint();
1343 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(0);
1344 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(1);
1345 const Operator* call =
1346 javascript()->CallRuntime(Runtime::kNewWithSpread, arg_count);
1347 Node* value = ProcessCallRuntimeArguments(call, first_arg, arg_count);
1348 environment()->BindAccumulator(value, Environment::kAttachFrameState);
1349 }
1350
1341 void BytecodeGraphBuilder::VisitNewWithSpread() { 1351 void BytecodeGraphBuilder::VisitNewWithSpread() {
1342 PrepareEagerCheckpoint(); 1352 PrepareEagerCheckpoint();
1343 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(0); 1353 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(0);
1344 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(1); 1354 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(1);
1345 1355
1346 const Operator* op = 1356 const Operator* op =
1347 javascript()->CallConstructWithSpread(static_cast<int>(arg_count)); 1357 javascript()->CallConstructWithSpread(static_cast<int>(arg_count));
1348 Node* value = ProcessCallRuntimeArguments(op, first_arg, arg_count); 1358 Node* value = ProcessCallRuntimeArguments(op, first_arg, arg_count);
1349 environment()->BindAccumulator(value, Environment::kAttachFrameState); 1359 environment()->BindAccumulator(value, Environment::kAttachFrameState);
1350 } 1360 }
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 it->source_position().ScriptOffset(), start_position_.InliningId())); 2282 it->source_position().ScriptOffset(), start_position_.InliningId()));
2273 it->Advance(); 2283 it->Advance();
2274 } else { 2284 } else {
2275 DCHECK_GT(it->code_offset(), offset); 2285 DCHECK_GT(it->code_offset(), offset);
2276 } 2286 }
2277 } 2287 }
2278 2288
2279 } // namespace compiler 2289 } // namespace compiler
2280 } // namespace internal 2290 } // namespace internal
2281 } // namespace v8 2291 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-builder.h » ('j') | src/interpreter/bytecode-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698