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/js-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
9 #include "src/compiler/access-builder.h" | 9 #include "src/compiler/access-builder.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 Node* value = effect = graph()->NewNode( | 129 Node* value = effect = graph()->NewNode( |
130 simplified()->LoadField(AccessBuilder::ForPropertyCellValue()), | 130 simplified()->LoadField(AccessBuilder::ForPropertyCellValue()), |
131 jsgraph()->Constant(property_cell), effect, control); | 131 jsgraph()->Constant(property_cell), effect, control); |
132 return Replace(node, value, effect); | 132 return Replace(node, value, effect); |
133 } | 133 } |
134 | 134 |
135 | 135 |
136 Reduction JSNativeContextSpecialization::ReduceJSStoreGlobal(Node* node) { | 136 Reduction JSNativeContextSpecialization::ReduceJSStoreGlobal(Node* node) { |
137 DCHECK_EQ(IrOpcode::kJSStoreGlobal, node->opcode()); | 137 DCHECK_EQ(IrOpcode::kJSStoreGlobal, node->opcode()); |
138 Handle<Name> name = StoreGlobalParametersOf(node->op()).name(); | 138 Handle<Name> name = StoreGlobalParametersOf(node->op()).name(); |
139 Node* value = NodeProperties::GetValueInput(node, 2); | 139 Node* value = NodeProperties::GetValueInput(node, 0); |
140 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 140 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
141 Node* effect = NodeProperties::GetEffectInput(node); | 141 Node* effect = NodeProperties::GetEffectInput(node); |
142 Node* control = NodeProperties::GetControlInput(node); | 142 Node* control = NodeProperties::GetControlInput(node); |
143 | 143 |
144 // Try to lookup the name on the script context table first (lexical scoping). | 144 // Try to lookup the name on the script context table first (lexical scoping). |
145 ScriptContextTableLookupResult result; | 145 ScriptContextTableLookupResult result; |
146 if (LookupInScriptContextTable(name, &result)) { | 146 if (LookupInScriptContextTable(name, &result)) { |
147 if (result.context->is_the_hole(result.index)) return NoChange(); | 147 if (result.context->is_the_hole(result.index)) return NoChange(); |
148 if (result.immutable) return NoChange(); | 148 if (result.immutable) return NoChange(); |
149 Node* context = jsgraph()->Constant(result.context); | 149 Node* context = jsgraph()->Constant(result.context); |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 } | 709 } |
710 | 710 |
711 | 711 |
712 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 712 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
713 return jsgraph()->simplified(); | 713 return jsgraph()->simplified(); |
714 } | 714 } |
715 | 715 |
716 } // namespace compiler | 716 } // namespace compiler |
717 } // namespace internal | 717 } // namespace internal |
718 } // namespace v8 | 718 } // namespace v8 |
OLD | NEW |