Commit e09ea0a2 authored by jochen's avatar jochen Committed by Commit bot

Remove thin context as it's dead code

R=yangguo@chromium.org,danno@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2094293002
Cr-Commit-Position: refs/heads/master@{#37292}
parent 23332fe8
...@@ -331,8 +331,7 @@ Handle<Context> Bootstrapper::CreateEnvironment( ...@@ -331,8 +331,7 @@ Handle<Context> Bootstrapper::CreateEnvironment(
Genesis genesis(isolate_, maybe_global_proxy, global_proxy_template, Genesis genesis(isolate_, maybe_global_proxy, global_proxy_template,
extensions, context_snapshot_index, context_type); extensions, context_snapshot_index, context_type);
Handle<Context> env = genesis.result(); Handle<Context> env = genesis.result();
if (env.is_null() || if (env.is_null() || !InstallExtensions(env, extensions)) {
(context_type != THIN_CONTEXT && !InstallExtensions(env, extensions))) {
return Handle<Context>(); return Handle<Context>();
} }
return scope.CloseAndEscape(env); return scope.CloseAndEscape(env);
...@@ -1629,8 +1628,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -1629,8 +1628,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Handle<FixedArray> embedder_data = factory->NewFixedArray(3); Handle<FixedArray> embedder_data = factory->NewFixedArray(3);
native_context()->set_embedder_data(*embedder_data); native_context()->set_embedder_data(*embedder_data);
if (context_type == THIN_CONTEXT) return;
{ // -- J S O N { // -- J S O N
Handle<String> name = factory->InternalizeUtf8String("JSON"); Handle<String> name = factory->InternalizeUtf8String("JSON");
Handle<JSFunction> cons = factory->NewFunction(name); Handle<JSFunction> cons = factory->NewFunction(name);
...@@ -2348,8 +2345,6 @@ void Genesis::ConfigureUtilsObject(GlobalContextType context_type) { ...@@ -2348,8 +2345,6 @@ void Genesis::ConfigureUtilsObject(GlobalContextType context_type) {
JSObject::AddProperty(global, natives_key, utils, DONT_ENUM); JSObject::AddProperty(global, natives_key, utils, DONT_ENUM);
break; break;
} }
case THIN_CONTEXT:
break;
} }
// The utils object can be removed for cases that reach this point. // The utils object can be removed for cases that reach this point.
...@@ -2903,9 +2898,6 @@ bool Genesis::InstallNatives(GlobalContextType context_type) { ...@@ -2903,9 +2898,6 @@ bool Genesis::InstallNatives(GlobalContextType context_type) {
DCHECK_EQ(builtin_index, Natives::GetIndex("runtime")); DCHECK_EQ(builtin_index, Natives::GetIndex("runtime"));
if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false; if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false;
// A thin context is ready at this point.
if (context_type == THIN_CONTEXT) return true;
{ {
// Builtin function for OpaqueReference -- a JSValue-based object, // Builtin function for OpaqueReference -- a JSValue-based object,
// that keeps its field isolated from JavaScript code. It may store // that keeps its field isolated from JavaScript code. It may store
...@@ -3875,10 +3867,9 @@ Genesis::Genesis(Isolate* isolate, ...@@ -3875,10 +3867,9 @@ Genesis::Genesis(Isolate* isolate,
MakeFunctionInstancePrototypeWritable(); MakeFunctionInstancePrototypeWritable();
if (context_type != THIN_CONTEXT) { if (!InstallExtraNatives()) return;
if (!InstallExtraNatives()) return; if (!ConfigureGlobalObjects(global_proxy_template)) return;
if (!ConfigureGlobalObjects(global_proxy_template)) return;
}
isolate->counters()->contexts_created_from_scratch()->Increment(); isolate->counters()->contexts_created_from_scratch()->Increment();
// Re-initialize the counter because it got incremented during snapshot // Re-initialize the counter because it got incremented during snapshot
// creation. // creation.
......
...@@ -61,7 +61,7 @@ class SourceCodeCache final BASE_EMBEDDED { ...@@ -61,7 +61,7 @@ class SourceCodeCache final BASE_EMBEDDED {
DISALLOW_COPY_AND_ASSIGN(SourceCodeCache); DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
}; };
enum GlobalContextType { FULL_CONTEXT, THIN_CONTEXT, DEBUG_CONTEXT }; enum GlobalContextType { FULL_CONTEXT, DEBUG_CONTEXT };
// The Boostrapper is the public interface for creating a JavaScript global // The Boostrapper is the public interface for creating a JavaScript global
// context. // context.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment