| Index: src/objects.h
|
| ===================================================================
|
| --- src/objects.h (revision 5559)
|
| +++ src/objects.h (working copy)
|
| @@ -585,13 +585,26 @@
|
| template <class C> static inline bool Is(Object* obj);
|
|
|
|
|
| +class Object;
|
| +
|
| +
|
| +class TryAllocation BASE_EMBEDDED {
|
| + public:
|
| + inline bool ToObject(Object** out) {
|
| + if (this->IsFailure()) return false;
|
| + *out = Object::cast(this);
|
| + return true;
|
| + }
|
| +};
|
| +
|
| +
|
| // Object is the abstract superclass for all classes in the
|
| // object hierarchy.
|
| // Object does not use any virtual functions to avoid the
|
| // allocation of the C++ vtable.
|
| // Since Smi and Failure are subclasses of Object no
|
| // data members can be present in Object.
|
| -class Object BASE_EMBEDDED {
|
| +class Object : public TryAllocation {
|
| public:
|
| // Type testing.
|
| inline bool IsSmi();
|
| @@ -619,7 +632,6 @@
|
| inline bool IsExternalIntArray();
|
| inline bool IsExternalUnsignedIntArray();
|
| inline bool IsExternalFloatArray();
|
| - inline bool IsFailure();
|
| inline bool IsRetryAfterGC();
|
| inline bool IsOutOfMemoryFailure();
|
| inline bool IsException();
|
| @@ -820,7 +832,7 @@
|
| const int kFailureTypeTagSize = 2;
|
| const int kFailureTypeTagMask = (1 << kFailureTypeTagSize) - 1;
|
|
|
| -class Failure: public Object {
|
| +class Failure: public TryAllocation {
|
| public:
|
| // RuntimeStubs assumes EXCEPTION = 1 in the compiler-generated code.
|
| enum Type {
|
| @@ -1282,7 +1294,7 @@
|
| Object* PrepareElementsForSort(uint32_t limit);
|
| // As PrepareElementsForSort, but only on objects where elements is
|
| // a dictionary, and it will stay a dictionary.
|
| - MUST_USE_RESULT Object* PrepareSlowElementsForSort(uint32_t limit);
|
| + TryAllocation* PrepareSlowElementsForSort(uint32_t limit);
|
|
|
| Object* SetProperty(String* key,
|
| Object* value,
|
|
|