Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index dcc1c5339c331469a118e80424c323fd2ec54da1..cca0f4bda71e59fcf895bc20d6879866b4ce51cf 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -631,6 +631,7 @@ struct ValueInfo : public Malloced { |
| // A template-ized version of the IsXXX functions. |
| template <class C> static inline bool Is(Object* obj); |
| +class Failure; |
|
Erik Corry
2011/05/19 07:22:32
It would perhaps be neater to group this with the
Lasse Reichstein
2011/05/19 08:40:40
Done.
|
| class MaybeObject BASE_EMBEDDED { |
| public: |
| @@ -644,6 +645,10 @@ class MaybeObject BASE_EMBEDDED { |
| *obj = reinterpret_cast<Object*>(this); |
| return true; |
| } |
| + inline Failure* ToFailureUnchecked() { |
| + ASSERT(IsFailure()); |
| + return reinterpret_cast<Failure*>(this); |
| + } |
| inline Object* ToObjectUnchecked() { |
| ASSERT(!IsFailure()); |
| return reinterpret_cast<Object*>(this); |