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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 1603
1604 1604
1605 RUNTIME_FUNCTION(Runtime_SetIteratorNext) { 1605 RUNTIME_FUNCTION(Runtime_SetIteratorNext) {
1606 HandleScope scope(isolate); 1606 HandleScope scope(isolate);
1607 ASSERT(args.length() == 1); 1607 ASSERT(args.length() == 1);
1608 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0); 1608 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
1609 return *JSSetIterator::Next(holder); 1609 return *JSSetIterator::Next(holder);
1610 } 1610 }
1611 1611
1612 1612
1613 RUNTIME_FUNCTION(Runtime_SetIteratorCurrentKey) {
1614 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.
1615 ASSERT(args.length() == 1);
1616 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
1617 return *JSSetIterator::CurrentKey(holder);
1618 }
1619
1620
1621 RUNTIME_FUNCTION(Runtime_SetIteratorHasMore) {
1622 HandleScope scope(isolate);
1623 ASSERT(args.length() == 1);
1624 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
1625 return isolate->heap()->ToBoolean(JSSetIterator::HasMore(holder));
1626 }
1627
1628
1629 RUNTIME_FUNCTION(Runtime_SetIteratorMoveNext) {
1630 HandleScope scope(isolate);
1631 ASSERT(args.length() == 1);
1632 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
1633 JSSetIterator::MoveNext(holder);
1634 return isolate->heap()->undefined_value();
1635 }
1636
1637
1613 RUNTIME_FUNCTION(Runtime_MapInitialize) { 1638 RUNTIME_FUNCTION(Runtime_MapInitialize) {
1614 HandleScope scope(isolate); 1639 HandleScope scope(isolate);
1615 ASSERT(args.length() == 1); 1640 ASSERT(args.length() == 1);
1616 CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0); 1641 CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0);
1617 Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap(); 1642 Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap();
1618 holder->set_table(*table); 1643 holder->set_table(*table);
1619 return *holder; 1644 return *holder;
1620 } 1645 }
1621 1646
1622 1647
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 1732
1708 1733
1709 RUNTIME_FUNCTION(Runtime_MapIteratorNext) { 1734 RUNTIME_FUNCTION(Runtime_MapIteratorNext) {
1710 HandleScope scope(isolate); 1735 HandleScope scope(isolate);
1711 ASSERT(args.length() == 1); 1736 ASSERT(args.length() == 1);
1712 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0); 1737 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
1713 return *JSMapIterator::Next(holder); 1738 return *JSMapIterator::Next(holder);
1714 } 1739 }
1715 1740
1716 1741
1742 RUNTIME_FUNCTION(Runtime_MapIteratorCurrentKey) {
1743 HandleScope scope(isolate);
1744 ASSERT(args.length() == 1);
1745 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
1746 return *JSMapIterator::CurrentKey(holder);
1747 }
1748
1749
1750 RUNTIME_FUNCTION(Runtime_MapIteratorCurrentValue) {
1751 HandleScope scope(isolate);
1752 ASSERT(args.length() == 1);
1753 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
1754 return *JSMapIterator::CurrentValue(holder);
1755 }
1756
1757
1758 RUNTIME_FUNCTION(Runtime_MapIteratorHasMore) {
1759 HandleScope scope(isolate);
1760 ASSERT(args.length() == 1);
1761 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
1762 return isolate->heap()->ToBoolean(JSMapIterator::HasMore(holder));
1763 }
1764
1765
1766 RUNTIME_FUNCTION(Runtime_MapIteratorMoveNext) {
1767 HandleScope scope(isolate);
1768 ASSERT(args.length() == 1);
1769 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
1770 JSMapIterator::MoveNext(holder);
1771 return isolate->heap()->undefined_value();
1772 }
1773
1774
1717 static Handle<JSWeakCollection> WeakCollectionInitialize( 1775 static Handle<JSWeakCollection> WeakCollectionInitialize(
1718 Isolate* isolate, 1776 Isolate* isolate,
1719 Handle<JSWeakCollection> weak_collection) { 1777 Handle<JSWeakCollection> weak_collection) {
1720 ASSERT(weak_collection->map()->inobject_properties() == 0); 1778 ASSERT(weak_collection->map()->inobject_properties() == 0);
1721 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0); 1779 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0);
1722 weak_collection->set_table(*table); 1780 weak_collection->set_table(*table);
1723 return weak_collection; 1781 return weak_collection;
1724 } 1782 }
1725 1783
1726 1784
(...skipping 13417 matching lines...) Expand 10 before | Expand all | Expand 10 after
15144 } 15202 }
15145 return NULL; 15203 return NULL;
15146 } 15204 }
15147 15205
15148 15206
15149 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15207 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15150 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15208 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15151 } 15209 }
15152 15210
15153 } } // namespace v8::internal 15211 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698