i::Handle<i::JSFunction> result =
isolate->factory()->NewFunctionFromSharedFunctionInfo(
function,
- i::Isolate::Current()->global_context());
+ isolate->global_context());
return Local<Script>(ToApi<Script>(result));
}
i::Handle<i::SharedFunctionInfo>
function_info(i::SharedFunctionInfo::cast(*obj));
fun = isolate->factory()->NewFunctionFromSharedFunctionInfo(
- function_info, i::Isolate::Current()->global_context());
+ function_info, isolate->global_context());
} else {
fun = i::Handle<i::JSFunction>(i::JSFunction::cast(*obj));
}
EXCEPTION_PREAMBLE();
i::Handle<i::Object> receiver(
- i::Isolate::Current()->context()->global_proxy());
+ isolate->context()->global_proxy());
i::Handle<i::Object> result =
i::Execution::Call(fun, receiver, 0, NULL, &has_pending_exception);
EXCEPTION_BAILOUT_CHECK(Local<Value>());
v8::TryCatch::~TryCatch() {
+ i::Isolate* isolate = i::Isolate::Current();
if (rethrow_) {
v8::HandleScope scope;
v8::Local<v8::Value> exc = v8::Local<v8::Value>::New(Exception());
- i::Isolate::Current()->UnregisterTryCatchHandler(this);
+ isolate->UnregisterTryCatchHandler(this);
v8::ThrowException(exc);
} else {
- i::Isolate::Current()->UnregisterTryCatchHandler(this);
+ isolate->UnregisterTryCatchHandler(this);
}
}
Local<String> Value::ToString() const {
i::Isolate* isolate = i::Isolate::Current();
- if (IsDeadCheck(i::Isolate::Current(), "v8::Value::ToString()")) {
+ if (IsDeadCheck(isolate, "v8::Value::ToString()")) {
return Local<String>();
}
LOG_API(isolate, "ToString");
Local<Boolean> Value::ToBoolean() const {
i::Isolate* isolate = i::Isolate::Current();
- if (IsDeadCheck(i::Isolate::Current(), "v8::Value::ToBoolean()")) {
+ if (IsDeadCheck(isolate, "v8::Value::ToBoolean()")) {
return Local<Boolean>();
}
LOG_API(isolate, "ToBoolean");
global_constructor->set_needs_access_check(
proxy_constructor->needs_access_check());
}
- i::Isolate::Current()->runtime_profiler()->Reset();
+ isolate->runtime_profiler()->Reset();
}
// Leave V8.
v8::Local<v8::Context> Context::GetEntered() {
- if (IsDeadCheck(i::Isolate::Current(), "v8::Context::GetEntered()")) {
+ i::Isolate* isolate = i::Isolate::Current();
+ if (IsDeadCheck(isolate, "v8::Context::GetEntered()")) {
return Local<Context>();
}
i::Handle<i::Object> last =
- i::Isolate::Current()->handle_scope_implementer()->LastEnteredContext();
+ isolate->handle_scope_implementer()->LastEnteredContext();
if (last.is_null()) return Local<Context>();
i::Handle<i::Context> context = i::Handle<i::Context>::cast(last);
return Utils::ToLocal(context);
v8::Local<v8::Context> Context::GetCurrent() {
- if (IsDeadCheck(i::Isolate::Current(), "v8::Context::GetCurrent()")) {
+ i::Isolate* isolate = i::Isolate::Current();
+ if (IsDeadCheck(isolate, "v8::Context::GetCurrent()")) {
return Local<Context>();
}
- i::Handle<i::Object> current = i::Isolate::Current()->global_context();
+ i::Handle<i::Object> current = isolate->global_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::GetCalling() {
- if (IsDeadCheck(i::Isolate::Current(), "v8::Context::GetCalling()")) {
+ i::Isolate* isolate = i::Isolate::Current();
+ if (IsDeadCheck(isolate, "v8::Context::GetCalling()")) {
return Local<Context>();
}
i::Handle<i::Object> calling =
- i::Isolate::Current()->GetCallingGlobalContext();
+ isolate->GetCallingGlobalContext();
if (calling.is_null()) return Local<Context>();
i::Handle<i::Context> context = i::Handle<i::Context>::cast(calling);
return Utils::ToLocal(context);
void Context::DetachGlobal() {
- if (IsDeadCheck(i::Isolate::Current(), "v8::Context::DetachGlobal()")) return;
+ i::Isolate* isolate = i::Isolate::Current();
+ if (IsDeadCheck(isolate, "v8::Context::DetachGlobal()")) return;
ENTER_V8;
i::Object** ctx = reinterpret_cast<i::Object**>(this);
i::Handle<i::Context> context =
i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx));
- i::Isolate::Current()->bootstrapper()->DetachGlobal(context);
+ isolate->bootstrapper()->DetachGlobal(context);
}
LOG_API(isolate, "Object::New");
ENTER_V8;
i::Handle<i::JSObject> obj =
- isolate->factory()->NewJSObject(i::Isolate::Current()->object_function());
+ isolate->factory()->NewJSObject(isolate->object_function());
return Utils::ToLocal(obj);
}
void V8::TerminateExecution(int thread_id) {
- if (!i::Isolate::Current()->IsInitialized()) return;
- API_ENTRY_CHECK("V8::GetCurrentThreadId()");
i::Isolate* isolate = i::Isolate::Current();
+ if (!isolate->IsInitialized()) return;
+ API_ENTRY_CHECK("V8::GetCurrentThreadId()");
// If the thread_id identifies the current thread just terminate
// execution right away. Otherwise, ask the thread manager to
// terminate the thread with the given id if any.
bool V8::IsExecutionTerminating() {
- if (!i::Isolate::Current()->IsInitialized()) return false;
- if (i::Isolate::Current()->has_scheduled_exception()) {
- return i::Isolate::Current()->scheduled_exception() ==
+ 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;
// TODO(sgjesse) support the old message handler API through a simple wrapper.
isolate->set_message_handler(handler);
if (handler != NULL) {
- i::Isolate::Current()->debugger()->SetMessageHandler(MessageHandlerWrapper);
+ isolate->debugger()->SetMessageHandler(MessageHandlerWrapper);
} else {
- i::Isolate::Current()->debugger()->SetMessageHandler(NULL);
+ isolate->debugger()->SetMessageHandler(NULL);
}
}
i::Handle<i::Object> result;
EXCEPTION_PREAMBLE();
if (data.IsEmpty()) {
- result = i::Isolate::Current()->debugger()->Call(
+ result = isolate->debugger()->Call(
Utils::OpenHandle(*fun),
isolate->factory()->undefined_value(),
&has_pending_exception);
} else {
- result = i::Isolate::Current()->debugger()->Call(Utils::OpenHandle(*fun),
+ result = isolate->debugger()->Call(Utils::OpenHandle(*fun),
Utils::OpenHandle(*data),
&has_pending_exception);
}
ON_BAILOUT(isolate, "v8::Debug::GetMirror()", return Local<Value>());
ENTER_V8;
v8::HandleScope scope;
- i::Debug* isolate_debug = i::Isolate::Current()->debug();
+ i::Debug* isolate_debug = isolate->debug();
isolate_debug->Load();
i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global());
i::Handle<i::String> name =