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

Unified Diff: src/bootstrapper.cc

Issue 1180043004: Revert of Add script context with context-allocated "const this" (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 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/arm64/full-codegen-arm64.cc ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 73dd2989a79d997cdfe20a48bd1a8e020d02a2ba..c675fe7e0d423211669c505a2f1a7a4169a9aa31 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -197,11 +197,6 @@
// other objects in the snapshot.
void HookUpGlobalObject(Handle<GlobalObject> global_object,
Handle<FixedArray> outdated_contexts);
- // The native context has a ScriptContextTable that store declarative bindings
- // made in script scopes. Add a "this" binding to that table pointing to the
- // global proxy.
- void InstallGlobalThisBinding();
- void HookUpGlobalThisBinding(Handle<FixedArray> outdated_contexts);
// New context initialization. Used for creating a context from scratch.
void InitializeGlobal(Handle<GlobalObject> global_object,
Handle<JSFunction> empty_function);
@@ -815,40 +810,6 @@
{
v8::NeanderArray listeners(isolate());
native_context()->set_message_listeners(*listeners.value());
- }
-}
-
-
-void Genesis::InstallGlobalThisBinding() {
- Handle<ScriptContextTable> script_contexts(
- native_context()->script_context_table());
- Handle<ScopeInfo> scope_info = ScopeInfo::CreateGlobalThisBinding(isolate());
- Handle<JSFunction> closure(native_context()->closure());
- Handle<Context> context = factory()->NewScriptContext(closure, scope_info);
-
- // Go ahead and hook it up while we're at it.
- int slot = scope_info->ReceiverContextSlotIndex();
- DCHECK_EQ(slot, Context::MIN_CONTEXT_SLOTS);
- context->set(slot, native_context()->global_proxy());
-
- native_context()->set_script_context_table(
- *ScriptContextTable::Extend(script_contexts, context));
-}
-
-
-void Genesis::HookUpGlobalThisBinding(Handle<FixedArray> outdated_contexts) {
- // One of these contexts should be the one that declares the global "this"
- // binding.
- for (int i = 0; i < outdated_contexts->length(); ++i) {
- Context* context = Context::cast(outdated_contexts->get(i));
- if (context->IsScriptContext()) {
- ScopeInfo* scope_info = ScopeInfo::cast(context->extension());
- int slot = scope_info->ReceiverContextSlotIndex();
- if (slot >= 0) {
- DCHECK_EQ(slot, Context::MIN_CONTEXT_SLOTS);
- context->set(slot, native_context()->global_proxy());
- }
- }
}
}
@@ -1011,7 +972,6 @@
Handle<ScriptContextTable> script_context_table =
factory->NewScriptContextTable();
native_context()->set_script_context_table(*script_context_table);
- InstallGlobalThisBinding();
Handle<String> object_name = factory->Object_string();
JSObject::AddProperty(
@@ -3126,7 +3086,6 @@
HookUpGlobalObject(global_object, outdated_contexts);
native_context()->builtins()->set_global_proxy(
native_context()->global_proxy());
- HookUpGlobalThisBinding(outdated_contexts);
if (!ConfigureGlobalObjects(global_proxy_template)) return;
} else {
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698