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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 Failure* Failure::RetryAfterGC(AllocationSpace space) { | 1057 Failure* Failure::RetryAfterGC(AllocationSpace space) { |
1058 ASSERT((space & ~kSpaceTagMask) == 0); | 1058 ASSERT((space & ~kSpaceTagMask) == 0); |
1059 return Construct(RETRY_AFTER_GC, space); | 1059 return Construct(RETRY_AFTER_GC, space); |
1060 } | 1060 } |
1061 | 1061 |
1062 | 1062 |
1063 Failure* Failure::Construct(Type type, intptr_t value) { | 1063 Failure* Failure::Construct(Type type, intptr_t value) { |
1064 uintptr_t info = | 1064 uintptr_t info = |
1065 (static_cast<uintptr_t>(value) << kFailureTypeTagSize) | type; | 1065 (static_cast<uintptr_t>(value) << kFailureTypeTagSize) | type; |
1066 ASSERT(((info << kFailureTagSize) >> kFailureTagSize) == info); | 1066 ASSERT(((info << kFailureTagSize) >> kFailureTagSize) == info); |
1067 return reinterpret_cast<Failure*>((info << kFailureTagSize) | kFailureTag); | 1067 // Fill the unused bits with a pattern that's easy to recognize in crash |
| 1068 // dumps. |
| 1069 static const int kFailureMagicPattern = 0x0BAD0000; |
| 1070 return reinterpret_cast<Failure*>( |
| 1071 (info << kFailureTagSize) | kFailureTag | kFailureMagicPattern); |
1068 } | 1072 } |
1069 | 1073 |
1070 | 1074 |
1071 bool Smi::IsValid(intptr_t value) { | 1075 bool Smi::IsValid(intptr_t value) { |
1072 #ifdef DEBUG | 1076 #ifdef DEBUG |
1073 bool in_range = (value >= kMinValue) && (value <= kMaxValue); | 1077 bool in_range = (value >= kMinValue) && (value <= kMaxValue); |
1074 #endif | 1078 #endif |
1075 | 1079 |
1076 #ifdef V8_TARGET_ARCH_X64 | 1080 #ifdef V8_TARGET_ARCH_X64 |
1077 // To be representable as a long smi, the value must be a 32-bit integer. | 1081 // To be representable as a long smi, the value must be a 32-bit integer. |
(...skipping 4686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5764 #undef WRITE_UINT32_FIELD | 5768 #undef WRITE_UINT32_FIELD |
5765 #undef READ_SHORT_FIELD | 5769 #undef READ_SHORT_FIELD |
5766 #undef WRITE_SHORT_FIELD | 5770 #undef WRITE_SHORT_FIELD |
5767 #undef READ_BYTE_FIELD | 5771 #undef READ_BYTE_FIELD |
5768 #undef WRITE_BYTE_FIELD | 5772 #undef WRITE_BYTE_FIELD |
5769 | 5773 |
5770 | 5774 |
5771 } } // namespace v8::internal | 5775 } } // namespace v8::internal |
5772 | 5776 |
5773 #endif // V8_OBJECTS_INL_H_ | 5777 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |