diff options
Diffstat (limited to 'deps/v8/src/top.h')
-rw-r--r-- | deps/v8/src/top.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/deps/v8/src/top.h b/deps/v8/src/top.h index 9d8aa8227f..26ae542f59 100644 --- a/deps/v8/src/top.h +++ b/deps/v8/src/top.h @@ -41,6 +41,15 @@ class Simulator; #define RETURN_IF_SCHEDULED_EXCEPTION() \ if (Top::has_scheduled_exception()) return Top::PromoteScheduledException() +#define RETURN_IF_EMPTY_HANDLE_VALUE(call, value) \ + if (call.is_null()) { \ + ASSERT(Top::has_pending_exception()); \ + return value; \ + } + +#define RETURN_IF_EMPTY_HANDLE(call) \ + RETURN_IF_EMPTY_HANDLE_VALUE(call, Failure::Exception()) + // Top has static variables used for JavaScript execution. class SaveContext; // Forward declaration. @@ -240,12 +249,7 @@ class Top { thread_local_.scheduled_exception_ = Heap::the_hole_value(); } - static void setup_external_caught() { - thread_local_.external_caught_exception_ = - has_pending_exception() && - (thread_local_.catcher_ != NULL) && - (try_catch_handler() == thread_local_.catcher_); - } + static bool IsExternallyCaught(); static void SetCaptureStackTraceForUncaughtExceptions( bool capture, @@ -256,6 +260,11 @@ class Top { // exception. static bool is_out_of_memory(); + static bool is_catchable_by_javascript(MaybeObject* exception) { + return (exception != Failure::OutOfMemoryException()) && + (exception != Heap::termination_exception()); + } + // JS execution stack (see frames.h). static Address c_entry_fp(ThreadLocalTop* thread) { return thread->c_entry_fp_; @@ -388,7 +397,7 @@ class Top { const char* message); // Checks if exception should be reported and finds out if it's // caught externally. - static bool ShouldReportException(bool* is_caught_externally, + static bool ShouldReportException(bool* can_be_caught_externally, bool catchable_by_javascript); // Attempts to compute the current source location, storing the |