| 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-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
| 10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
| (...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 if (!field_index.is_inobject()) { | 889 if (!field_index.is_inobject()) { |
| 890 storage = effect = graph()->NewNode( | 890 storage = effect = graph()->NewNode( |
| 891 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()), | 891 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()), |
| 892 storage, effect, control); | 892 storage, effect, control); |
| 893 } | 893 } |
| 894 FieldAccess field_access = { | 894 FieldAccess field_access = { |
| 895 kTaggedBase, field_index.offset(), name, | 895 kTaggedBase, field_index.offset(), name, |
| 896 field_type, MachineType::AnyTagged(), kFullWriteBarrier}; | 896 field_type, MachineType::AnyTagged(), kFullWriteBarrier}; |
| 897 if (access_mode == AccessMode::kLoad) { | 897 if (access_mode == AccessMode::kLoad) { |
| 898 if (field_type->Is(Type::UntaggedFloat64())) { | 898 if (field_type->Is(Type::UntaggedFloat64())) { |
| 899 // TODO(turbofan): We remove the representation axis from the type to |
| 900 // avoid uninhabited representation types. This is a workaround until |
| 901 // the {PropertyAccessInfo} is using {MachineRepresentation} instead. |
| 902 field_access.type = Type::Union( |
| 903 field_type, Type::Representation(Type::Number(), zone()), zone()); |
| 899 if (!field_index.is_inobject() || field_index.is_hidden_field() || | 904 if (!field_index.is_inobject() || field_index.is_hidden_field() || |
| 900 !FLAG_unbox_double_fields) { | 905 !FLAG_unbox_double_fields) { |
| 901 storage = effect = graph()->NewNode( | 906 storage = effect = graph()->NewNode( |
| 902 simplified()->LoadField(field_access), storage, effect, control); | 907 simplified()->LoadField(field_access), storage, effect, control); |
| 903 field_access.offset = HeapNumber::kValueOffset; | 908 field_access.offset = HeapNumber::kValueOffset; |
| 904 field_access.name = MaybeHandle<Name>(); | 909 field_access.name = MaybeHandle<Name>(); |
| 905 } | 910 } |
| 906 field_access.machine_type = MachineType::Float64(); | 911 field_access.machine_type = MachineType::Float64(); |
| 907 } | 912 } |
| 908 value = effect = graph()->NewNode(simplified()->LoadField(field_access), | 913 value = effect = graph()->NewNode(simplified()->LoadField(field_access), |
| 909 storage, effect, control); | 914 storage, effect, control); |
| 910 } else { | 915 } else { |
| 911 DCHECK_EQ(AccessMode::kStore, access_mode); | 916 DCHECK_EQ(AccessMode::kStore, access_mode); |
| 912 if (field_type->Is(Type::UntaggedFloat64())) { | 917 if (field_type->Is(Type::UntaggedFloat64())) { |
| 918 // TODO(turbofan): We remove the representation axis from the type to |
| 919 // avoid uninhabited representation types. This is a workaround until |
| 920 // the {PropertyAccessInfo} is using {MachineRepresentation} instead. |
| 921 field_access.type = Type::Union( |
| 922 field_type, Type::Representation(Type::Number(), zone()), zone()); |
| 913 value = effect = graph()->NewNode(simplified()->CheckNumber(), value, | 923 value = effect = graph()->NewNode(simplified()->CheckNumber(), value, |
| 914 effect, control); | 924 effect, control); |
| 915 | 925 |
| 916 if (!field_index.is_inobject() || field_index.is_hidden_field() || | 926 if (!field_index.is_inobject() || field_index.is_hidden_field() || |
| 917 !FLAG_unbox_double_fields) { | 927 !FLAG_unbox_double_fields) { |
| 918 if (access_info.HasTransitionMap()) { | 928 if (access_info.HasTransitionMap()) { |
| 919 // Allocate a MutableHeapNumber for the new property. | 929 // Allocate a MutableHeapNumber for the new property. |
| 920 effect = graph()->NewNode( | 930 effect = graph()->NewNode( |
| 921 common()->BeginRegion(RegionObservability::kNotObservable), | 931 common()->BeginRegion(RegionObservability::kNotObservable), |
| 922 effect); | 932 effect); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 } | 1493 } |
| 1484 | 1494 |
| 1485 | 1495 |
| 1486 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1496 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 1487 return jsgraph()->simplified(); | 1497 return jsgraph()->simplified(); |
| 1488 } | 1498 } |
| 1489 | 1499 |
| 1490 } // namespace compiler | 1500 } // namespace compiler |
| 1491 } // namespace internal | 1501 } // namespace internal |
| 1492 } // namespace v8 | 1502 } // namespace v8 |
| OLD | NEW |