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-global-object-specialization.h" | 5 #include "src/compiler/js-global-object-specialization.h" |
6 | 6 |
7 #include "src/compilation-dependencies.h" | 7 #include "src/compilation-dependencies.h" |
8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 jsgraph()->HeapConstant(property_cell), effect, control); | 124 jsgraph()->HeapConstant(property_cell), effect, control); |
125 ReplaceWithValue(node, value, effect, control); | 125 ReplaceWithValue(node, value, effect, control); |
126 return Replace(value); | 126 return Replace(value); |
127 } | 127 } |
128 | 128 |
129 | 129 |
130 Reduction JSGlobalObjectSpecialization::ReduceJSStoreGlobal(Node* node) { | 130 Reduction JSGlobalObjectSpecialization::ReduceJSStoreGlobal(Node* node) { |
131 DCHECK_EQ(IrOpcode::kJSStoreGlobal, node->opcode()); | 131 DCHECK_EQ(IrOpcode::kJSStoreGlobal, node->opcode()); |
132 Handle<Name> name = StoreGlobalParametersOf(node->op()).name(); | 132 Handle<Name> name = StoreGlobalParametersOf(node->op()).name(); |
133 Node* value = NodeProperties::GetValueInput(node, 0); | 133 Node* value = NodeProperties::GetValueInput(node, 0); |
134 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | |
135 Node* effect = NodeProperties::GetEffectInput(node); | 134 Node* effect = NodeProperties::GetEffectInput(node); |
136 Node* control = NodeProperties::GetControlInput(node); | 135 Node* control = NodeProperties::GetControlInput(node); |
| 136 Node* frame_state = NodeProperties::FindFrameStateBefore(node); |
137 | 137 |
138 // Retrieve the global object from the given {node}. | 138 // Retrieve the global object from the given {node}. |
139 Handle<JSGlobalObject> global_object; | 139 Handle<JSGlobalObject> global_object; |
140 if (!GetGlobalObject(node).ToHandle(&global_object)) return NoChange(); | 140 if (!GetGlobalObject(node).ToHandle(&global_object)) return NoChange(); |
141 | 141 |
142 // Try to lookup the name on the script context table first (lexical scoping). | 142 // Try to lookup the name on the script context table first (lexical scoping). |
143 ScriptContextTableLookupResult result; | 143 ScriptContextTableLookupResult result; |
144 if (LookupInScriptContextTable(global_object, name, &result)) { | 144 if (LookupInScriptContextTable(global_object, name, &result)) { |
145 if (result.context->is_the_hole(result.index)) return NoChange(); | 145 if (result.context->is_the_hole(result.index)) return NoChange(); |
146 if (result.immutable) return NoChange(); | 146 if (result.immutable) return NoChange(); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 275 } |
276 | 276 |
277 | 277 |
278 SimplifiedOperatorBuilder* JSGlobalObjectSpecialization::simplified() const { | 278 SimplifiedOperatorBuilder* JSGlobalObjectSpecialization::simplified() const { |
279 return jsgraph()->simplified(); | 279 return jsgraph()->simplified(); |
280 } | 280 } |
281 | 281 |
282 } // namespace compiler | 282 } // namespace compiler |
283 } // namespace internal | 283 } // namespace internal |
284 } // namespace v8 | 284 } // namespace v8 |
OLD | NEW |