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

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: Unhandlify 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..aaf8b1838cf9d93f26bb96ab32e1c895efe8b333 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -1610,6 +1610,31 @@ RUNTIME_FUNCTION(Runtime_SetIteratorNext) {
}
+RUNTIME_FUNCTION(Runtime_SetIteratorCurrentKey) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
adamk 2014/06/16 22:13:57 This should just be CONVERT_ARG_CHECKED() (no "HAN
+ return holder->CurrentKey();
+}
+
+
+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) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
+ holder->MoveNext();
+ 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) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
adamk 2014/06/16 22:13:57 ditto, and lots more below. Basically, SealHandle
+ return holder->CurrentKey();
+}
+
+
+RUNTIME_FUNCTION(Runtime_MapIteratorCurrentValue) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
+ return holder->CurrentValue();
+}
+
+
+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) {
+ SealHandleScope shs(isolate);
+ ASSERT(args.length() == 1);
+ CONVERT_ARG_HANDLE_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