Chromium Code Reviews| Index: src/api.cc |
| diff --git a/src/api.cc b/src/api.cc |
| index cd23d93338c6f1c08b49ec5f61275b877bfa7b37..d995a65c9b1d89a5d066c4b5d5bc78b63cd0216e 100644 |
| --- a/src/api.cc |
| +++ b/src/api.cc |
| @@ -1647,8 +1647,7 @@ Local<Value> Script::Run() { |
| i::HandleScope scope(isolate); |
| i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(obj); |
| EXCEPTION_PREAMBLE(isolate); |
| - i::Handle<i::Object> receiver( |
| - isolate->context()->global_proxy(), isolate); |
| + i::Handle<i::Object> receiver(isolate->global_proxy(), isolate); |
| i::Handle<i::Object> result; |
| has_pending_exception = !i::Execution::Call( |
| isolate, fun, receiver, 0, NULL).ToHandle(&result); |
| @@ -5105,7 +5104,7 @@ static i::Handle<i::Context> CreateEnvironment( |
| i::Isolate* isolate, |
| v8::ExtensionConfiguration* extensions, |
| v8::Handle<ObjectTemplate> global_template, |
| - v8::Handle<Value> global_object) { |
| + v8::Handle<Value> maybe_global_proxy) { |
| i::Handle<i::Context> env; |
| // Enter V8 via an ENTER_V8 scope. |
| @@ -5143,11 +5142,14 @@ static i::Handle<i::Context> CreateEnvironment( |
| } |
| } |
| + i::Handle<i::Object> proxy = Utils::OpenHandle(*maybe_global_proxy, true); |
| + i::MaybeHandle<i::JSGlobalProxy> maybe_proxy; |
| + if (!proxy.is_null()) { |
| + maybe_proxy = i::Handle<i::JSGlobalProxy>::cast(proxy); |
| + } |
| // Create the environment. |
| env = isolate->bootstrapper()->CreateEnvironment( |
| - Utils::OpenHandle(*global_object, true), |
| - proxy_template, |
| - extensions); |
| + maybe_proxy, proxy_template, extensions); |
| // Restore the access check info on the global template. |
| if (!global_template.IsEmpty()) { |
| @@ -5827,7 +5829,7 @@ bool Value::IsPromise() const { |
| has_pending_exception = !i::Execution::Call( |
| isolate, |
| handle( |
|
Igor Sheludko
2014/07/01 08:35:42
While you are here: the whole thing handle(isolate
|
| - isolate->context()->global_object()->native_context()->is_promise()), |
| + isolate->native_context()->is_promise()), |
| isolate->factory()->undefined_value(), |
| ARRAY_SIZE(argv), argv, |
| false).ToHandle(&b); |
| @@ -5844,8 +5846,7 @@ Local<Promise::Resolver> Promise::Resolver::New(Isolate* v8_isolate) { |
| i::Handle<i::Object> result; |
| has_pending_exception = !i::Execution::Call( |
| isolate, |
| - handle(isolate->context()->global_object()->native_context()-> |
| - promise_create()), |
| + handle(isolate->native_context()->promise_create()), |
|
Igor Sheludko
2014/07/01 08:35:42
Same here.
|
| isolate->factory()->undefined_value(), |
| 0, NULL, |
| false).ToHandle(&result); |
| @@ -5869,8 +5870,7 @@ void Promise::Resolver::Resolve(Handle<Value> value) { |
| i::Handle<i::Object> argv[] = { promise, Utils::OpenHandle(*value) }; |
| has_pending_exception = i::Execution::Call( |
| isolate, |
| - handle(isolate->context()->global_object()->native_context()-> |
| - promise_resolve()), |
| + handle(isolate->native_context()->promise_resolve()), |
|
Igor Sheludko
2014/07/01 08:35:41
Same here.
|
| isolate->factory()->undefined_value(), |
| ARRAY_SIZE(argv), argv, |
| false).is_null(); |
| @@ -5887,8 +5887,7 @@ void Promise::Resolver::Reject(Handle<Value> value) { |
| i::Handle<i::Object> argv[] = { promise, Utils::OpenHandle(*value) }; |
| has_pending_exception = i::Execution::Call( |
| isolate, |
| - handle(isolate->context()->global_object()->native_context()-> |
| - promise_reject()), |
| + handle(isolate->native_context()->promise_reject()), |
|
Igor Sheludko
2014/07/01 08:35:42
Same here.
|
| isolate->factory()->undefined_value(), |
| ARRAY_SIZE(argv), argv, |
| false).is_null(); |
| @@ -5906,8 +5905,7 @@ Local<Promise> Promise::Chain(Handle<Function> handler) { |
| i::Handle<i::Object> result; |
| has_pending_exception = !i::Execution::Call( |
| isolate, |
| - handle(isolate->context()->global_object()->native_context()-> |
| - promise_chain()), |
| + handle(isolate->native_context()->promise_chain()), |
|
Igor Sheludko
2014/07/01 08:35:42
Same here.
|
| promise, |
| ARRAY_SIZE(argv), argv, |
| false).ToHandle(&result); |
| @@ -5926,8 +5924,7 @@ Local<Promise> Promise::Catch(Handle<Function> handler) { |
| i::Handle<i::Object> result; |
| has_pending_exception = !i::Execution::Call( |
| isolate, |
| - handle(isolate->context()->global_object()->native_context()-> |
| - promise_catch()), |
| + handle(isolate->native_context()->promise_catch()), |
|
Igor Sheludko
2014/07/01 08:35:42
Same here.
|
| promise, |
| ARRAY_SIZE(argv), argv, |
| false).ToHandle(&result); |
| @@ -5946,8 +5943,7 @@ Local<Promise> Promise::Then(Handle<Function> handler) { |
| i::Handle<i::Object> result; |
| has_pending_exception = !i::Execution::Call( |
| isolate, |
| - handle(isolate->context()->global_object()->native_context()-> |
| - promise_then()), |
| + handle(isolate->native_context()->promise_then()), |
|
Igor Sheludko
2014/07/01 08:35:42
Same here.
|
| promise, |
| ARRAY_SIZE(argv), argv, |
| false).ToHandle(&result); |
| @@ -6382,7 +6378,7 @@ v8::Local<v8::Context> Isolate::GetCurrentContext() { |
| i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| i::Context* context = isolate->context(); |
| if (context == NULL) return Local<Context>(); |
| - i::Context* native_context = context->global_object()->native_context(); |
| + i::Context* native_context = context->native_context(); |
| if (native_context == NULL) return Local<Context>(); |
| return Utils::ToLocal(i::Handle<i::Context>(native_context)); |
| } |