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

Unified Diff: src/js/string.js

Issue 1641083003: [builtins] Make Math.max and Math.min fast by default. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: SKIP unrelated ignition failures. Created 4 years, 11 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
Index: src/js/string.js
diff --git a/src/js/string.js b/src/js/string.js
index e906a563652782ace88005b3aa11fbbbef1d9503..b1e175585c3f9952c3174b4fe1672db5c653533f 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -17,8 +17,8 @@ var InternalArray = utils.InternalArray;
var InternalPackedArray = utils.InternalPackedArray;
var MakeRangeError;
var MakeTypeError;
-var MathMax;
-var MathMin;
+var MaxSimple;
+var MinSimple;
var matchSymbol = utils.ImportNow("match_symbol");
var RegExpExecNoTests;
var replaceSymbol = utils.ImportNow("replace_symbol");
@@ -30,8 +30,8 @@ utils.Import(function(from) {
ArrayJoin = from.ArrayJoin;
MakeRangeError = from.MakeRangeError;
MakeTypeError = from.MakeTypeError;
- MathMax = from.MathMax;
- MathMin = from.MathMin;
+ MaxSimple = from.MaxSimple;
+ MinSimple = from.MinSimple;
RegExpExecNoTests = from.RegExpExecNoTests;
});
@@ -735,7 +735,7 @@ function StringStartsWith(searchString /* position */) { // length == 1
}
var s_len = s.length;
- var start = MathMin(MathMax(pos, 0), s_len);
+ var start = MinSimple(MaxSimple(pos, 0), s_len);
var ss_len = ss.length;
if (ss_len + start > s_len) {
return false;
@@ -765,7 +765,7 @@ function StringEndsWith(searchString /* position */) { // length == 1
}
}
- var end = MathMin(MathMax(pos, 0), s_len);
+ var end = MinSimple(MaxSimple(pos, 0), s_len);
var ss_len = ss.length;
var start = end - ss_len;
if (start < 0) {
« src/arm64/builtins-arm64.cc ('K') | « src/js/prologue.js ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698