| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 if (!field_index.is_inobject()) { | 253 if (!field_index.is_inobject()) { |
| 254 this_storage = this_effect = graph()->NewNode( | 254 this_storage = this_effect = graph()->NewNode( |
| 255 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()), | 255 simplified()->LoadField(AccessBuilder::ForJSObjectProperties()), |
| 256 this_storage, this_effect, this_control); | 256 this_storage, this_effect, this_control); |
| 257 } | 257 } |
| 258 FieldAccess field_access = { | 258 FieldAccess field_access = { |
| 259 kTaggedBase, field_index.offset(), name, | 259 kTaggedBase, field_index.offset(), name, |
| 260 field_type, MachineType::AnyTagged(), kFullWriteBarrier}; | 260 field_type, MachineType::AnyTagged(), kFullWriteBarrier}; |
| 261 if (access_mode == AccessMode::kLoad) { | 261 if (access_mode == AccessMode::kLoad) { |
| 262 if (field_type->Is(Type::UntaggedFloat64())) { | 262 if (field_type->Is(Type::UntaggedFloat64())) { |
| 263 // TODO(turbofan): We remove the representation axis from the type to |
| 264 // avoid uninhabited representation types. This is a workaround until |
| 265 // the {PropertyAccessInfo} is using {MachineRepresentation} instead. |
| 266 field_access.type = Type::Union( |
| 267 field_type, Type::Representation(Type::Number(), zone()), zone()); |
| 263 if (!field_index.is_inobject() || field_index.is_hidden_field() || | 268 if (!field_index.is_inobject() || field_index.is_hidden_field() || |
| 264 !FLAG_unbox_double_fields) { | 269 !FLAG_unbox_double_fields) { |
| 265 this_storage = this_effect = | 270 this_storage = this_effect = |
| 266 graph()->NewNode(simplified()->LoadField(field_access), | 271 graph()->NewNode(simplified()->LoadField(field_access), |
| 267 this_storage, this_effect, this_control); | 272 this_storage, this_effect, this_control); |
| 268 field_access.offset = HeapNumber::kValueOffset; | 273 field_access.offset = HeapNumber::kValueOffset; |
| 269 field_access.name = MaybeHandle<Name>(); | 274 field_access.name = MaybeHandle<Name>(); |
| 270 } | 275 } |
| 271 field_access.machine_type = MachineType::Float64(); | 276 field_access.machine_type = MachineType::Float64(); |
| 272 } | 277 } |
| 273 this_value = this_effect = | 278 this_value = this_effect = |
| 274 graph()->NewNode(simplified()->LoadField(field_access), | 279 graph()->NewNode(simplified()->LoadField(field_access), |
| 275 this_storage, this_effect, this_control); | 280 this_storage, this_effect, this_control); |
| 276 } else { | 281 } else { |
| 277 DCHECK_EQ(AccessMode::kStore, access_mode); | 282 DCHECK_EQ(AccessMode::kStore, access_mode); |
| 278 if (field_type->Is(Type::UntaggedFloat64())) { | 283 if (field_type->Is(Type::UntaggedFloat64())) { |
| 284 // TODO(turbofan): We remove the representation axis from the type to |
| 285 // avoid uninhabited representation types. This is a workaround until |
| 286 // the {PropertyAccessInfo} is using {MachineRepresentation} instead. |
| 287 field_access.type = Type::Union( |
| 288 field_type, Type::Representation(Type::Number(), zone()), zone()); |
| 279 Node* check = | 289 Node* check = |
| 280 graph()->NewNode(simplified()->ObjectIsNumber(), this_value); | 290 graph()->NewNode(simplified()->ObjectIsNumber(), this_value); |
| 281 this_control = this_effect = | 291 this_control = this_effect = |
| 282 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, | 292 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, |
| 283 this_effect, this_control); | 293 this_effect, this_control); |
| 284 this_value = graph()->NewNode(simplified()->TypeGuard(Type::Number()), | 294 this_value = graph()->NewNode(simplified()->TypeGuard(Type::Number()), |
| 285 this_value, this_control); | 295 this_value, this_control); |
| 286 | 296 |
| 287 if (!field_index.is_inobject() || field_index.is_hidden_field() || | 297 if (!field_index.is_inobject() || field_index.is_hidden_field() || |
| 288 !FLAG_unbox_double_fields) { | 298 !FLAG_unbox_double_fields) { |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 } | 1093 } |
| 1084 | 1094 |
| 1085 | 1095 |
| 1086 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1096 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 1087 return jsgraph()->simplified(); | 1097 return jsgraph()->simplified(); |
| 1088 } | 1098 } |
| 1089 | 1099 |
| 1090 } // namespace compiler | 1100 } // namespace compiler |
| 1091 } // namespace internal | 1101 } // namespace internal |
| 1092 } // namespace v8 | 1102 } // namespace v8 |
| OLD | NEW |