OLD | NEW |
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/compiler/js-typed-lowering.h" | 5 #include "src/compiler/js-typed-lowering.h" |
6 | 6 |
7 #include "src/ast/modules.h" | 7 #include "src/ast/modules.h" |
8 #include "src/builtins/builtins-utils.h" | 8 #include "src/builtins/builtins-utils.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compilation-dependencies.h" | 10 #include "src/compilation-dependencies.h" |
(...skipping 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2089 Reduction JSTypedLowering::ReduceJSGeneratorStore(Node* node) { | 2089 Reduction JSTypedLowering::ReduceJSGeneratorStore(Node* node) { |
2090 DCHECK_EQ(IrOpcode::kJSGeneratorStore, node->opcode()); | 2090 DCHECK_EQ(IrOpcode::kJSGeneratorStore, node->opcode()); |
2091 Node* generator = NodeProperties::GetValueInput(node, 0); | 2091 Node* generator = NodeProperties::GetValueInput(node, 0); |
2092 Node* continuation = NodeProperties::GetValueInput(node, 1); | 2092 Node* continuation = NodeProperties::GetValueInput(node, 1); |
2093 Node* offset = NodeProperties::GetValueInput(node, 2); | 2093 Node* offset = NodeProperties::GetValueInput(node, 2); |
2094 Node* context = NodeProperties::GetContextInput(node); | 2094 Node* context = NodeProperties::GetContextInput(node); |
2095 Node* effect = NodeProperties::GetEffectInput(node); | 2095 Node* effect = NodeProperties::GetEffectInput(node); |
2096 Node* control = NodeProperties::GetControlInput(node); | 2096 Node* control = NodeProperties::GetControlInput(node); |
2097 int register_count = OpParameter<int>(node); | 2097 int register_count = OpParameter<int>(node); |
2098 | 2098 |
2099 FieldAccess array_field = AccessBuilder::ForJSGeneratorObjectOperandStack(); | 2099 FieldAccess array_field = AccessBuilder::ForJSGeneratorObjectRegisterFile(); |
2100 FieldAccess context_field = AccessBuilder::ForJSGeneratorObjectContext(); | 2100 FieldAccess context_field = AccessBuilder::ForJSGeneratorObjectContext(); |
2101 FieldAccess continuation_field = | 2101 FieldAccess continuation_field = |
2102 AccessBuilder::ForJSGeneratorObjectContinuation(); | 2102 AccessBuilder::ForJSGeneratorObjectContinuation(); |
2103 FieldAccess input_or_debug_pos_field = | 2103 FieldAccess input_or_debug_pos_field = |
2104 AccessBuilder::ForJSGeneratorObjectInputOrDebugPos(); | 2104 AccessBuilder::ForJSGeneratorObjectInputOrDebugPos(); |
2105 | 2105 |
2106 Node* array = effect = graph()->NewNode(simplified()->LoadField(array_field), | 2106 Node* array = effect = graph()->NewNode(simplified()->LoadField(array_field), |
2107 generator, effect, control); | 2107 generator, effect, control); |
2108 | 2108 |
2109 for (int i = 0; i < register_count; ++i) { | 2109 for (int i = 0; i < register_count; ++i) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2143 return Changed(continuation); | 2143 return Changed(continuation); |
2144 } | 2144 } |
2145 | 2145 |
2146 Reduction JSTypedLowering::ReduceJSGeneratorRestoreRegister(Node* node) { | 2146 Reduction JSTypedLowering::ReduceJSGeneratorRestoreRegister(Node* node) { |
2147 DCHECK_EQ(IrOpcode::kJSGeneratorRestoreRegister, node->opcode()); | 2147 DCHECK_EQ(IrOpcode::kJSGeneratorRestoreRegister, node->opcode()); |
2148 Node* generator = NodeProperties::GetValueInput(node, 0); | 2148 Node* generator = NodeProperties::GetValueInput(node, 0); |
2149 Node* effect = NodeProperties::GetEffectInput(node); | 2149 Node* effect = NodeProperties::GetEffectInput(node); |
2150 Node* control = NodeProperties::GetControlInput(node); | 2150 Node* control = NodeProperties::GetControlInput(node); |
2151 int index = OpParameter<int>(node); | 2151 int index = OpParameter<int>(node); |
2152 | 2152 |
2153 FieldAccess array_field = AccessBuilder::ForJSGeneratorObjectOperandStack(); | 2153 FieldAccess array_field = AccessBuilder::ForJSGeneratorObjectRegisterFile(); |
2154 FieldAccess element_field = AccessBuilder::ForFixedArraySlot(index); | 2154 FieldAccess element_field = AccessBuilder::ForFixedArraySlot(index); |
2155 | 2155 |
2156 Node* array = effect = graph()->NewNode(simplified()->LoadField(array_field), | 2156 Node* array = effect = graph()->NewNode(simplified()->LoadField(array_field), |
2157 generator, effect, control); | 2157 generator, effect, control); |
2158 Node* element = effect = graph()->NewNode( | 2158 Node* element = effect = graph()->NewNode( |
2159 simplified()->LoadField(element_field), array, effect, control); | 2159 simplified()->LoadField(element_field), array, effect, control); |
2160 Node* stale = jsgraph()->StaleRegisterConstant(); | 2160 Node* stale = jsgraph()->StaleRegisterConstant(); |
2161 effect = graph()->NewNode(simplified()->StoreField(element_field), array, | 2161 effect = graph()->NewNode(simplified()->StoreField(element_field), array, |
2162 stale, effect, control); | 2162 stale, effect, control); |
2163 | 2163 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 } | 2272 } |
2273 | 2273 |
2274 | 2274 |
2275 CompilationDependencies* JSTypedLowering::dependencies() const { | 2275 CompilationDependencies* JSTypedLowering::dependencies() const { |
2276 return dependencies_; | 2276 return dependencies_; |
2277 } | 2277 } |
2278 | 2278 |
2279 } // namespace compiler | 2279 } // namespace compiler |
2280 } // namespace internal | 2280 } // namespace internal |
2281 } // namespace v8 | 2281 } // namespace v8 |
OLD | NEW |