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

Unified Diff: src/execution.cc

Issue 352173006: Clean up the global object naming madness. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 6 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 | « src/debug.cc ('k') | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 2766e76b8caa5454923542d8861a6a581977f946..2a2c90a4e4b0e8874135ddf4af9f0c4271c1035e 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -70,8 +70,7 @@ MUST_USE_RESULT static MaybeHandle<Object> Invoke(
// receiver instead to avoid having a 'this' pointer which refers
// directly to a global object.
if (receiver->IsGlobalObject()) {
- Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver);
- receiver = Handle<JSObject>(global->global_receiver());
+ receiver = handle(Handle<GlobalObject>::cast(receiver)->global_proxy());
}
// Make sure that the global object of the context we're about to
@@ -133,13 +132,8 @@ MaybeHandle<Object> Execution::Call(Isolate* isolate,
!func->shared()->native() &&
func->shared()->strict_mode() == SLOPPY) {
if (receiver->IsUndefined() || receiver->IsNull()) {
- Object* global = func->context()->global_object()->global_receiver();
- // Under some circumstances, 'global' can be the JSBuiltinsObject
- // In that case, don't rewrite. (FWIW, the same holds for
- // GetIsolate()->global_object()->global_receiver().)
- if (!global->IsJSBuiltinsObject()) {
- receiver = Handle<Object>(global, func->GetIsolate());
- }
+ receiver = handle(func->global_proxy());
+ ASSERT(!receiver->IsJSBuiltinsObject());
} else {
ASSIGN_RETURN_ON_EXCEPTION(
isolate, receiver, ToObject(isolate, receiver), Object);
@@ -153,7 +147,7 @@ MaybeHandle<Object> Execution::Call(Isolate* isolate,
MaybeHandle<Object> Execution::New(Handle<JSFunction> func,
int argc,
Handle<Object> argv[]) {
- return Invoke(true, func, func->GetIsolate()->global_object(), argc, argv);
+ return Invoke(true, func, handle(func->global_proxy()), argc, argv);
}
« no previous file with comments | « src/debug.cc ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698