Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 8cca5614b002d3db55a3f1b09aef85b932b073c8..8d134279533a86375de8062972032d4f8de8bc89 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -1680,6 +1680,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,6 +2174,17 @@ Genesis::Genesis(Isolate* isolate, |
isolate->counters()->contexts_created_from_scratch()->Increment(); |
} |
+ // TODO(mstarzinger): Move this into Genesis::InitializeGlobal once we no |
+ // longer need to live behind a flag, so WeakMap gets added to the snapshot. |
+ Handle<JSObject> global = Handle<JSObject>(global_context()->global()); |
+ if (FLAG_harmony_weakmaps) { // -- W e a k M a p |
+ Handle<JSFunction> weakmap_fun = |
+ InstallFunction(global, "WeakMap", JS_WEAKMAP_TYPE, JSWeakMap::kSize, |
+ isolate->initial_object_prototype(), |
+ Builtins::kIllegal, true); |
+ //global_context()->set_weakmap_function(*weakmap_fun); |
+ } |
+ |
// Install experimental natives. |
if (!InstallExperimentalNatives()) return; |