Chromium Code Reviews| Index: src/bootstrapper.cc |
| diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
| index 8cca5614b002d3db55a3f1b09aef85b932b073c8..7a2bd57d424a42376c01d752224e9b569293385d 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 |
|
rossberg
2011/08/02 12:33:38
Can you perhaps move this into a separate function
Michael Starzinger
2011/08/02 14:05:22
Done. I suppose you meant InstallExperimentalNativ
rossberg
2011/08/02 15:32:04
Actually, no, I had in mind a new function that mi
Michael Starzinger
2011/08/02 16:04:51
Done.
|
| + Handle<JSFunction> weakmap_fun = |
| + InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, |
| + isolate->initial_object_prototype(), |
| + Builtins::kIllegal, true); |
| + //global_context()->set_weakmap_function(*weakmap_fun); |
|
danno
2011/08/02 12:48:02
Should this really be commented out? If the code i
Michael Starzinger
2011/08/02 14:05:22
Done.
|
| + } |
| + |
| // Install experimental natives. |
| if (!InstallExperimentalNatives()) return; |