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

Unified Diff: src/bootstrapper.cc

Issue 1289603002: Put V8 extras into the snapshot (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Get rid of testing stuff. All works. 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
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 5fee78310d4575e97d723900a44d590c8bf70603..b7c053c999a16ace6d1cd673679f95cc5dbed5c6 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -238,7 +238,7 @@ class Genesis BASE_EMBEDDED {
void InstallTypedArray(const char* name, ElementsKind elements_kind,
Handle<JSFunction>* fun);
bool InstallExperimentalNatives();
- bool InstallExtraNatives();
+ bool InstallExtraNatives(ContextType context_type);
bool InstallDebuggerNatives();
void InstallBuiltinFunctionIds();
void InstallExperimentalBuiltinFunctionIds();
@@ -2100,12 +2100,6 @@ bool Genesis::InstallNatives(ContextType context_type) {
"utils container for native scripts");
native_context()->set_natives_utils_object(*utils);
- Handle<JSObject> extras_binding =
- factory()->NewJSObject(isolate()->object_function());
- JSObject::NormalizeProperties(extras_binding, CLEAR_INOBJECT_PROPERTIES, 2,
- "container for binding to/from extra natives");
- native_context()->set_extras_binding_object(*extras_binding);
-
if (FLAG_expose_natives_as != NULL) {
Handle<String> utils_key = factory()->NewStringFromAsciiChecked("utils");
JSObject::AddProperty(builtins, utils_key, utils, NONE);
@@ -2613,7 +2607,19 @@ bool Genesis::InstallExperimentalNatives() {
}
-bool Genesis::InstallExtraNatives() {
+bool Genesis::InstallExtraNatives(ContextType context_type) {
+ if (context_type == THIN_CONTEXT) {
domenic 2015/08/12 19:44:12 This maybe should be != FULL_CONTEXT?
+ return true;
+ }
+
+ HandleScope scope(isolate());
+
+ Handle<JSObject> extras_binding =
+ factory()->NewJSObject(isolate()->object_function());
+ JSObject::NormalizeProperties(extras_binding, CLEAR_INOBJECT_PROPERTIES, 2,
+ "container for binding to/from extra natives");
+ native_context()->set_extras_binding_object(*extras_binding);
+
for (int i = ExtraNatives::GetDebuggerCount();
i < ExtraNatives::GetBuiltinsCount(); i++) {
if (!Bootstrapper::CompileExtraBuiltin(isolate(), i)) return false;
@@ -3218,6 +3224,7 @@ Genesis::Genesis(Isolate* isolate,
InitializeNormalizedMapCaches();
if (!InstallNatives(context_type)) return;
+ if (!InstallExtraNatives(context_type)) return;
MakeFunctionInstancePrototypeWritable();
@@ -3234,7 +3241,6 @@ Genesis::Genesis(Isolate* isolate,
if (!isolate->serializer_enabled()) {
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());
« no previous file with comments | « src/api.cc ('k') | src/snapshot/serialize.h » ('j') | src/snapshot/serialize.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698