Commit d9d603c5 authored by jochen's avatar jochen Committed by Commit bot

Inline Isolate::UncheckedCurrent into isolate.cc

BUG=2487
R=yangguo@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1467973002

Cr-Commit-Position: refs/heads/master@{#32165}
parent c7aace4d
...@@ -1847,7 +1847,9 @@ void Isolate::TearDown() { ...@@ -1847,7 +1847,9 @@ void Isolate::TearDown() {
// direct pointer. We don't use Enter/Exit here to avoid // direct pointer. We don't use Enter/Exit here to avoid
// initializing the thread data. // initializing the thread data.
PerIsolateThreadData* saved_data = CurrentPerIsolateThreadData(); PerIsolateThreadData* saved_data = CurrentPerIsolateThreadData();
Isolate* saved_isolate = UncheckedCurrent(); DCHECK(base::NoBarrier_Load(&isolate_key_created_) == 1);
Isolate* saved_isolate =
reinterpret_cast<Isolate*>(base::Thread::GetThreadLocal(isolate_key_));
SetIsolateThreadLocals(this, NULL); SetIsolateThreadLocals(this, NULL);
Deinit(); Deinit();
......
...@@ -481,14 +481,9 @@ class Isolate { ...@@ -481,14 +481,9 @@ class Isolate {
return isolate; return isolate;
} }
INLINE(static Isolate* UncheckedCurrent()) { // Like Current, but skips the check that |isolate_key_| was initialized.
DCHECK(base::NoBarrier_Load(&isolate_key_created_) == 1); // Callers have to ensure that themselves.
return reinterpret_cast<Isolate*>( // DO NOT USE. The only remaining callsite will be deleted soon.
base::Thread::GetThreadLocal(isolate_key_));
}
// Like UncheckedCurrent, but skips the check that |isolate_key_| was
// initialized. Callers have to ensure that themselves.
INLINE(static Isolate* UnsafeCurrent()) { INLINE(static Isolate* UnsafeCurrent()) {
return reinterpret_cast<Isolate*>( return reinterpret_cast<Isolate*>(
base::Thread::GetThreadLocal(isolate_key_)); base::Thread::GetThreadLocal(isolate_key_));
......
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