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

Unified Diff: src/bootstrapper.cc

Issue 7529007: Preliminary Harmony weak maps API implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review by Daniel Clifford. Created 9 years, 5 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
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;
« no previous file with comments | « src/SConscript ('k') | src/flag-definitions.h » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698