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

Unified Diff: src/json.js

Issue 1390023003: Use simple/fast macro version of MinMax in JS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: avoid debug directory Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« src/harmony-atomics.js ('K') | « src/harmony-typedarray.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json.js
diff --git a/src/json.js b/src/json.js
index 8ec30ff6ea941abaabd6512239eccb4992f27fad..41d73ffd291bd218d483f2b1f8c27dec9920d093 100644
--- a/src/json.js
+++ b/src/json.js
@@ -13,14 +13,10 @@
var GlobalJSON = global.JSON;
var InternalArray = utils.InternalArray;
-var MathMax;
-var MathMin;
var ObjectHasOwnProperty;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
- MathMax = from.MathMax;
- MathMin = from.MathMin;
ObjectHasOwnProperty = from.ObjectHasOwnProperty;
});
@@ -215,7 +211,7 @@ function JSONStringify(value, replacer, space) {
}
var gap;
if (IS_NUMBER(space)) {
- space = MathMax(0, MathMin(TO_INTEGER(space), 10));
+ space = MAX_SIMPLE(0, MIN_SIMPLE(TO_INTEGER(space), 10));
gap = %_SubString(" ", 0, space);
} else if (IS_STRING(space)) {
if (space.length > 10) {
« src/harmony-atomics.js ('K') | « src/harmony-typedarray.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698