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

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

Issue 2079613003: [generators] Implement %GeneratorGetSourcePosition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: enable test Created 4 years, 6 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
« no previous file with comments | « no previous file | src/compiler/js-operator.cc » ('j') | src/compiler/js-typed-lowering.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-operator.cc » ('j') | src/compiler/js-typed-lowering.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698