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

Unified Diff: src/factory.cc

Issue 1157453002: Add basic API support for Map & Set (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 06373d2d8a39f62c0f98db6fd4978270f486f350..9213a3200a85288c4a02268300125740102c4eb1 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1737,6 +1737,22 @@ Handle<JSDataView> Factory::NewJSDataView() {
}
+Handle<JSMap> Factory::NewJSMap() {
+ Handle<Map> map(isolate()->native_context()->js_map_map());
+ Handle<JSMap> js_map = Handle<JSMap>::cast(NewJSObjectFromMap(map));
+ Runtime::JSMapInitialize(isolate(), js_map);
+ return js_map;
+}
+
+
+Handle<JSSet> Factory::NewJSSet() {
+ Handle<Map> map(isolate()->native_context()->js_set_map());
+ Handle<JSSet> js_set = Handle<JSSet>::cast(NewJSObjectFromMap(map));
+ Runtime::JSSetInitialize(isolate(), js_set);
+ return js_set;
+}
+
+
Handle<JSMapIterator> Factory::NewJSMapIterator() {
Handle<Map> map(isolate()->native_context()->map_iterator_map());
CALL_HEAP_FUNCTION(isolate(),
« src/bootstrapper.cc ('K') | « src/factory.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698