Commit 6a8432da authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Add DCHECKs for no pending exceptions

We were just debugging a trap triggered in the c entry stub, because
there was a pending exception even though the return value of the
runtime function was not {heap()->exception()}.
The DCHECKs added here help to catch this common error earlier.

R=mstarzinger@chromium.org
CC=ahaas@chromium.org

Also-by: ahaas@chromium.org
Change-Id: I3718dcb64a7924137c9f4bddff62776772d10386
Reviewed-on: https://chromium-review.googlesource.com/594447Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47031}
parent a01ac7cb
......@@ -110,12 +110,13 @@ namespace wasm {
class CompilationManager;
}
#define RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate) \
do { \
Isolate* __isolate__ = (isolate); \
if (__isolate__->has_scheduled_exception()) { \
return __isolate__->PromoteScheduledException(); \
} \
#define RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate) \
do { \
Isolate* __isolate__ = (isolate); \
DCHECK(!__isolate__->has_pending_exception()); \
if (__isolate__->has_scheduled_exception()) { \
return __isolate__->PromoteScheduledException(); \
} \
} while (false)
// Macros for MaybeHandle.
......@@ -123,6 +124,7 @@ class CompilationManager;
#define RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, value) \
do { \
Isolate* __isolate__ = (isolate); \
DCHECK(!__isolate__->has_pending_exception()); \
if (__isolate__->has_scheduled_exception()) { \
__isolate__->PromoteScheduledException(); \
return value; \
......@@ -160,6 +162,7 @@ class CompilationManager;
DCHECK(__isolate__->has_pending_exception()); \
return __isolate__->heap()->exception(); \
} \
DCHECK(!__isolate__->has_pending_exception()); \
return *__result__; \
} while (false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment