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/factory.h" | 10 #include "src/factory.h" |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 return false; | 962 return false; |
963 } else if (object->IsBoolean()) { | 963 } else if (object->IsBoolean()) { |
964 Add(BOOLEAN); | 964 Add(BOOLEAN); |
965 return object->IsTrue(); | 965 return object->IsTrue(); |
966 } else if (object->IsNull()) { | 966 } else if (object->IsNull()) { |
967 Add(NULL_TYPE); | 967 Add(NULL_TYPE); |
968 return false; | 968 return false; |
969 } else if (object->IsSmi()) { | 969 } else if (object->IsSmi()) { |
970 Add(SMI); | 970 Add(SMI); |
971 return Smi::cast(*object)->value() != 0; | 971 return Smi::cast(*object)->value() != 0; |
972 } else if (object->IsSpecObject()) { | 972 } else if (object->IsJSReceiver()) { |
973 Add(SPEC_OBJECT); | 973 Add(SPEC_OBJECT); |
974 return !object->IsUndetectableObject(); | 974 return !object->IsUndetectableObject(); |
975 } else if (object->IsString()) { | 975 } else if (object->IsString()) { |
976 Add(STRING); | 976 Add(STRING); |
977 return !object->IsUndetectableObject() && | 977 return !object->IsUndetectableObject() && |
978 String::cast(*object)->length() != 0; | 978 String::cast(*object)->length() != 0; |
979 } else if (object->IsSymbol()) { | 979 } else if (object->IsSymbol()) { |
980 Add(SYMBOL); | 980 Add(SYMBOL); |
981 return true; | 981 return true; |
982 } else if (object->IsHeapNumber()) { | 982 } else if (object->IsHeapNumber()) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 if (type->Is(Type::UntaggedPointer())) { | 1061 if (type->Is(Type::UntaggedPointer())) { |
1062 return Representation::External(); | 1062 return Representation::External(); |
1063 } | 1063 } |
1064 | 1064 |
1065 DCHECK(!type->Is(Type::Untagged())); | 1065 DCHECK(!type->Is(Type::Untagged())); |
1066 return Representation::Tagged(); | 1066 return Representation::Tagged(); |
1067 } | 1067 } |
1068 | 1068 |
1069 } // namespace internal | 1069 } // namespace internal |
1070 } // namespace v8 | 1070 } // namespace v8 |
OLD | NEW |