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

Unified Diff: src/harmony-typedarray.js

Issue 1394303003: Revert of Use simple/fast macro version of MinMax in JS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/harmony-atomics.js ('k') | src/json.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-typedarray.js
diff --git a/src/harmony-typedarray.js b/src/harmony-typedarray.js
index b9b3173e7fe2b558bccd1e1458bed096419c9ca9..45e66fddcff389813ea4e470848df7f2b6a7b777 100644
--- a/src/harmony-typedarray.js
+++ b/src/harmony-typedarray.js
@@ -48,6 +48,8 @@
var InnerArraySort;
var InnerArrayToLocaleString;
var IsNaN;
+var MathMax;
+var MathMin;
var PackedArrayReverse;
utils.Import(function(from) {
@@ -70,6 +72,8 @@
InnerArraySort = from.InnerArraySort;
InnerArrayToLocaleString = from.InnerArrayToLocaleString;
IsNaN = from.IsNaN;
+ MathMax = from.MathMax;
+ MathMin = from.MathMin;
PackedArrayReverse = from.PackedArrayReverse;
});
@@ -315,9 +319,9 @@
var k;
if (relativeStart < 0) {
- k = MAX_SIMPLE(len + relativeStart, 0);
+ k = MathMax(len + relativeStart, 0);
} else {
- k = MIN_SIMPLE(relativeStart, len);
+ k = MathMin(relativeStart, len);
}
var relativeEnd;
@@ -329,12 +333,12 @@
var final;
if (relativeEnd < 0) {
- final = MAX_SIMPLE(len + relativeEnd, 0);
+ final = MathMax(len + relativeEnd, 0);
} else {
- final = MIN_SIMPLE(relativeEnd, len);
- }
-
- var count = MAX_SIMPLE(final - k, 0);
+ final = MathMin(relativeEnd, len);
+ }
+
+ var count = MathMax(final - k, 0);
var array = ConstructTypedArrayLike(this, count);
// The code below is the 'then' branch; the 'else' branch species
// a memcpy. Because V8 doesn't canonicalize NaN, the difference is
« no previous file with comments | « src/harmony-atomics.js ('k') | src/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698