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

Unified Diff: src/runtime.cc

Issue 329253004: Optimize Map/Set.prototype.forEach (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add the runtime-gen files Created 6 years, 6 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/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 4d895db43323dd06b6dd7fe77dd106d069e42e25..b1784710ce71d3f8a85614a3daf750f29ded4587 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1610,6 +1610,31 @@ RUNTIME_FUNCTION(Runtime_SetIteratorNext) {
}
+RUNTIME_FUNCTION(Runtime_SetIteratorCurrentKey) {
+ HandleScope scope(isolate);
adamk 2014/06/16 20:37:46 If you make CurrentKey/CurrentValue instance funct
arv (Not doing code reviews) 2014/06/16 21:57:21 Done.
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
+ return *JSSetIterator::CurrentKey(holder);
+}
+
+
+RUNTIME_FUNCTION(Runtime_SetIteratorHasMore) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
+ return isolate->heap()->ToBoolean(JSSetIterator::HasMore(holder));
+}
+
+
+RUNTIME_FUNCTION(Runtime_SetIteratorMoveNext) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
+ JSSetIterator::MoveNext(holder);
+ return isolate->heap()->undefined_value();
+}
+
+
RUNTIME_FUNCTION(Runtime_MapInitialize) {
HandleScope scope(isolate);
ASSERT(args.length() == 1);
@@ -1714,6 +1739,39 @@ RUNTIME_FUNCTION(Runtime_MapIteratorNext) {
}
+RUNTIME_FUNCTION(Runtime_MapIteratorCurrentKey) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
+ return *JSMapIterator::CurrentKey(holder);
+}
+
+
+RUNTIME_FUNCTION(Runtime_MapIteratorCurrentValue) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
+ return *JSMapIterator::CurrentValue(holder);
+}
+
+
+RUNTIME_FUNCTION(Runtime_MapIteratorHasMore) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
+ return isolate->heap()->ToBoolean(JSMapIterator::HasMore(holder));
+}
+
+
+RUNTIME_FUNCTION(Runtime_MapIteratorMoveNext) {
+ HandleScope scope(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
+ JSMapIterator::MoveNext(holder);
+ return isolate->heap()->undefined_value();
+}
+
+
static Handle<JSWeakCollection> WeakCollectionInitialize(
Isolate* isolate,
Handle<JSWeakCollection> weak_collection) {

Powered by Google App Engine
This is Rietveld 408576698