diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-08-11 23:59:21 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-08-11 23:59:21 -0700 |
commit | 89bed195134317a10e6ffffe23a90473790f0a7f (patch) | |
tree | 2e3d714711c151458e9ff18bbfa9d04859939ba1 /deps/v8/src/bootstrapper.cc | |
parent | fb7faefbf53f2e27aa2e9cf9dbd88163eeaefb38 (diff) | |
download | node-89bed195134317a10e6ffffe23a90473790f0a7f.tar.gz |
Upgrade V8 to v3.5.4
Diffstat (limited to 'deps/v8/src/bootstrapper.cc')
-rw-r--r-- | deps/v8/src/bootstrapper.cc | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/deps/v8/src/bootstrapper.cc b/deps/v8/src/bootstrapper.cc index 8cca5614b..a5cb55525 100644 --- a/deps/v8/src/bootstrapper.cc +++ b/deps/v8/src/bootstrapper.cc @@ -199,6 +199,7 @@ class Genesis BASE_EMBEDDED { // New context initialization. Used for creating a context from scratch. void InitializeGlobal(Handle<GlobalObject> inner_global, Handle<JSFunction> empty_function); + void InitializeExperimentalGlobal(); // Installs the contents of the native .js files on the global objects. // Used for creating a context from scratch. void InstallNativeFunctions(); @@ -1190,6 +1191,21 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, } +void Genesis::InitializeExperimentalGlobal() { + Isolate* isolate = this->isolate(); + Handle<JSObject> global = Handle<JSObject>(global_context()->global()); + + // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no + // longer need to live behind a flag, so WeakMap gets added to the snapshot. + if (FLAG_harmony_weakmaps) { // -- W e a k M a p + Handle<JSFunction> weakmap_fun = + InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, + isolate->initial_object_prototype(), + Builtins::kIllegal, true); + } +} + + bool Genesis::CompileBuiltin(Isolate* isolate, int index) { Vector<const char> name = Natives::GetScriptName(index); Handle<String> source_code = @@ -1680,6 +1696,11 @@ bool Genesis::InstallExperimentalNatives() { "native proxy.js") == 0) { if (!CompileExperimentalBuiltin(isolate(), i)) return false; } + if (FLAG_harmony_weakmaps && + strcmp(ExperimentalNatives::GetScriptName(i).start(), + "native weakmap.js") == 0) { + if (!CompileExperimentalBuiltin(isolate(), i)) return false; + } } InstallExperimentalNativeFunctions(); @@ -2169,7 +2190,8 @@ Genesis::Genesis(Isolate* isolate, isolate->counters()->contexts_created_from_scratch()->Increment(); } - // Install experimental natives. + // Initialize experimental globals and install experimental natives. + InitializeExperimentalGlobal(); if (!InstallExperimentalNatives()) return; result_ = global_context_; |