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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 2079613003: [generators] Implement %GeneratorGetSourcePosition. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rename again, and move subtraction to runtime 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 | « src/compiler/js-operator.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/compilation-dependencies.h" 6 #include "src/compilation-dependencies.h"
7 #include "src/compiler/access-builder.h" 7 #include "src/compiler/access-builder.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/js-typed-lowering.h" 9 #include "src/compiler/js-typed-lowering.h"
10 #include "src/compiler/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 DCHECK_EQ(IrOpcode::kJSForInStep, node->opcode()); 1736 DCHECK_EQ(IrOpcode::kJSForInStep, node->opcode());
1737 node->ReplaceInput(1, jsgraph()->Int32Constant(1)); 1737 node->ReplaceInput(1, jsgraph()->Int32Constant(1));
1738 NodeProperties::ChangeOp(node, machine()->Int32Add()); 1738 NodeProperties::ChangeOp(node, machine()->Int32Add());
1739 return Changed(node); 1739 return Changed(node);
1740 } 1740 }
1741 1741
1742 Reduction JSTypedLowering::ReduceJSGeneratorStore(Node* node) { 1742 Reduction JSTypedLowering::ReduceJSGeneratorStore(Node* node) {
1743 DCHECK_EQ(IrOpcode::kJSGeneratorStore, node->opcode()); 1743 DCHECK_EQ(IrOpcode::kJSGeneratorStore, node->opcode());
1744 Node* generator = NodeProperties::GetValueInput(node, 0); 1744 Node* generator = NodeProperties::GetValueInput(node, 0);
1745 Node* continuation = NodeProperties::GetValueInput(node, 1); 1745 Node* continuation = NodeProperties::GetValueInput(node, 1);
1746 Node* offset = NodeProperties::GetValueInput(node, 2);
1746 Node* context = NodeProperties::GetContextInput(node); 1747 Node* context = NodeProperties::GetContextInput(node);
1747 Node* effect = NodeProperties::GetEffectInput(node); 1748 Node* effect = NodeProperties::GetEffectInput(node);
1748 Node* control = NodeProperties::GetControlInput(node); 1749 Node* control = NodeProperties::GetControlInput(node);
1749 int register_count = OpParameter<int>(node); 1750 int register_count = OpParameter<int>(node);
1750 1751
1751 FieldAccess array_field = AccessBuilder::ForJSGeneratorObjectOperandStack(); 1752 FieldAccess array_field = AccessBuilder::ForJSGeneratorObjectOperandStack();
1752 FieldAccess context_field = AccessBuilder::ForJSGeneratorObjectContext(); 1753 FieldAccess context_field = AccessBuilder::ForJSGeneratorObjectContext();
1753 FieldAccess continuation_field = 1754 FieldAccess continuation_field =
1754 AccessBuilder::ForJSGeneratorObjectContinuation(); 1755 AccessBuilder::ForJSGeneratorObjectContinuation();
1756 FieldAccess input_or_debug_pos_field =
1757 AccessBuilder::ForJSGeneratorObjectInputOrDebugPos();
1755 1758
1756 Node* array = effect = graph()->NewNode(simplified()->LoadField(array_field), 1759 Node* array = effect = graph()->NewNode(simplified()->LoadField(array_field),
1757 generator, effect, control); 1760 generator, effect, control);
1758 1761
1759 for (int i = 0; i < register_count; ++i) { 1762 for (int i = 0; i < register_count; ++i) {
1760 Node* value = NodeProperties::GetValueInput(node, 2 + i); 1763 Node* value = NodeProperties::GetValueInput(node, 3 + i);
1761 effect = graph()->NewNode( 1764 effect = graph()->NewNode(
1762 simplified()->StoreField(AccessBuilder::ForFixedArraySlot(i)), array, 1765 simplified()->StoreField(AccessBuilder::ForFixedArraySlot(i)), array,
1763 value, effect, control); 1766 value, effect, control);
1764 } 1767 }
1765 1768
1766 effect = graph()->NewNode(simplified()->StoreField(context_field), generator, 1769 effect = graph()->NewNode(simplified()->StoreField(context_field), generator,
1767 context, effect, control); 1770 context, effect, control);
1768 effect = graph()->NewNode(simplified()->StoreField(continuation_field), 1771 effect = graph()->NewNode(simplified()->StoreField(continuation_field),
1769 generator, continuation, effect, control); 1772 generator, continuation, effect, control);
1773 effect = graph()->NewNode(simplified()->StoreField(input_or_debug_pos_field),
1774 generator, offset, effect, control);
1770 1775
1771 ReplaceWithValue(node, effect, effect, control); 1776 ReplaceWithValue(node, effect, effect, control);
1772 return Changed(effect); 1777 return Changed(effect);
1773 } 1778 }
1774 1779
1775 Reduction JSTypedLowering::ReduceJSGeneratorRestoreContinuation(Node* node) { 1780 Reduction JSTypedLowering::ReduceJSGeneratorRestoreContinuation(Node* node) {
1776 DCHECK_EQ(IrOpcode::kJSGeneratorRestoreContinuation, node->opcode()); 1781 DCHECK_EQ(IrOpcode::kJSGeneratorRestoreContinuation, node->opcode());
1777 Node* generator = NodeProperties::GetValueInput(node, 0); 1782 Node* generator = NodeProperties::GetValueInput(node, 0);
1778 Node* effect = NodeProperties::GetEffectInput(node); 1783 Node* effect = NodeProperties::GetEffectInput(node);
1779 Node* control = NodeProperties::GetControlInput(node); 1784 Node* control = NodeProperties::GetControlInput(node);
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2010 } 2015 }
2011 2016
2012 2017
2013 CompilationDependencies* JSTypedLowering::dependencies() const { 2018 CompilationDependencies* JSTypedLowering::dependencies() const {
2014 return dependencies_; 2019 return dependencies_;
2015 } 2020 }
2016 2021
2017 } // namespace compiler 2022 } // namespace compiler
2018 } // namespace internal 2023 } // namespace internal
2019 } // namespace v8 2024 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-operator.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698