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

Unified Diff: src/bootstrapper.cc

Issue 1282793002: Debugger: load debugger builtins as normal native JS. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: use InstallFunctions and InstallConstants Created 5 years, 4 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/bootstrapper.h ('k') | src/debug/debug.h » ('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 12a64d9eb7d3a809256402791b744ee57af1c630..df40bd3f7cdfc303722093c38219e0d35080a06d 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -239,6 +239,7 @@ class Genesis BASE_EMBEDDED {
Handle<JSFunction>* fun);
bool InstallExperimentalNatives();
bool InstallExtraNatives();
+ bool InstallDebuggerNatives();
void InstallBuiltinFunctionIds();
void InstallExperimentalBuiltinFunctionIds();
void InitializeNormalizedMapCaches();
@@ -354,7 +355,7 @@ Handle<Context> Bootstrapper::CreateEnvironment(
extensions, context_type);
Handle<Context> env = genesis.result();
if (env.is_null() ||
- (context_type == FULL_CONTEXT && !InstallExtensions(env, extensions))) {
+ (context_type != THIN_CONTEXT && !InstallExtensions(env, extensions))) {
return Handle<Context>();
}
return scope.CloseAndEscape(env);
@@ -2619,6 +2620,14 @@ bool Genesis::InstallExtraNatives() {
}
+bool Genesis::InstallDebuggerNatives() {
+ for (int i = 0; i < Natives::GetDebuggerCount(); ++i) {
+ if (!Bootstrapper::CompileBuiltin(isolate(), i)) return false;
+ }
+ return CallUtilsFunction(isolate(), "PostDebug");
+}
+
+
bool Bootstrapper::InstallCodeStubNatives(Isolate* isolate) {
for (int i = CodeStubNatives::GetDebuggerCount();
i < CodeStubNatives::GetBuiltinsCount(); i++) {
@@ -2720,9 +2729,6 @@ bool Genesis::InstallSpecialObjects(Handle<Context> native_context) {
Handle<Smi> stack_trace_limit(Smi::FromInt(FLAG_stack_trace_limit), isolate);
JSObject::AddProperty(Error, name, stack_trace_limit, NONE);
- // By now the utils object is useless and can be removed.
- native_context->set_natives_utils_object(*factory->undefined_value());
-
// Expose the natives in global if a name for it is specified.
if (FLAG_expose_natives_as != NULL && strlen(FLAG_expose_natives_as) != 0) {
Handle<String> natives_key =
@@ -3203,7 +3209,7 @@ Genesis::Genesis(Isolate* isolate,
MakeFunctionInstancePrototypeWritable();
- if (context_type == FULL_CONTEXT) {
+ if (context_type != THIN_CONTEXT) {
if (!ConfigureGlobalObjects(global_proxy_template)) return;
}
isolate->counters()->contexts_created_from_scratch()->Increment();
@@ -3217,11 +3223,18 @@ Genesis::Genesis(Isolate* isolate,
InitializeExperimentalGlobal();
if (!InstallExperimentalNatives()) return;
if (!InstallExtraNatives()) return;
+ // By now the utils object is useless and can be removed.
+ native_context()->set_natives_utils_object(
+ isolate->heap()->undefined_value());
}
// The serializer cannot serialize typed arrays. Reset those typed arrays
// for each new context.
InitializeBuiltinTypedArrays();
+ } else if (context_type == DEBUG_CONTEXT) {
+ DCHECK(!isolate->serializer_enabled());
+ InitializeExperimentalGlobal();
+ if (!InstallDebuggerNatives()) return;
}
result_ = native_context();
« no previous file with comments | « src/bootstrapper.h ('k') | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698