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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 field_access.name = MaybeHandle<Name>(); | 269 field_access.name = MaybeHandle<Name>(); |
270 } | 270 } |
271 field_access.machine_type = MachineType::Float64(); | 271 field_access.machine_type = MachineType::Float64(); |
272 } | 272 } |
273 this_value = this_effect = | 273 this_value = this_effect = |
274 graph()->NewNode(simplified()->LoadField(field_access), | 274 graph()->NewNode(simplified()->LoadField(field_access), |
275 this_storage, this_effect, this_control); | 275 this_storage, this_effect, this_control); |
276 } else { | 276 } else { |
277 DCHECK_EQ(AccessMode::kStore, access_mode); | 277 DCHECK_EQ(AccessMode::kStore, access_mode); |
278 if (field_type->Is(Type::UntaggedFloat64())) { | 278 if (field_type->Is(Type::UntaggedFloat64())) { |
279 Node* check = | 279 this_value = this_effect = |
280 graph()->NewNode(simplified()->ObjectIsNumber(), this_value); | 280 graph()->NewNode(simplified()->CheckNumber(), this_value, |
281 this_control = this_effect = | |
282 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, | |
283 this_effect, this_control); | 281 this_effect, this_control); |
284 this_value = graph()->NewNode(simplified()->TypeGuard(Type::Number()), | |
285 this_value, this_control); | |
286 | 282 |
287 if (!field_index.is_inobject() || field_index.is_hidden_field() || | 283 if (!field_index.is_inobject() || field_index.is_hidden_field() || |
288 !FLAG_unbox_double_fields) { | 284 !FLAG_unbox_double_fields) { |
289 if (access_info.HasTransitionMap()) { | 285 if (access_info.HasTransitionMap()) { |
290 // Allocate a MutableHeapNumber for the new property. | 286 // Allocate a MutableHeapNumber for the new property. |
291 this_effect = graph()->NewNode( | 287 this_effect = graph()->NewNode( |
292 common()->BeginRegion(RegionObservability::kNotObservable), | 288 common()->BeginRegion(RegionObservability::kNotObservable), |
293 this_effect); | 289 this_effect); |
294 Node* this_box = this_effect = | 290 Node* this_box = this_effect = |
295 graph()->NewNode(simplified()->Allocate(NOT_TENURED), | 291 graph()->NewNode(simplified()->Allocate(NOT_TENURED), |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 graph()->NewNode(simplified()->CheckFloat64Hole(mode), this_value, | 773 graph()->NewNode(simplified()->CheckFloat64Hole(mode), this_value, |
778 this_effect, this_control); | 774 this_effect, this_control); |
779 } | 775 } |
780 } else { | 776 } else { |
781 DCHECK_EQ(AccessMode::kStore, access_mode); | 777 DCHECK_EQ(AccessMode::kStore, access_mode); |
782 if (IsFastSmiElementsKind(elements_kind)) { | 778 if (IsFastSmiElementsKind(elements_kind)) { |
783 this_value = this_effect = | 779 this_value = this_effect = |
784 graph()->NewNode(simplified()->CheckTaggedSigned(), this_value, | 780 graph()->NewNode(simplified()->CheckTaggedSigned(), this_value, |
785 this_effect, this_control); | 781 this_effect, this_control); |
786 } else if (IsFastDoubleElementsKind(elements_kind)) { | 782 } else if (IsFastDoubleElementsKind(elements_kind)) { |
787 Node* check = | 783 this_value = this_effect = graph()->NewNode( |
788 graph()->NewNode(simplified()->ObjectIsNumber(), this_value); | 784 simplified()->CheckNumber(), this_value, this_effect, this_control); |
789 this_control = this_effect = | |
790 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, | |
791 this_effect, this_control); | |
792 this_value = graph()->NewNode(simplified()->TypeGuard(Type::Number()), | |
793 this_value, this_control); | |
794 // Make sure we do not store signalling NaNs into holey double arrays. | 785 // Make sure we do not store signalling NaNs into holey double arrays. |
795 if (elements_kind == FAST_HOLEY_DOUBLE_ELEMENTS) { | 786 if (elements_kind == FAST_HOLEY_DOUBLE_ELEMENTS) { |
796 this_value = | 787 this_value = |
797 graph()->NewNode(simplified()->NumberSilenceNaN(), this_value); | 788 graph()->NewNode(simplified()->NumberSilenceNaN(), this_value); |
798 } | 789 } |
799 } | 790 } |
800 this_effect = graph()->NewNode(simplified()->StoreElement(element_access), | 791 this_effect = graph()->NewNode(simplified()->StoreElement(element_access), |
801 this_elements, this_index, this_value, | 792 this_elements, this_index, this_value, |
802 this_effect, this_control); | 793 this_effect, this_control); |
803 } | 794 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 } | 1074 } |
1084 | 1075 |
1085 | 1076 |
1086 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1077 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
1087 return jsgraph()->simplified(); | 1078 return jsgraph()->simplified(); |
1088 } | 1079 } |
1089 | 1080 |
1090 } // namespace compiler | 1081 } // namespace compiler |
1091 } // namespace internal | 1082 } // namespace internal |
1092 } // namespace v8 | 1083 } // namespace v8 |
OLD | NEW |