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

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: 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 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 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after
1604 1604
1605 1605
1606 RUNTIME_FUNCTION(Runtime_SetIteratorNext) { 1606 RUNTIME_FUNCTION(Runtime_SetIteratorNext) {
1607 HandleScope scope(isolate); 1607 HandleScope scope(isolate);
1608 ASSERT(args.length() == 1); 1608 ASSERT(args.length() == 1);
1609 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0); 1609 CONVERT_ARG_HANDLE_CHECKED(JSSetIterator, holder, 0);
1610 return *JSSetIterator::Next(holder); 1610 return *JSSetIterator::Next(holder);
1611 } 1611 }
1612 1612
1613 1613
1614 RUNTIME_FUNCTION(Runtime_SetIteratorCurrentKey) {
1615 SealHandleScope shs(isolate);
1616 ASSERT(args.length() == 1);
1617 CONVERT_ARG_CHECKED(JSSetIterator, holder, 0);
1618 return holder->CurrentKey();
1619 }
1620
1621
1622 RUNTIME_FUNCTION(Runtime_SetIteratorHasMore) {
1623 SealHandleScope shs(isolate);
1624 ASSERT(args.length() == 1);
1625 CONVERT_ARG_CHECKED(JSSetIterator, holder, 0);
1626 return isolate->heap()->ToBoolean(holder->HasMore());
1627 }
1628
1629
1630 RUNTIME_FUNCTION(Runtime_SetIteratorMoveNext) {
1631 SealHandleScope shs(isolate);
1632 ASSERT(args.length() == 1);
1633 CONVERT_ARG_CHECKED(JSSetIterator, holder, 0);
1634 holder->MoveNext();
1635 return isolate->heap()->undefined_value();
1636 }
1637
1638
1614 RUNTIME_FUNCTION(Runtime_MapInitialize) { 1639 RUNTIME_FUNCTION(Runtime_MapInitialize) {
1615 HandleScope scope(isolate); 1640 HandleScope scope(isolate);
1616 ASSERT(args.length() == 1); 1641 ASSERT(args.length() == 1);
1617 CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0); 1642 CONVERT_ARG_HANDLE_CHECKED(JSMap, holder, 0);
1618 Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap(); 1643 Handle<OrderedHashMap> table = isolate->factory()->NewOrderedHashMap();
1619 holder->set_table(*table); 1644 holder->set_table(*table);
1620 return *holder; 1645 return *holder;
1621 } 1646 }
1622 1647
1623 1648
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 1733
1709 1734
1710 RUNTIME_FUNCTION(Runtime_MapIteratorNext) { 1735 RUNTIME_FUNCTION(Runtime_MapIteratorNext) {
1711 HandleScope scope(isolate); 1736 HandleScope scope(isolate);
1712 ASSERT(args.length() == 1); 1737 ASSERT(args.length() == 1);
1713 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0); 1738 CONVERT_ARG_HANDLE_CHECKED(JSMapIterator, holder, 0);
1714 return *JSMapIterator::Next(holder); 1739 return *JSMapIterator::Next(holder);
1715 } 1740 }
1716 1741
1717 1742
1743 RUNTIME_FUNCTION(Runtime_MapIteratorCurrentKey) {
1744 SealHandleScope shs(isolate);
1745 ASSERT(args.length() == 1);
1746 CONVERT_ARG_CHECKED(JSMapIterator, holder, 0);
1747 return holder->CurrentKey();
1748 }
1749
1750
1751 RUNTIME_FUNCTION(Runtime_MapIteratorCurrentValue) {
1752 SealHandleScope shs(isolate);
1753 ASSERT(args.length() == 1);
1754 CONVERT_ARG_CHECKED(JSMapIterator, holder, 0);
1755 return holder->CurrentValue();
1756 }
1757
1758
1759 RUNTIME_FUNCTION(Runtime_MapIteratorHasMore) {
1760 SealHandleScope shs(isolate);
1761 ASSERT(args.length() == 1);
1762 CONVERT_ARG_CHECKED(JSMapIterator, holder, 0);
1763 return isolate->heap()->ToBoolean(holder->HasMore());
1764 }
1765
1766
1767 RUNTIME_FUNCTION(Runtime_MapIteratorMoveNext) {
1768 SealHandleScope shs(isolate);
1769 ASSERT(args.length() == 1);
1770 CONVERT_ARG_CHECKED(JSMapIterator, holder, 0);
1771 holder->MoveNext();
1772 return isolate->heap()->undefined_value();
1773 }
1774
1775
1718 static Handle<JSWeakCollection> WeakCollectionInitialize( 1776 static Handle<JSWeakCollection> WeakCollectionInitialize(
1719 Isolate* isolate, 1777 Isolate* isolate,
1720 Handle<JSWeakCollection> weak_collection) { 1778 Handle<JSWeakCollection> weak_collection) {
1721 ASSERT(weak_collection->map()->inobject_properties() == 0); 1779 ASSERT(weak_collection->map()->inobject_properties() == 0);
1722 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0); 1780 Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 0);
1723 weak_collection->set_table(*table); 1781 weak_collection->set_table(*table);
1724 return weak_collection; 1782 return weak_collection;
1725 } 1783 }
1726 1784
1727 1785
(...skipping 13485 matching lines...) Expand 10 before | Expand all | Expand 10 after
15213 } 15271 }
15214 return NULL; 15272 return NULL;
15215 } 15273 }
15216 15274
15217 15275
15218 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15276 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15219 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15277 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15220 } 15278 }
15221 15279
15222 } } // namespace v8::internal 15280 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698