OLD | NEW |
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 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 int first_arg_index = first_arg.index(); | 1346 int first_arg_index = first_arg.index(); |
1347 for (int i = 1; i < static_cast<int>(arity) - 1; ++i) { | 1347 for (int i = 1; i < static_cast<int>(arity) - 1; ++i) { |
1348 all[i] = environment()->LookupRegister( | 1348 all[i] = environment()->LookupRegister( |
1349 interpreter::Register(first_arg_index + i - 1)); | 1349 interpreter::Register(first_arg_index + i - 1)); |
1350 } | 1350 } |
1351 all[arity - 1] = new_target; | 1351 all[arity - 1] = new_target; |
1352 Node* value = MakeNode(op, static_cast<int>(arity), all, false); | 1352 Node* value = MakeNode(op, static_cast<int>(arity), all, false); |
1353 return value; | 1353 return value; |
1354 } | 1354 } |
1355 | 1355 |
| 1356 void BytecodeGraphBuilder::VisitCallWithSpread() { |
| 1357 PrepareEagerCheckpoint(); |
| 1358 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(0); |
| 1359 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(1); |
| 1360 const Operator* call = |
| 1361 javascript()->CallRuntime(Runtime::kCallWithSpread, arg_count); |
| 1362 Node* value = ProcessCallRuntimeArguments(call, first_arg, arg_count); |
| 1363 environment()->BindAccumulator(value, Environment::kAttachFrameState); |
| 1364 } |
| 1365 |
1356 void BytecodeGraphBuilder::VisitNewWithSpread() { | 1366 void BytecodeGraphBuilder::VisitNewWithSpread() { |
1357 PrepareEagerCheckpoint(); | 1367 PrepareEagerCheckpoint(); |
1358 interpreter::Register callee_reg = bytecode_iterator().GetRegisterOperand(0); | 1368 interpreter::Register callee_reg = bytecode_iterator().GetRegisterOperand(0); |
1359 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); | 1369 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); |
1360 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); | 1370 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); |
1361 | 1371 |
1362 Node* new_target = environment()->LookupAccumulator(); | 1372 Node* new_target = environment()->LookupAccumulator(); |
1363 Node* callee = environment()->LookupRegister(callee_reg); | 1373 Node* callee = environment()->LookupRegister(callee_reg); |
1364 | 1374 |
1365 const Operator* op = | 1375 const Operator* op = |
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2288 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2298 it->source_position().ScriptOffset(), start_position_.InliningId())); |
2289 it->Advance(); | 2299 it->Advance(); |
2290 } else { | 2300 } else { |
2291 DCHECK_GT(it->code_offset(), offset); | 2301 DCHECK_GT(it->code_offset(), offset); |
2292 } | 2302 } |
2293 } | 2303 } |
2294 | 2304 |
2295 } // namespace compiler | 2305 } // namespace compiler |
2296 } // namespace internal | 2306 } // namespace internal |
2297 } // namespace v8 | 2307 } // namespace v8 |
OLD | NEW |