Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1530)

Unified Diff: src/isolate.h

Issue 2006673002: Reduce boilerplace for common pattern to return MaybeHandle. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ic.cc ('k') | src/runtime/runtime-array.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index 40f0c0ea5c93e3ae13bacfa9b832273c0e1d0133..57c17fe5832d5812b48dd127e9ac1444e88b9dbc 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -124,6 +124,16 @@ 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__; \
+ if (!(call).ToHandle(&__result__)) { \
+ DCHECK((isolate)->has_pending_exception()); \
+ return isolate->heap()->exception(); \
Jakob Kummerow 2016/05/24 09:16:21 It seems inconsistent that the DCHECK line puts pa
Yang 2016/05/24 11:07:21 you are right. We actually have this problem below
+ } \
+ return *__result__; \
+ } while (false)
+
#define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) \
do { \
if (!(call).ToHandle(&dst)) { \
« no previous file with comments | « src/ic/ic.cc ('k') | src/runtime/runtime-array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698