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

Unified Diff: src/bootstrapper.cc

Issue 1128113006: Add the concept of a V8 extras exports object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Was mising test-extra.js :( Created 5 years, 7 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/api.cc ('k') | src/contexts.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 9512a9c0d1eee1a4766493a3b8d2840890363376..d6678b81a7aa9175d6478df8e9898ba643b82301 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -201,6 +201,7 @@ class Genesis BASE_EMBEDDED {
void InitializeGlobal(Handle<GlobalObject> global_object,
Handle<JSFunction> empty_function);
void InitializeExperimentalGlobal();
+ void InitializeExtrasExportsObject();
// Installs the contents of the native .js files on the global objects.
// Used for creating a context from scratch.
void InstallNativeFunctions();
@@ -1441,6 +1442,20 @@ void Genesis::InitializeExperimentalGlobal() {
}
+void Genesis::InitializeExtrasExportsObject() {
+ Handle<JSObject> exports =
+ factory()->NewJSObject(isolate()->object_function(), TENURED);
+
+ native_context()->set_extras_exports_object(*exports);
+
+ Handle<JSBuiltinsObject> builtins(native_context()->builtins());
+ Handle<String> exports_string =
+ factory()->InternalizeOneByteString(STATIC_CHAR_VECTOR("extrasExports"));
+ Runtime::SetObjectProperty(isolate(), builtins, exports_string, exports,
+ STRICT).Assert();
+}
+
+
bool Genesis::CompileBuiltin(Isolate* isolate, int index) {
Vector<const char> name = Natives::GetScriptName(index);
Handle<String> source_code =
@@ -2962,6 +2977,7 @@ Genesis::Genesis(Isolate* isolate,
// them after they have already been deserialized would also fail.
if (!isolate->serializer_enabled()) {
InitializeExperimentalGlobal();
+ InitializeExtrasExportsObject();
if (!InstallExperimentalNatives()) return;
if (!InstallExtraNatives()) return;
}
« no previous file with comments | « src/api.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698