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

Unified Diff: src/api.cc

Issue 6713128: Remove TLS read from ON_BAILOUT. (Closed)
Patch Set: Created 9 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index af8054f1b446dd86ef7e6f92335427235cfb5820..31ff758931b734833e71d1cd1f037389eadc89a2 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(); \
}
@@ -256,6 +256,16 @@ static inline bool IsDeadCheck(i::Isolate* isolate, const char* location) {
}
+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 +4639,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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698