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 | |
1366 void BytecodeGraphBuilder::VisitNewWithSpread() { | 1356 void BytecodeGraphBuilder::VisitNewWithSpread() { |
1367 PrepareEagerCheckpoint(); | 1357 PrepareEagerCheckpoint(); |
1368 interpreter::Register callee_reg = bytecode_iterator().GetRegisterOperand(0); | 1358 interpreter::Register callee_reg = bytecode_iterator().GetRegisterOperand(0); |
1369 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); | 1359 interpreter::Register first_arg = bytecode_iterator().GetRegisterOperand(1); |
1370 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); | 1360 size_t arg_count = bytecode_iterator().GetRegisterCountOperand(2); |
1371 | 1361 |
1372 Node* new_target = environment()->LookupAccumulator(); | 1362 Node* new_target = environment()->LookupAccumulator(); |
1373 Node* callee = environment()->LookupRegister(callee_reg); | 1363 Node* callee = environment()->LookupRegister(callee_reg); |
1374 | 1364 |
1375 const Operator* op = | 1365 const Operator* op = |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2302 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2292 it->source_position().ScriptOffset(), start_position_.InliningId())); |
2303 it->Advance(); | 2293 it->Advance(); |
2304 } else { | 2294 } else { |
2305 DCHECK_GT(it->code_offset(), offset); | 2295 DCHECK_GT(it->code_offset(), offset); |
2306 } | 2296 } |
2307 } | 2297 } |
2308 | 2298 |
2309 } // namespace compiler | 2299 } // namespace compiler |
2310 } // namespace internal | 2300 } // namespace internal |
2311 } // namespace v8 | 2301 } // namespace v8 |
OLD | NEW |