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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/generic-node-inl.h" | 6 #include "src/compiler/generic-node-inl.h" |
7 #include "src/compiler/graph-inl.h" | 7 #include "src/compiler/graph-inl.h" |
8 #include "src/compiler/js-context-specialization.h" | 8 #include "src/compiler/js-context-specialization.h" |
9 #include "src/compiler/js-operator.h" | 9 #include "src/compiler/js-operator.h" |
10 #include "src/compiler/node-aux-data-inl.h" | 10 #include "src/compiler/node-aux-data-inl.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // Requires distinguishing between value and effect edges. | 25 // Requires distinguishing between value and effect edges. |
26 UseIter iter = node->uses().begin(); | 26 UseIter iter = node->uses().begin(); |
27 while (iter != node->uses().end()) { | 27 while (iter != node->uses().end()) { |
28 if (NodeProperties::IsEffectEdge(iter.edge())) { | 28 if (NodeProperties::IsEffectEdge(iter.edge())) { |
29 DCHECK_NE(NULL, effect); | 29 DCHECK_NE(NULL, effect); |
30 iter = iter.UpdateToAndIncrement(effect); | 30 iter = iter.UpdateToAndIncrement(effect); |
31 } else { | 31 } else { |
32 iter = iter.UpdateToAndIncrement(value); | 32 iter = iter.UpdateToAndIncrement(value); |
33 } | 33 } |
34 } | 34 } |
| 35 node->RemoveAllInputs(); |
35 } | 36 } |
36 | 37 |
37 | 38 |
38 class ContextSpecializationVisitor : public NullNodeVisitor { | 39 class ContextSpecializationVisitor : public NullNodeVisitor { |
39 public: | 40 public: |
40 explicit ContextSpecializationVisitor(JSContextSpecializer* spec) | 41 explicit ContextSpecializationVisitor(JSContextSpecializer* spec) |
41 : spec_(spec) {} | 42 : spec_(spec) {} |
42 | 43 |
43 GenericGraphVisit::Control Post(Node* node) { | 44 GenericGraphVisit::Control Post(Node* node) { |
44 switch (node->opcode()) { | 45 switch (node->opcode()) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 Operator* op = jsgraph_->javascript()->StoreContext(0, access.index()); | 149 Operator* op = jsgraph_->javascript()->StoreContext(0, access.index()); |
149 node->set_op(op); | 150 node->set_op(op); |
150 Handle<Object> new_context_handle = Handle<Object>(context, info_->isolate()); | 151 Handle<Object> new_context_handle = Handle<Object>(context, info_->isolate()); |
151 node->ReplaceInput(0, jsgraph_->Constant(new_context_handle)); | 152 node->ReplaceInput(0, jsgraph_->Constant(new_context_handle)); |
152 | 153 |
153 return Reducer::Changed(node); | 154 return Reducer::Changed(node); |
154 } | 155 } |
155 } | 156 } |
156 } | 157 } |
157 } // namespace v8::internal::compiler | 158 } // namespace v8::internal::compiler |
OLD | NEW |