Chromium Code Reviews| 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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 859 state = state->KillField( | 859 state = state->KillField( |
| 860 object, FieldIndexOf(JSObject::kElementsOffset), zone()); | 860 object, FieldIndexOf(JSObject::kElementsOffset), zone()); |
| 861 if (flags & GrowFastElementsFlag::kArrayObject) { | 861 if (flags & GrowFastElementsFlag::kArrayObject) { |
| 862 state = state->KillField( | 862 state = state->KillField( |
| 863 object, FieldIndexOf(JSArray::kLengthOffset), zone()); | 863 object, FieldIndexOf(JSArray::kLengthOffset), zone()); |
| 864 } | 864 } |
| 865 break; | 865 break; |
| 866 } | 866 } |
| 867 case IrOpcode::kTransitionElementsKind: { | 867 case IrOpcode::kTransitionElementsKind: { |
| 868 Node* const object = NodeProperties::GetValueInput(current, 0); | 868 Node* const object = NodeProperties::GetValueInput(current, 0); |
| 869 Node* const target_map = NodeProperties::GetValueInput(current, 2); | |
| 870 Node* const object_map = state->LookupField( | |
| 871 object, FieldIndexOf(HeapObject::kMapOffset)); | |
| 872 if (target_map == object_map) { | |
|
Benedikt Meurer
2016/11/16 20:22:19
Nit: Please do
if (target_map != object_map) {
| |
| 873 break; | |
| 874 } | |
| 869 state = state->KillField( | 875 state = state->KillField( |
| 870 object, FieldIndexOf(HeapObject::kMapOffset), zone()); | 876 object, FieldIndexOf(HeapObject::kMapOffset), zone()); |
| 871 state = state->KillField( | 877 state = state->KillField( |
| 872 object, FieldIndexOf(JSObject::kElementsOffset), zone()); | 878 object, FieldIndexOf(JSObject::kElementsOffset), zone()); |
| 873 break; | 879 break; |
| 874 } | 880 } |
| 875 case IrOpcode::kStoreField: { | 881 case IrOpcode::kStoreField: { |
| 876 FieldAccess const& access = FieldAccessOf(current->op()); | 882 FieldAccess const& access = FieldAccessOf(current->op()); |
| 877 Node* const object = NodeProperties::GetValueInput(current, 0); | 883 Node* const object = NodeProperties::GetValueInput(current, 0); |
| 878 int field_index = FieldIndexOf(access); | 884 int field_index = FieldIndexOf(access); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 953 | 959 |
| 954 CommonOperatorBuilder* LoadElimination::common() const { | 960 CommonOperatorBuilder* LoadElimination::common() const { |
| 955 return jsgraph()->common(); | 961 return jsgraph()->common(); |
| 956 } | 962 } |
| 957 | 963 |
| 958 Graph* LoadElimination::graph() const { return jsgraph()->graph(); } | 964 Graph* LoadElimination::graph() const { return jsgraph()->graph(); } |
| 959 | 965 |
| 960 } // namespace compiler | 966 } // namespace compiler |
| 961 } // namespace internal | 967 } // namespace internal |
| 962 } // namespace v8 | 968 } // namespace v8 |
| OLD | NEW |