Index: src/isolate.h |
diff --git a/src/isolate.h b/src/isolate.h |
index 40f0c0ea5c93e3ae13bacfa9b832273c0e1d0133..da803d6d866defcd8b0453b69faa7a3bbe8283c6 100644 |
--- a/src/isolate.h |
+++ b/src/isolate.h |
@@ -124,6 +124,17 @@ typedef ZoneList<Handle<Object> > ZoneObjectList; |
#define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ |
RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) |
+#define RETURN_RESULT_OR_FAILURE(isolate, call) \ |
+ do { \ |
+ Handle<Object> __result__; \ |
+ Isolate* __isolate__ = (isolate); \ |
+ if (!(call).ToHandle(&__result__)) { \ |
+ DCHECK(__isolate__->has_pending_exception()); \ |
+ return __isolate__->heap()->exception(); \ |
+ } \ |
+ return *__result__; \ |
+ } while (false) |
+ |
#define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) \ |
do { \ |
if (!(call).ToHandle(&dst)) { \ |
@@ -132,21 +143,26 @@ typedef ZoneList<Handle<Object> > ZoneObjectList; |
} \ |
} while (false) |
-#define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ |
- ASSIGN_RETURN_ON_EXCEPTION_VALUE( \ |
- isolate, dst, call, isolate->heap()->exception()) |
+#define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ |
+ do { \ |
+ Isolate* __isolate__ = (isolate); \ |
+ ASSIGN_RETURN_ON_EXCEPTION_VALUE(__isolate__, dst, call, \ |
+ __isolate__->heap()->exception()); \ |
+ } while (false) |
#define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T) \ |
ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, MaybeHandle<T>()) |
-#define THROW_NEW_ERROR(isolate, call, T) \ |
- do { \ |
- return isolate->Throw<T>(isolate->factory()->call); \ |
+#define THROW_NEW_ERROR(isolate, call, T) \ |
+ do { \ |
+ Isolate* __isolate__ = (isolate); \ |
+ return __isolate__->Throw<T>(__isolate__->factory()->call); \ |
} while (false) |
-#define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call) \ |
- do { \ |
- return isolate->Throw(*isolate->factory()->call); \ |
+#define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call) \ |
+ do { \ |
+ Isolate* __isolate__ = (isolate); \ |
+ return __isolate__->Throw(*__isolate__->factory()->call); \ |
} while (false) |
#define RETURN_ON_EXCEPTION_VALUE(isolate, call, value) \ |
@@ -157,8 +173,12 @@ typedef ZoneList<Handle<Object> > ZoneObjectList; |
} \ |
} while (false) |
-#define RETURN_FAILURE_ON_EXCEPTION(isolate, call) \ |
- RETURN_ON_EXCEPTION_VALUE(isolate, call, isolate->heap()->exception()) |
+#define RETURN_FAILURE_ON_EXCEPTION(isolate, call) \ |
+ do { \ |
+ Isolate* __isolate__ = (isolate); \ |
+ RETURN_ON_EXCEPTION_VALUE(__isolate__, call, \ |
+ __isolate__->heap()->exception()); \ |
+ } while (false); |
#define RETURN_ON_EXCEPTION(isolate, call, T) \ |
RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle<T>()) |