Flush out potential leaks of Failure objects
Review URL: https://codereview.chromium.org/11475027 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13181 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
35cd58365d
commit
d1cbd1a98c
@ -1927,7 +1927,7 @@ class Heap {
|
||||
|
||||
void CreateFixedStubs();
|
||||
|
||||
MaybeObject* CreateOddball(const char* to_string,
|
||||
MUST_USE_RESULT MaybeObject* CreateOddball(const char* to_string,
|
||||
Object* to_number,
|
||||
byte kind);
|
||||
|
||||
|
@ -1064,7 +1064,11 @@ Failure* Failure::Construct(Type type, intptr_t value) {
|
||||
uintptr_t info =
|
||||
(static_cast<uintptr_t>(value) << kFailureTypeTagSize) | type;
|
||||
ASSERT(((info << kFailureTagSize) >> kFailureTagSize) == info);
|
||||
return reinterpret_cast<Failure*>((info << kFailureTagSize) | kFailureTag);
|
||||
// Fill the unused bits with a pattern that's easy to recognize in crash
|
||||
// dumps.
|
||||
static const int kFailureMagicPattern = 0x0BAD0000;
|
||||
return reinterpret_cast<Failure*>(
|
||||
(info << kFailureTagSize) | kFailureTag | kFailureMagicPattern);
|
||||
}
|
||||
|
||||
|
||||
|
@ -773,7 +773,9 @@ class MaybeObject BASE_EMBEDDED {
|
||||
return reinterpret_cast<Failure*>(this);
|
||||
}
|
||||
inline Object* ToObjectUnchecked() {
|
||||
ASSERT(!IsFailure());
|
||||
// TODO(jkummerow): Turn this back into an ASSERT when we can be certain
|
||||
// that it never fires in Release mode in the wild.
|
||||
CHECK(!IsFailure());
|
||||
return reinterpret_cast<Object*>(this);
|
||||
}
|
||||
inline Object* ToObjectChecked() {
|
||||
|
Loading…
Reference in New Issue
Block a user