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/compiler/bytecode-branch-analysis.h" | 7 #include "src/compiler/bytecode-branch-analysis.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 Node* index = | 1412 Node* index = |
1413 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); | 1413 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); |
1414 index = NewNode(javascript()->ForInStep(), index); | 1414 index = NewNode(javascript()->ForInStep(), index); |
1415 environment()->BindAccumulator(index, &states); | 1415 environment()->BindAccumulator(index, &states); |
1416 } | 1416 } |
1417 | 1417 |
1418 void BytecodeGraphBuilder::VisitSuspendGenerator() { | 1418 void BytecodeGraphBuilder::VisitSuspendGenerator() { |
1419 Node* state = environment()->LookupAccumulator(); | 1419 Node* state = environment()->LookupAccumulator(); |
1420 Node* generator = environment()->LookupRegister( | 1420 Node* generator = environment()->LookupRegister( |
1421 bytecode_iterator().GetRegisterOperand(0)); | 1421 bytecode_iterator().GetRegisterOperand(0)); |
| 1422 Node* offset = jsgraph()->Constant(bytecode_iterator().current_offset()); |
1422 | 1423 |
1423 int register_count = environment()->register_count(); | 1424 int register_count = environment()->register_count(); |
1424 int value_input_count = 2 + register_count; | 1425 int value_input_count = 3 + register_count; |
1425 | 1426 |
1426 Node** value_inputs = local_zone()->NewArray<Node*>(value_input_count); | 1427 Node** value_inputs = local_zone()->NewArray<Node*>(value_input_count); |
1427 value_inputs[0] = generator; | 1428 value_inputs[0] = generator; |
1428 value_inputs[1] = state; | 1429 value_inputs[1] = state; |
| 1430 value_inputs[2] = offset; |
1429 for (int i = 0; i < register_count; ++i) { | 1431 for (int i = 0; i < register_count; ++i) { |
1430 value_inputs[2 + i] = | 1432 value_inputs[3 + i] = |
1431 environment()->LookupRegister(interpreter::Register(i)); | 1433 environment()->LookupRegister(interpreter::Register(i)); |
1432 } | 1434 } |
1433 | 1435 |
1434 MakeNode(javascript()->GeneratorStore(register_count), value_input_count, | 1436 MakeNode(javascript()->GeneratorStore(register_count), value_input_count, |
1435 value_inputs, false); | 1437 value_inputs, false); |
1436 } | 1438 } |
1437 | 1439 |
1438 void BytecodeGraphBuilder::VisitResumeGenerator() { | 1440 void BytecodeGraphBuilder::VisitResumeGenerator() { |
1439 FrameStateBeforeAndAfter states(this); | 1441 FrameStateBeforeAndAfter states(this); |
1440 | 1442 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 // Phi does not exist yet, introduce one. | 1742 // Phi does not exist yet, introduce one. |
1741 value = NewPhi(inputs, value, control); | 1743 value = NewPhi(inputs, value, control); |
1742 value->ReplaceInput(inputs - 1, other); | 1744 value->ReplaceInput(inputs - 1, other); |
1743 } | 1745 } |
1744 return value; | 1746 return value; |
1745 } | 1747 } |
1746 | 1748 |
1747 } // namespace compiler | 1749 } // namespace compiler |
1748 } // namespace internal | 1750 } // namespace internal |
1749 } // namespace v8 | 1751 } // namespace v8 |
OLD | NEW |