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

Side by Side Diff: src/js/json.js

Issue 1678953004: [builtins] Remove bunch of uses of %_Arguments and %_ArgumentsLength. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Fix deoptimizer adapted arguments materialization for builtins. Created 4 years, 10 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
« no previous file with comments | « src/js/array.js ('k') | src/js/spread.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } else { 180 } else {
181 return SerializeObject(value, replacer, stack, indent, gap); 181 return SerializeObject(value, replacer, stack, indent, gap);
182 } 182 }
183 } 183 }
184 // Undefined or a callable object. 184 // Undefined or a callable object.
185 return UNDEFINED; 185 return UNDEFINED;
186 } 186 }
187 187
188 188
189 function JSONStringify(value, replacer, space) { 189 function JSONStringify(value, replacer, space) {
190 if (%_ArgumentsLength() == 1 && !IS_PROXY(value)) { 190 if (arguments.length === 1 && !IS_PROXY(value)) {
191 return %BasicJSONStringify(value); 191 return %BasicJSONStringify(value);
192 } 192 }
193 if (!IS_CALLABLE(replacer) && %is_arraylike(replacer)) { 193 if (!IS_CALLABLE(replacer) && %is_arraylike(replacer)) {
194 var property_list = new InternalArray(); 194 var property_list = new InternalArray();
195 var seen_properties = new GlobalSet(); 195 var seen_properties = new GlobalSet();
196 var length = TO_LENGTH(replacer.length); 196 var length = TO_LENGTH(replacer.length);
197 for (var i = 0; i < length; i++) { 197 for (var i = 0; i < length; i++) {
198 var v = replacer[i]; 198 var v = replacer[i];
199 var item; 199 var item;
200 if (IS_STRING(v)) { 200 if (IS_STRING(v)) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 function JsonSerializeAdapter(key, object) { 271 function JsonSerializeAdapter(key, object) {
272 var holder = {}; 272 var holder = {};
273 holder[key] = object; 273 holder[key] = object;
274 // No need to pass the actual holder since there is no replacer function. 274 // No need to pass the actual holder since there is no replacer function.
275 return JSONSerialize(key, holder, UNDEFINED, new InternalArray(), "", ""); 275 return JSONSerialize(key, holder, UNDEFINED, new InternalArray(), "", "");
276 } 276 }
277 277
278 %InstallToContext(["json_serialize_adapter", JsonSerializeAdapter]); 278 %InstallToContext(["json_serialize_adapter", JsonSerializeAdapter]);
279 279
280 }) 280 })
OLDNEW
« no previous file with comments | « src/js/array.js ('k') | src/js/spread.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698