| Index: src/objects-inl.h
|
| diff --git a/src/objects-inl.h b/src/objects-inl.h
|
| index b3f23e65e3d2998a43dbd04b21213dde5ebf2e4e..2e60a445033a88c22a347fce3ff6dd0c97d9cbb0 100644
|
| --- a/src/objects-inl.h
|
| +++ b/src/objects-inl.h
|
| @@ -649,6 +649,12 @@ bool MaybeObject::IsRetryAfterGC() {
|
| }
|
|
|
|
|
| +bool MaybeObject::IsOutOfMemory() {
|
| + return HAS_FAILURE_TAG(this)
|
| + && Failure::cast(this)->IsOutOfMemoryException();
|
| +}
|
| +
|
| +
|
| bool MaybeObject::IsException() {
|
| return this == Failure::Exception();
|
| }
|
| @@ -1239,6 +1245,11 @@ bool Failure::IsInternalError() const {
|
| }
|
|
|
|
|
| +bool Failure::IsOutOfMemoryException() const {
|
| + return type() == OUT_OF_MEMORY_EXCEPTION;
|
| +}
|
| +
|
| +
|
| AllocationSpace Failure::allocation_space() const {
|
| ASSERT_EQ(RETRY_AFTER_GC, type());
|
| return static_cast<AllocationSpace>((value() >> kFailureTypeTagSize)
|
| @@ -1256,6 +1267,11 @@ Failure* Failure::Exception() {
|
| }
|
|
|
|
|
| +Failure* Failure::OutOfMemoryException(intptr_t value) {
|
| + return Construct(OUT_OF_MEMORY_EXCEPTION, value);
|
| +}
|
| +
|
| +
|
| intptr_t Failure::value() const {
|
| return static_cast<intptr_t>(
|
| reinterpret_cast<uintptr_t>(this) >> kFailureTagSize);
|
|
|