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

Unified Diff: src/js/json.js

Issue 1410473002: Reland: Use simple/fast inline function version of MinMax in JS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: after yangs fix possible to use utils.ImportNow in test 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
« no previous file with comments | « src/js/harmony-typedarray.js ('k') | src/js/macros.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/json.js
diff --git a/src/js/json.js b/src/js/json.js
index 8ec30ff6ea941abaabd6512239eccb4992f27fad..aea1da075336989511f14bcd5cf8c6dc84398c33 100644
--- a/src/js/json.js
+++ b/src/js/json.js
@@ -13,14 +13,14 @@
var GlobalJSON = global.JSON;
var InternalArray = utils.InternalArray;
-var MathMax;
-var MathMin;
+var MaxSimple;
+var MinSimple;
var ObjectHasOwnProperty;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
- MathMax = from.MathMax;
- MathMin = from.MathMin;
+ MaxSimple = from.MaxSimple;
+ MinSimple = from.MinSimple;
ObjectHasOwnProperty = from.ObjectHasOwnProperty;
});
@@ -215,7 +215,7 @@ function JSONStringify(value, replacer, space) {
}
var gap;
if (IS_NUMBER(space)) {
- space = MathMax(0, MathMin(TO_INTEGER(space), 10));
+ space = MaxSimple(0, MinSimple(TO_INTEGER(space), 10));
gap = %_SubString(" ", 0, space);
} else if (IS_STRING(space)) {
if (space.length > 10) {
« no previous file with comments | « src/js/harmony-typedarray.js ('k') | src/js/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698