OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/load-elimination.h" | 5 #include "src/compiler/load-elimination.h" |
6 | 6 |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.h" |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 break; | 1000 break; |
1001 } | 1001 } |
1002 case IrOpcode::kTransitionElementsKind: { | 1002 case IrOpcode::kTransitionElementsKind: { |
1003 ElementsTransition transition = ElementsTransitionOf(current->op()); | 1003 ElementsTransition transition = ElementsTransitionOf(current->op()); |
1004 Node* const object = NodeProperties::GetValueInput(current, 0); | 1004 Node* const object = NodeProperties::GetValueInput(current, 0); |
1005 ZoneHandleSet<Map> object_maps; | 1005 ZoneHandleSet<Map> object_maps; |
1006 if (!state->LookupMaps(object, &object_maps) || | 1006 if (!state->LookupMaps(object, &object_maps) || |
1007 !ZoneHandleSet<Map>(transition.target()) | 1007 !ZoneHandleSet<Map>(transition.target()) |
1008 .contains(object_maps)) { | 1008 .contains(object_maps)) { |
1009 state = state->KillMaps(object, zone()); | 1009 state = state->KillMaps(object, zone()); |
1010 state = state->KillField( | 1010 switch (transition.mode()) { |
1011 object, FieldIndexOf(JSObject::kElementsOffset), zone()); | 1011 case ElementsTransition::kFastTransition: |
| 1012 break; |
| 1013 case ElementsTransition::kSlowTransition: |
| 1014 // Kill the elements as well. |
| 1015 state = state->KillField( |
| 1016 object, FieldIndexOf(JSObject::kElementsOffset), zone()); |
| 1017 break; |
| 1018 } |
1012 } | 1019 } |
1013 break; | 1020 break; |
1014 } | 1021 } |
1015 case IrOpcode::kStoreField: { | 1022 case IrOpcode::kStoreField: { |
1016 FieldAccess const& access = FieldAccessOf(current->op()); | 1023 FieldAccess const& access = FieldAccessOf(current->op()); |
1017 Node* const object = NodeProperties::GetValueInput(current, 0); | 1024 Node* const object = NodeProperties::GetValueInput(current, 0); |
1018 if (access.offset == HeapObject::kMapOffset) { | 1025 if (access.offset == HeapObject::kMapOffset) { |
1019 // Invalidate what we know about the {object}s map. | 1026 // Invalidate what we know about the {object}s map. |
1020 state = state->KillMaps(object, zone()); | 1027 state = state->KillMaps(object, zone()); |
1021 } else { | 1028 } else { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1104 return jsgraph()->common(); | 1111 return jsgraph()->common(); |
1105 } | 1112 } |
1106 | 1113 |
1107 Graph* LoadElimination::graph() const { return jsgraph()->graph(); } | 1114 Graph* LoadElimination::graph() const { return jsgraph()->graph(); } |
1108 | 1115 |
1109 Factory* LoadElimination::factory() const { return jsgraph()->factory(); } | 1116 Factory* LoadElimination::factory() const { return jsgraph()->factory(); } |
1110 | 1117 |
1111 } // namespace compiler | 1118 } // namespace compiler |
1112 } // namespace internal | 1119 } // namespace internal |
1113 } // namespace v8 | 1120 } // namespace v8 |
OLD | NEW |