OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 return HAS_FAILURE_TAG(this) | 666 return HAS_FAILURE_TAG(this) |
667 && Failure::cast(this)->type() == Failure::RETRY_AFTER_GC; | 667 && Failure::cast(this)->type() == Failure::RETRY_AFTER_GC; |
668 } | 668 } |
669 | 669 |
670 | 670 |
671 bool MaybeObject::IsException() { | 671 bool MaybeObject::IsException() { |
672 return this == Failure::Exception(); | 672 return this == Failure::Exception(); |
673 } | 673 } |
674 | 674 |
675 | 675 |
676 bool MaybeObject::IsTheHole() { | |
677 return !IsFailure() && ToObjectUnchecked()->IsTheHole(); | |
678 } | |
679 | |
680 | |
681 bool MaybeObject::IsUninitialized() { | |
682 return !IsFailure() && ToObjectUnchecked()->IsUninitialized(); | |
683 } | |
684 | |
685 | |
686 Failure* Failure::cast(MaybeObject* obj) { | 676 Failure* Failure::cast(MaybeObject* obj) { |
687 ASSERT(HAS_FAILURE_TAG(obj)); | 677 ASSERT(HAS_FAILURE_TAG(obj)); |
688 return reinterpret_cast<Failure*>(obj); | 678 return reinterpret_cast<Failure*>(obj); |
689 } | 679 } |
690 | 680 |
691 | 681 |
692 bool Object::IsJSReceiver() { | 682 bool Object::IsJSReceiver() { |
693 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 683 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
694 return IsHeapObject() && | 684 return IsHeapObject() && |
695 HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE; | 685 HeapObject::cast(this)->map()->instance_type() >= FIRST_JS_RECEIVER_TYPE; |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 int smi_shift_bits = kSmiTagSize + kSmiShiftSize; | 1284 int smi_shift_bits = kSmiTagSize + kSmiShiftSize; |
1295 return reinterpret_cast<Smi*>((value << smi_shift_bits) | kSmiTag); | 1285 return reinterpret_cast<Smi*>((value << smi_shift_bits) | kSmiTag); |
1296 } | 1286 } |
1297 | 1287 |
1298 | 1288 |
1299 Failure::Type Failure::type() const { | 1289 Failure::Type Failure::type() const { |
1300 return static_cast<Type>(value() & kFailureTypeTagMask); | 1290 return static_cast<Type>(value() & kFailureTypeTagMask); |
1301 } | 1291 } |
1302 | 1292 |
1303 | 1293 |
1304 bool Failure::IsInternalError() const { | |
1305 return type() == INTERNAL_ERROR; | |
1306 } | |
1307 | |
1308 | |
1309 AllocationSpace Failure::allocation_space() const { | 1294 AllocationSpace Failure::allocation_space() const { |
1310 ASSERT_EQ(RETRY_AFTER_GC, type()); | 1295 ASSERT_EQ(RETRY_AFTER_GC, type()); |
1311 return static_cast<AllocationSpace>((value() >> kFailureTypeTagSize) | 1296 return static_cast<AllocationSpace>((value() >> kFailureTypeTagSize) |
1312 & kSpaceTagMask); | 1297 & kSpaceTagMask); |
1313 } | 1298 } |
1314 | 1299 |
1315 | 1300 |
1316 Failure* Failure::InternalError() { | 1301 Failure* Failure::InternalError() { |
1317 return Construct(INTERNAL_ERROR); | 1302 return Construct(INTERNAL_ERROR); |
1318 } | 1303 } |
(...skipping 5670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6989 #undef READ_SHORT_FIELD | 6974 #undef READ_SHORT_FIELD |
6990 #undef WRITE_SHORT_FIELD | 6975 #undef WRITE_SHORT_FIELD |
6991 #undef READ_BYTE_FIELD | 6976 #undef READ_BYTE_FIELD |
6992 #undef WRITE_BYTE_FIELD | 6977 #undef WRITE_BYTE_FIELD |
6993 #undef NOBARRIER_READ_BYTE_FIELD | 6978 #undef NOBARRIER_READ_BYTE_FIELD |
6994 #undef NOBARRIER_WRITE_BYTE_FIELD | 6979 #undef NOBARRIER_WRITE_BYTE_FIELD |
6995 | 6980 |
6996 } } // namespace v8::internal | 6981 } } // namespace v8::internal |
6997 | 6982 |
6998 #endif // V8_OBJECTS_INL_H_ | 6983 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |