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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 #ifdef OBJECT_PRINT | 927 #ifdef OBJECT_PRINT |
928 #define DECLARE_PRINTER(Name) void Name##Print(FILE* out = stdout); | 928 #define DECLARE_PRINTER(Name) void Name##Print(FILE* out = stdout); |
929 #else | 929 #else |
930 #define DECLARE_PRINTER(Name) | 930 #define DECLARE_PRINTER(Name) |
931 #endif | 931 #endif |
932 | 932 |
933 class MaybeObject BASE_EMBEDDED { | 933 class MaybeObject BASE_EMBEDDED { |
934 public: | 934 public: |
935 inline bool IsFailure(); | 935 inline bool IsFailure(); |
936 inline bool IsRetryAfterGC(); | 936 inline bool IsRetryAfterGC(); |
| 937 inline bool IsOutOfMemory(); |
937 inline bool IsException(); | 938 inline bool IsException(); |
938 INLINE(bool IsTheHole()); | 939 INLINE(bool IsTheHole()); |
939 INLINE(bool IsUninitialized()); | 940 INLINE(bool IsUninitialized()); |
940 inline bool ToObject(Object** obj) { | 941 inline bool ToObject(Object** obj) { |
941 if (IsFailure()) return false; | 942 if (IsFailure()) return false; |
942 *obj = reinterpret_cast<Object*>(this); | 943 *obj = reinterpret_cast<Object*>(this); |
943 return true; | 944 return true; |
944 } | 945 } |
945 inline Failure* ToFailureUnchecked() { | 946 inline Failure* ToFailureUnchecked() { |
946 ASSERT(IsFailure()); | 947 ASSERT(IsFailure()); |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1720 INTERNAL_ERROR = 2, | 1721 INTERNAL_ERROR = 2, |
1721 OUT_OF_MEMORY_EXCEPTION = 3 | 1722 OUT_OF_MEMORY_EXCEPTION = 3 |
1722 }; | 1723 }; |
1723 | 1724 |
1724 inline Type type() const; | 1725 inline Type type() const; |
1725 | 1726 |
1726 // Returns the space that needs to be collected for RetryAfterGC failures. | 1727 // Returns the space that needs to be collected for RetryAfterGC failures. |
1727 inline AllocationSpace allocation_space() const; | 1728 inline AllocationSpace allocation_space() const; |
1728 | 1729 |
1729 inline bool IsInternalError() const; | 1730 inline bool IsInternalError() const; |
| 1731 inline bool IsOutOfMemoryException() const; |
1730 | 1732 |
1731 static inline Failure* RetryAfterGC(AllocationSpace space); | 1733 static inline Failure* RetryAfterGC(AllocationSpace space); |
1732 static inline Failure* RetryAfterGC(); // NEW_SPACE | 1734 static inline Failure* RetryAfterGC(); // NEW_SPACE |
1733 static inline Failure* Exception(); | 1735 static inline Failure* Exception(); |
1734 static inline Failure* InternalError(); | 1736 static inline Failure* InternalError(); |
| 1737 // TODO(jkummerow): The value is temporary instrumentation. Remove it |
| 1738 // when it has served its purpose. |
| 1739 static inline Failure* OutOfMemoryException(intptr_t value); |
1735 // Casting. | 1740 // Casting. |
1736 static inline Failure* cast(MaybeObject* object); | 1741 static inline Failure* cast(MaybeObject* object); |
1737 | 1742 |
1738 // Dispatched behavior. | 1743 // Dispatched behavior. |
1739 void FailurePrint(FILE* out = stdout); | 1744 void FailurePrint(FILE* out = stdout); |
1740 void FailurePrint(StringStream* accumulator); | 1745 void FailurePrint(StringStream* accumulator); |
1741 | 1746 |
1742 DECLARE_VERIFIER(Failure) | 1747 DECLARE_VERIFIER(Failure) |
1743 | 1748 |
1744 private: | 1749 private: |
(...skipping 9041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10786 } else { | 10791 } else { |
10787 value &= ~(1 << bit_position); | 10792 value &= ~(1 << bit_position); |
10788 } | 10793 } |
10789 return value; | 10794 return value; |
10790 } | 10795 } |
10791 }; | 10796 }; |
10792 | 10797 |
10793 } } // namespace v8::internal | 10798 } } // namespace v8::internal |
10794 | 10799 |
10795 #endif // V8_OBJECTS_H_ | 10800 #endif // V8_OBJECTS_H_ |
OLD | NEW |