Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index af8054f1b446dd86ef7e6f92335427235cfb5820..aea882e85e32041582df7dd2174fe6323d427198 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -69,7 +69,7 @@ namespace v8 { |
#define ON_BAILOUT(isolate, location, code) \ |
if (IsDeadCheck(isolate, location) || \ |
- v8::V8::IsExecutionTerminating()) { \ |
+ IsExecutionTerminatingCheck(isolate)) { \ |
code; \ |
UNREACHABLE(); \ |
} |
@@ -255,6 +255,14 @@ static inline bool IsDeadCheck(i::Isolate* isolate, const char* location) { |
&& i::V8::IsDead() ? ReportV8Dead(location) : false; |
} |
+static inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) { |
+ if (!isolate->IsInitialized()) return false; |
+ if (isolate->has_scheduled_exception()) { |
+ return isolate->scheduled_exception() == |
+ isolate->heap()->termination_exception(); |
+ } |
+ return false; |
+} |
static inline bool EmptyCheck(const char* location, v8::Handle<v8::Data> obj) { |
return obj.IsEmpty() ? ReportEmptyHandle(location) : false; |
@@ -4629,12 +4637,7 @@ void V8::TerminateExecution(Isolate* isolate) { |
bool V8::IsExecutionTerminating() { |
i::Isolate* isolate = i::Isolate::Current(); |
- if (!isolate->IsInitialized()) return false; |
- if (isolate->has_scheduled_exception()) { |
- return isolate->scheduled_exception() == |
- HEAP->termination_exception(); |
- } |
- return false; |
+ return IsExecutionTerminatingCheck(isolate); |
} |