| 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 817 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 828   Node* const old_value = state->LookupElement(object, index); | 828   Node* const old_value = state->LookupElement(object, index); | 
| 829   if (old_value == new_value) { | 829   if (old_value == new_value) { | 
| 830     // This store is fully redundant. | 830     // This store is fully redundant. | 
| 831     return Replace(effect); | 831     return Replace(effect); | 
| 832   } | 832   } | 
| 833   // Kill all potentially aliasing elements. | 833   // Kill all potentially aliasing elements. | 
| 834   state = state->KillElement(object, index, zone()); | 834   state = state->KillElement(object, index, zone()); | 
| 835   // Only record the new value if the store doesn't have an implicit truncation. | 835   // Only record the new value if the store doesn't have an implicit truncation. | 
| 836   switch (access.machine_type.representation()) { | 836   switch (access.machine_type.representation()) { | 
| 837     case MachineRepresentation::kNone: | 837     case MachineRepresentation::kNone: | 
|  | 838     case MachineRepresentation::kSimd1x4: | 
|  | 839     case MachineRepresentation::kSimd1x8: | 
|  | 840     case MachineRepresentation::kSimd1x16: | 
| 838     case MachineRepresentation::kBit: | 841     case MachineRepresentation::kBit: | 
| 839       UNREACHABLE(); | 842       UNREACHABLE(); | 
| 840       break; | 843       break; | 
| 841     case MachineRepresentation::kWord8: | 844     case MachineRepresentation::kWord8: | 
| 842     case MachineRepresentation::kWord16: | 845     case MachineRepresentation::kWord16: | 
| 843     case MachineRepresentation::kWord32: | 846     case MachineRepresentation::kWord32: | 
| 844     case MachineRepresentation::kWord64: | 847     case MachineRepresentation::kWord64: | 
| 845     case MachineRepresentation::kFloat32: | 848     case MachineRepresentation::kFloat32: | 
| 846       // TODO(turbofan): Add support for doing the truncations. | 849       // TODO(turbofan): Add support for doing the truncations. | 
| 847       break; | 850       break; | 
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1030   return field_index - 1; | 1033   return field_index - 1; | 
| 1031 } | 1034 } | 
| 1032 | 1035 | 
| 1033 // static | 1036 // static | 
| 1034 int LoadElimination::FieldIndexOf(FieldAccess const& access) { | 1037 int LoadElimination::FieldIndexOf(FieldAccess const& access) { | 
| 1035   MachineRepresentation rep = access.machine_type.representation(); | 1038   MachineRepresentation rep = access.machine_type.representation(); | 
| 1036   switch (rep) { | 1039   switch (rep) { | 
| 1037     case MachineRepresentation::kNone: | 1040     case MachineRepresentation::kNone: | 
| 1038     case MachineRepresentation::kBit: | 1041     case MachineRepresentation::kBit: | 
| 1039     case MachineRepresentation::kSimd128: | 1042     case MachineRepresentation::kSimd128: | 
|  | 1043     case MachineRepresentation::kSimd1x4: | 
|  | 1044     case MachineRepresentation::kSimd1x8: | 
|  | 1045     case MachineRepresentation::kSimd1x16: | 
| 1040       UNREACHABLE(); | 1046       UNREACHABLE(); | 
| 1041       break; | 1047       break; | 
| 1042     case MachineRepresentation::kWord32: | 1048     case MachineRepresentation::kWord32: | 
| 1043     case MachineRepresentation::kWord64: | 1049     case MachineRepresentation::kWord64: | 
| 1044       if (rep != MachineType::PointerRepresentation()) { | 1050       if (rep != MachineType::PointerRepresentation()) { | 
| 1045         return -1;  // We currently only track pointer size fields. | 1051         return -1;  // We currently only track pointer size fields. | 
| 1046       } | 1052       } | 
| 1047       break; | 1053       break; | 
| 1048     case MachineRepresentation::kWord8: | 1054     case MachineRepresentation::kWord8: | 
| 1049     case MachineRepresentation::kWord16: | 1055     case MachineRepresentation::kWord16: | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 1071   return jsgraph()->common(); | 1077   return jsgraph()->common(); | 
| 1072 } | 1078 } | 
| 1073 | 1079 | 
| 1074 Graph* LoadElimination::graph() const { return jsgraph()->graph(); } | 1080 Graph* LoadElimination::graph() const { return jsgraph()->graph(); } | 
| 1075 | 1081 | 
| 1076 Factory* LoadElimination::factory() const { return jsgraph()->factory(); } | 1082 Factory* LoadElimination::factory() const { return jsgraph()->factory(); } | 
| 1077 | 1083 | 
| 1078 }  // namespace compiler | 1084 }  // namespace compiler | 
| 1079 }  // namespace internal | 1085 }  // namespace internal | 
| 1080 }  // namespace v8 | 1086 }  // namespace v8 | 
| OLD | NEW | 
|---|