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

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: Fix comment 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..c3e9d24e11ad0bbee5c6ea81df61bd6c1955ca5c 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) {
+ 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();
@@ -3227,14 +3234,13 @@ Genesis::Genesis(Isolate* isolate,
isolate->counters()->contexts_created_from_scratch()->Increment();
}
- // Install experimental and extra natives. Do not include them into the
+ // Install experimental natives. Do not include them into the
// snapshot as we should be able to turn them off at runtime. Re-installing
// them after they have already been deserialized would also fail.
if (context_type == FULL_CONTEXT) {
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());

Powered by Google App Engine
This is Rietveld 408576698