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

Side by Side Diff: src/weak_collection.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/v8natives.js ('k') | test/cctest/test-api.cc » ('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 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 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declaration has been made 7 // This file relies on the fact that the following declaration has been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Array = global.Array; 9 // var $Array = global.Array;
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 84
85 // ------------------------------------------------------------------- 85 // -------------------------------------------------------------------
86 86
87 function SetUpWeakMap() { 87 function SetUpWeakMap() {
88 %CheckIsBootstrapping(); 88 %CheckIsBootstrapping();
89 89
90 %SetCode($WeakMap, WeakMapConstructor); 90 %SetCode($WeakMap, WeakMapConstructor);
91 %FunctionSetPrototype($WeakMap, new $Object()); 91 %FunctionSetPrototype($WeakMap, new $Object());
92 %AddProperty($WeakMap.prototype, "constructor", $WeakMap, DONT_ENUM); 92 %AddNamedProperty($WeakMap.prototype, "constructor", $WeakMap, DONT_ENUM);
93 93
94 // Set up the non-enumerable functions on the WeakMap prototype object. 94 // Set up the non-enumerable functions on the WeakMap prototype object.
95 InstallFunctions($WeakMap.prototype, DONT_ENUM, $Array( 95 InstallFunctions($WeakMap.prototype, DONT_ENUM, $Array(
96 "get", WeakMapGet, 96 "get", WeakMapGet,
97 "set", WeakMapSet, 97 "set", WeakMapSet,
98 "has", WeakMapHas, 98 "has", WeakMapHas,
99 "delete", WeakMapDelete, 99 "delete", WeakMapDelete,
100 "clear", WeakMapClear 100 "clear", WeakMapClear
101 )); 101 ));
102 } 102 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 162 }
163 163
164 164
165 // ------------------------------------------------------------------- 165 // -------------------------------------------------------------------
166 166
167 function SetUpWeakSet() { 167 function SetUpWeakSet() {
168 %CheckIsBootstrapping(); 168 %CheckIsBootstrapping();
169 169
170 %SetCode($WeakSet, WeakSetConstructor); 170 %SetCode($WeakSet, WeakSetConstructor);
171 %FunctionSetPrototype($WeakSet, new $Object()); 171 %FunctionSetPrototype($WeakSet, new $Object());
172 %AddProperty($WeakSet.prototype, "constructor", $WeakSet, DONT_ENUM); 172 %AddNamedProperty($WeakSet.prototype, "constructor", $WeakSet, DONT_ENUM);
173 173
174 // Set up the non-enumerable functions on the WeakSet prototype object. 174 // Set up the non-enumerable functions on the WeakSet prototype object.
175 InstallFunctions($WeakSet.prototype, DONT_ENUM, $Array( 175 InstallFunctions($WeakSet.prototype, DONT_ENUM, $Array(
176 "add", WeakSetAdd, 176 "add", WeakSetAdd,
177 "has", WeakSetHas, 177 "has", WeakSetHas,
178 "delete", WeakSetDelete, 178 "delete", WeakSetDelete,
179 "clear", WeakSetClear 179 "clear", WeakSetClear
180 )); 180 ));
181 } 181 }
182 182
183 SetUpWeakSet(); 183 SetUpWeakSet();
OLDNEW
« no previous file with comments | « src/v8natives.js ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698