diff options
| author | Ben Murdoch <benm@google.com> | 2011-11-30 16:03:39 +0000 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2011-12-02 17:28:02 +0000 |
| commit | 69a99ed0b2b2ef69d393c371b03db3a98aaf880e (patch) | |
| tree | 6438154d0f3ab526b9206f8860fa4db5cf073c11 /src/bootstrapper.cc | |
| parent | 3fb3ca8c7ca439d408449a395897395c0faae8d1 (diff) | |
| download | android_external_v8-69a99ed0b2b2ef69d393c371b03db3a98aaf880e.tar.gz android_external_v8-69a99ed0b2b2ef69d393c371b03db3a98aaf880e.tar.bz2 android_external_v8-69a99ed0b2b2ef69d393c371b03db3a98aaf880e.zip | |
Upgrade to V8 3.5
Merge V8 3.5.10.24
Simple merge required updates to makefiles only.
Bug: 5688872
Change-Id: I0acdb9a1a53919d84e9a7525308e8371739d2f06
Diffstat (limited to 'src/bootstrapper.cc')
| -rw-r--r-- | src/bootstrapper.cc | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 5375cde7..9f01664d 100644 --- a/src/bootstrapper.cc +++ b/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(); @@ -1159,7 +1160,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, { - // Setup the call-as-function delegate. + // Set up the call-as-function delegate. Handle<Code> code = Handle<Code>(isolate->builtins()->builtin( Builtins::kHandleApiCallAsFunction)); @@ -1171,7 +1172,7 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, } { - // Setup the call-as-constructor delegate. + // Set up the call-as-constructor delegate. Handle<Code> code = Handle<Code>(isolate->builtins()->builtin( Builtins::kHandleApiCallAsConstructor)); @@ -1190,6 +1191,20 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> inner_global, } +void Genesis::InitializeExperimentalGlobal() { + 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<JSObject> prototype = + factory()->NewJSObject(isolate()->object_function(), TENURED); + InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, + prototype, Builtins::kIllegal, true); + } +} + + bool Genesis::CompileBuiltin(Isolate* isolate, int index) { Vector<const char> name = Natives::GetScriptName(index); Handle<String> source_code = @@ -1680,6 +1695,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 +2189,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_; |
