OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/address-map.h" | 9 #include "src/address-map.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 } | 1017 } |
1018 | 1018 |
1019 void VisitObjectState(Node* node) { | 1019 void VisitObjectState(Node* node) { |
1020 if (propagate()) { | 1020 if (propagate()) { |
1021 for (int i = 0; i < node->InputCount(); i++) { | 1021 for (int i = 0; i < node->InputCount(); i++) { |
1022 Node* input = node->InputAt(i); | 1022 Node* input = node->InputAt(i); |
1023 Type* input_type = TypeOf(input); | 1023 Type* input_type = TypeOf(input); |
1024 // TODO(turbofan): Special treatment for ExternalPointer here, | 1024 // TODO(turbofan): Special treatment for ExternalPointer here, |
1025 // to avoid incompatible truncations. We really need a story | 1025 // to avoid incompatible truncations. We really need a story |
1026 // for the JSFunction::entry field. | 1026 // for the JSFunction::entry field. |
1027 UseInfo use_info = input_type->Is(Type::ExternalPointer()) | 1027 UseInfo use_info = UseInfo::None(); |
1028 ? UseInfo::PointerInt() | 1028 if (input_type->IsInhabited()) { |
1029 : UseInfo::Any(); | 1029 if (input_type->Is(Type::ExternalPointer())) { |
| 1030 use_info = UseInfo::PointerInt(); |
| 1031 } else { |
| 1032 use_info = UseInfo::Any(); |
| 1033 } |
| 1034 } |
1030 EnqueueInput(node, i, use_info); | 1035 EnqueueInput(node, i, use_info); |
1031 } | 1036 } |
1032 } else if (lower()) { | 1037 } else if (lower()) { |
1033 Zone* zone = jsgraph_->zone(); | 1038 Zone* zone = jsgraph_->zone(); |
1034 ZoneVector<MachineType>* types = | 1039 ZoneVector<MachineType>* types = |
1035 new (zone->New(sizeof(ZoneVector<MachineType>))) | 1040 new (zone->New(sizeof(ZoneVector<MachineType>))) |
1036 ZoneVector<MachineType>(node->InputCount(), zone); | 1041 ZoneVector<MachineType>(node->InputCount(), zone); |
1037 for (int i = 0; i < node->InputCount(); i++) { | 1042 for (int i = 0; i < node->InputCount(); i++) { |
1038 Node* input = node->InputAt(i); | 1043 Node* input = node->InputAt(i); |
1039 NodeInfo* input_info = GetInfo(input); | 1044 NodeInfo* input_info = GetInfo(input); |
1040 Type* input_type = TypeOf(input); | 1045 Type* input_type = TypeOf(input); |
1041 // TODO(turbofan): Special treatment for ExternalPointer here, | 1046 // TODO(turbofan): Special treatment for ExternalPointer here, |
1042 // to avoid incompatible truncations. We really need a story | 1047 // to avoid incompatible truncations. We really need a story |
1043 // for the JSFunction::entry field. | 1048 // for the JSFunction::entry field. |
1044 if (input_type->Is(Type::ExternalPointer())) { | 1049 if (!input_type->IsInhabited()) { |
| 1050 (*types)[i] = MachineType::None(); |
| 1051 } else if (input_type->Is(Type::ExternalPointer())) { |
1045 (*types)[i] = MachineType::Pointer(); | 1052 (*types)[i] = MachineType::Pointer(); |
1046 } else { | 1053 } else { |
1047 MachineRepresentation rep = input_type->IsInhabited() | 1054 MachineRepresentation rep = input_type->IsInhabited() |
1048 ? input_info->representation() | 1055 ? input_info->representation() |
1049 : MachineRepresentation::kNone; | 1056 : MachineRepresentation::kNone; |
1050 MachineType machine_type(rep, DeoptValueSemanticOf(input_type)); | 1057 MachineType machine_type(rep, DeoptValueSemanticOf(input_type)); |
1051 DCHECK(machine_type.representation() != | 1058 DCHECK(machine_type.representation() != |
1052 MachineRepresentation::kWord32 || | 1059 MachineRepresentation::kWord32 || |
1053 machine_type.semantic() == MachineSemantic::kInt32 || | 1060 machine_type.semantic() == MachineSemantic::kInt32 || |
1054 machine_type.semantic() == MachineSemantic::kUint32); | 1061 machine_type.semantic() == MachineSemantic::kUint32); |
(...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3439 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3446 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
3440 Operator::kNoProperties); | 3447 Operator::kNoProperties); |
3441 to_number_operator_.set(common()->Call(desc)); | 3448 to_number_operator_.set(common()->Call(desc)); |
3442 } | 3449 } |
3443 return to_number_operator_.get(); | 3450 return to_number_operator_.get(); |
3444 } | 3451 } |
3445 | 3452 |
3446 } // namespace compiler | 3453 } // namespace compiler |
3447 } // namespace internal | 3454 } // namespace internal |
3448 } // namespace v8 | 3455 } // namespace v8 |
OLD | NEW |