Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/objects-inl.h

Issue 11475027: Flush out potential leaks of Failure objects (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added comment Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698