OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 SimpleListPrinter p(os); | 943 SimpleListPrinter p(os); |
944 if (s.IsEmpty()) p.Add("None"); | 944 if (s.IsEmpty()) p.Add("None"); |
945 if (s.Contains(ToBooleanStub::UNDEFINED)) p.Add("Undefined"); | 945 if (s.Contains(ToBooleanStub::UNDEFINED)) p.Add("Undefined"); |
946 if (s.Contains(ToBooleanStub::BOOLEAN)) p.Add("Bool"); | 946 if (s.Contains(ToBooleanStub::BOOLEAN)) p.Add("Bool"); |
947 if (s.Contains(ToBooleanStub::NULL_TYPE)) p.Add("Null"); | 947 if (s.Contains(ToBooleanStub::NULL_TYPE)) p.Add("Null"); |
948 if (s.Contains(ToBooleanStub::SMI)) p.Add("Smi"); | 948 if (s.Contains(ToBooleanStub::SMI)) p.Add("Smi"); |
949 if (s.Contains(ToBooleanStub::SPEC_OBJECT)) p.Add("SpecObject"); | 949 if (s.Contains(ToBooleanStub::SPEC_OBJECT)) p.Add("SpecObject"); |
950 if (s.Contains(ToBooleanStub::STRING)) p.Add("String"); | 950 if (s.Contains(ToBooleanStub::STRING)) p.Add("String"); |
951 if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol"); | 951 if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol"); |
952 if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber"); | 952 if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber"); |
| 953 if (s.Contains(ToBooleanStub::SIMD_VALUE)) p.Add("SimdValue"); |
953 return os << ")"; | 954 return os << ")"; |
954 } | 955 } |
955 | 956 |
956 | 957 |
957 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) { | 958 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) { |
958 if (object->IsUndefined()) { | 959 if (object->IsUndefined()) { |
959 Add(UNDEFINED); | 960 Add(UNDEFINED); |
960 return false; | 961 return false; |
961 } else if (object->IsBoolean()) { | 962 } else if (object->IsBoolean()) { |
962 Add(BOOLEAN); | 963 Add(BOOLEAN); |
(...skipping 12 matching lines...) Expand all Loading... |
975 return !object->IsUndetectableObject() && | 976 return !object->IsUndetectableObject() && |
976 String::cast(*object)->length() != 0; | 977 String::cast(*object)->length() != 0; |
977 } else if (object->IsSymbol()) { | 978 } else if (object->IsSymbol()) { |
978 Add(SYMBOL); | 979 Add(SYMBOL); |
979 return true; | 980 return true; |
980 } else if (object->IsHeapNumber()) { | 981 } else if (object->IsHeapNumber()) { |
981 DCHECK(!object->IsUndetectableObject()); | 982 DCHECK(!object->IsUndetectableObject()); |
982 Add(HEAP_NUMBER); | 983 Add(HEAP_NUMBER); |
983 double value = HeapNumber::cast(*object)->value(); | 984 double value = HeapNumber::cast(*object)->value(); |
984 return value != 0 && !std::isnan(value); | 985 return value != 0 && !std::isnan(value); |
| 986 } else if (object->IsFloat32x4()) { |
| 987 Add(SIMD_VALUE); |
| 988 return true; |
985 } else { | 989 } else { |
986 // We should never see an internal object at runtime here! | 990 // We should never see an internal object at runtime here! |
987 UNREACHABLE(); | 991 UNREACHABLE(); |
988 return true; | 992 return true; |
989 } | 993 } |
990 } | 994 } |
991 | 995 |
992 | 996 |
993 bool ToBooleanStub::Types::NeedsMap() const { | 997 bool ToBooleanStub::Types::NeedsMap() const { |
994 return Contains(ToBooleanStub::SPEC_OBJECT) | 998 return Contains(ToBooleanStub::SPEC_OBJECT) || |
995 || Contains(ToBooleanStub::STRING) | 999 Contains(ToBooleanStub::STRING) || Contains(ToBooleanStub::SYMBOL) || |
996 || Contains(ToBooleanStub::SYMBOL) | 1000 Contains(ToBooleanStub::HEAP_NUMBER) || |
997 || Contains(ToBooleanStub::HEAP_NUMBER); | 1001 Contains(ToBooleanStub::SIMD_VALUE); |
998 } | 1002 } |
999 | 1003 |
1000 | 1004 |
1001 bool ToBooleanStub::Types::CanBeUndetectable() const { | 1005 bool ToBooleanStub::Types::CanBeUndetectable() const { |
1002 return Contains(ToBooleanStub::SPEC_OBJECT) | 1006 return Contains(ToBooleanStub::SPEC_OBJECT) |
1003 || Contains(ToBooleanStub::STRING); | 1007 || Contains(ToBooleanStub::STRING); |
1004 } | 1008 } |
1005 | 1009 |
1006 | 1010 |
1007 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { | 1011 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 | 1065 |
1062 if (type->Is(Type::UntaggedPointer())) { | 1066 if (type->Is(Type::UntaggedPointer())) { |
1063 return Representation::External(); | 1067 return Representation::External(); |
1064 } | 1068 } |
1065 | 1069 |
1066 DCHECK(!type->Is(Type::Untagged())); | 1070 DCHECK(!type->Is(Type::Untagged())); |
1067 return Representation::Tagged(); | 1071 return Representation::Tagged(); |
1068 } | 1072 } |
1069 } // namespace internal | 1073 } // namespace internal |
1070 } // namespace v8 | 1074 } // namespace v8 |
OLD | NEW |