| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 3fab8de82fe3a50b7b089810a734b6f4e7369bf0..2df32ca6fc814bdec05983fae63ceaeb14fd9d51 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -5007,20 +5007,7 @@ v8::Local<v8::Context> Context::GetCurrent() {
|
| if (IsDeadCheck(isolate, "v8::Context::GetCurrent()")) {
|
| return Local<Context>();
|
| }
|
| - i::Handle<i::Object> current = isolate->native_context();
|
| - if (current.is_null()) return Local<Context>();
|
| - i::Handle<i::Context> context = i::Handle<i::Context>::cast(current);
|
| - return Utils::ToLocal(context);
|
| -}
|
| -
|
| -
|
| -v8::Local<v8::Context> Context::GetCurrent(Isolate* exported_isolate) {
|
| - i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
|
| - ASSERT(isolate == i::Isolate::Current());
|
| - i::Handle<i::Object> current = isolate->native_context();
|
| - if (current.is_null()) return Local<Context>();
|
| - i::Handle<i::Context> context = i::Handle<i::Context>::cast(current);
|
| - return Utils::ToLocal(context);
|
| + return reinterpret_cast<Isolate*>(isolate)->GetCurrentContext();
|
| }
|
|
|
|
|
| @@ -5825,6 +5812,15 @@ CpuProfiler* Isolate::GetCpuProfiler() {
|
| }
|
|
|
|
|
| +v8::Local<v8::Context> Isolate::GetCurrentContext() {
|
| + i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(this);
|
| + i::Handle<i::Object> current = internal_isolate->native_context();
|
| + if (current.is_null()) return Local<Context>();
|
| + i::Handle<i::Context> context = i::Handle<i::Context>::cast(current);
|
| + return Utils::ToLocal(context);
|
| +}
|
| +
|
| +
|
| void V8::SetGlobalGCPrologueCallback(GCCallback callback) {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return;
|
|
|