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

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: Update count to fix merge issue 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 b97af64f838b6c2386c4b90b914bf82f0b0a2fdf..2d264d83f8db350a4f066bca665cdd5c3c0b7619 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1611,6 +1611,31 @@ RUNTIME_FUNCTION(Runtime_SetIteratorNext) {
}
+RUNTIME_FUNCTION(Runtime_SetIteratorCurrentKey) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSSetIterator, holder, 0);
+ return holder->CurrentKey();
+}
+
+
+RUNTIME_FUNCTION(Runtime_SetIteratorHasMore) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSSetIterator, holder, 0);
+ return isolate->heap()->ToBoolean(holder->HasMore());
+}
+
+
+RUNTIME_FUNCTION(Runtime_SetIteratorMoveNext) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSSetIterator, holder, 0);
+ holder->MoveNext();
+ return isolate->heap()->undefined_value();
+}
+
+
RUNTIME_FUNCTION(Runtime_MapInitialize) {
HandleScope scope(isolate);
ASSERT(args.length() == 1);
@@ -1715,6 +1740,39 @@ RUNTIME_FUNCTION(Runtime_MapIteratorNext) {
}
+RUNTIME_FUNCTION(Runtime_MapIteratorCurrentKey) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSMapIterator, holder, 0);
+ return holder->CurrentKey();
+}
+
+
+RUNTIME_FUNCTION(Runtime_MapIteratorCurrentValue) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSMapIterator, holder, 0);
+ return holder->CurrentValue();
+}
+
+
+RUNTIME_FUNCTION(Runtime_MapIteratorHasMore) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSMapIterator, holder, 0);
+ return isolate->heap()->ToBoolean(holder->HasMore());
+}
+
+
+RUNTIME_FUNCTION(Runtime_MapIteratorMoveNext) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_CHECKED(JSMapIterator, holder, 0);
+ holder->MoveNext();
+ return isolate->heap()->undefined_value();
+}
+
+
static Handle<JSWeakCollection> WeakCollectionInitialize(
Isolate* isolate,
Handle<JSWeakCollection> weak_collection) {

Powered by Google App Engine
This is Rietveld 408576698