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

Side by Side Diff: src/collection-iterator.js

Issue 384003003: Replace AddProperty by AddNamedProperty to speed up the common case (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
« no previous file with comments | « src/collection.js ('k') | src/date.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 'use strict'; 5 'use strict';
6 6
7 7
8 // This file relies on the fact that the following declaration has been made 8 // This file relies on the fact that the following declaration has been made
9 // in runtime.js: 9 // in runtime.js:
10 // var $Set = global.Set; 10 // var $Set = global.Set;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 %CheckIsBootstrapping(); 68 %CheckIsBootstrapping();
69 69
70 %SetCode(SetIterator, SetIteratorConstructor); 70 %SetCode(SetIterator, SetIteratorConstructor);
71 %FunctionSetPrototype(SetIterator, new $Object()); 71 %FunctionSetPrototype(SetIterator, new $Object());
72 %FunctionSetInstanceClassName(SetIterator, 'Set Iterator'); 72 %FunctionSetInstanceClassName(SetIterator, 'Set Iterator');
73 InstallFunctions(SetIterator.prototype, DONT_ENUM, $Array( 73 InstallFunctions(SetIterator.prototype, DONT_ENUM, $Array(
74 'next', SetIteratorNextJS 74 'next', SetIteratorNextJS
75 )); 75 ));
76 76
77 %FunctionSetName(SetIteratorSymbolIterator, '[Symbol.iterator]'); 77 %FunctionSetName(SetIteratorSymbolIterator, '[Symbol.iterator]');
78 %AddProperty(SetIterator.prototype, symbolIterator, 78 %AddNamedProperty(SetIterator.prototype, symbolIterator,
79 SetIteratorSymbolIterator, DONT_ENUM); 79 SetIteratorSymbolIterator, DONT_ENUM);
80 } 80 }
81 81
82 SetUpSetIterator(); 82 SetUpSetIterator();
83 83
84 84
85 function ExtendSetPrototype() { 85 function ExtendSetPrototype() {
86 %CheckIsBootstrapping(); 86 %CheckIsBootstrapping();
87 87
88 InstallFunctions($Set.prototype, DONT_ENUM, $Array( 88 InstallFunctions($Set.prototype, DONT_ENUM, $Array(
89 'entries', SetEntries, 89 'entries', SetEntries,
90 'keys', SetValues, 90 'keys', SetValues,
91 'values', SetValues 91 'values', SetValues
92 )); 92 ));
93 93
94 %AddProperty($Set.prototype, symbolIterator, SetValues, DONT_ENUM); 94 %AddNamedProperty($Set.prototype, symbolIterator, SetValues, DONT_ENUM);
95 } 95 }
96 96
97 ExtendSetPrototype(); 97 ExtendSetPrototype();
98 98
99 99
100 100
101 function MapIteratorConstructor(map, kind) { 101 function MapIteratorConstructor(map, kind) {
102 %MapIteratorInitialize(this, map, kind); 102 %MapIteratorInitialize(this, map, kind);
103 } 103 }
104 104
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 %CheckIsBootstrapping(); 165 %CheckIsBootstrapping();
166 166
167 %SetCode(MapIterator, MapIteratorConstructor); 167 %SetCode(MapIterator, MapIteratorConstructor);
168 %FunctionSetPrototype(MapIterator, new $Object()); 168 %FunctionSetPrototype(MapIterator, new $Object());
169 %FunctionSetInstanceClassName(MapIterator, 'Map Iterator'); 169 %FunctionSetInstanceClassName(MapIterator, 'Map Iterator');
170 InstallFunctions(MapIterator.prototype, DONT_ENUM, $Array( 170 InstallFunctions(MapIterator.prototype, DONT_ENUM, $Array(
171 'next', MapIteratorNextJS 171 'next', MapIteratorNextJS
172 )); 172 ));
173 173
174 %FunctionSetName(MapIteratorSymbolIterator, '[Symbol.iterator]'); 174 %FunctionSetName(MapIteratorSymbolIterator, '[Symbol.iterator]');
175 %AddProperty(MapIterator.prototype, symbolIterator, 175 %AddNamedProperty(MapIterator.prototype, symbolIterator,
176 MapIteratorSymbolIterator, DONT_ENUM); 176 MapIteratorSymbolIterator, DONT_ENUM);
177 } 177 }
178 178
179 SetUpMapIterator(); 179 SetUpMapIterator();
180 180
181 181
182 function ExtendMapPrototype() { 182 function ExtendMapPrototype() {
183 %CheckIsBootstrapping(); 183 %CheckIsBootstrapping();
184 184
185 InstallFunctions($Map.prototype, DONT_ENUM, $Array( 185 InstallFunctions($Map.prototype, DONT_ENUM, $Array(
186 'entries', MapEntries, 186 'entries', MapEntries,
187 'keys', MapKeys, 187 'keys', MapKeys,
188 'values', MapValues 188 'values', MapValues
189 )); 189 ));
190 190
191 %AddProperty($Map.prototype, symbolIterator, MapEntries, DONT_ENUM); 191 %AddNamedProperty($Map.prototype, symbolIterator, MapEntries, DONT_ENUM);
192 } 192 }
193 193
194 ExtendMapPrototype(); 194 ExtendMapPrototype();
OLDNEW
« no previous file with comments | « src/collection.js ('k') | src/date.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698