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/js/harmony-array.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/arraybuffer.js ('k') | src/js/harmony-atomics.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/harmony-array.js
diff --git a/src/js/harmony-array.js b/src/js/harmony-array.js
index 6705691486e07a64a6a5ff85b641f6c85342c2e5..cc53514d5e5421bdcf0b96b0d1a9949581be7f9a 100644
--- a/src/js/harmony-array.js
+++ b/src/js/harmony-array.js
@@ -16,8 +16,8 @@ var GetIterator;
var GetMethod;
var GlobalArray = global.Array;
var iteratorSymbol = utils.ImportNow("iterator_symbol");
-var MathMax;
-var MathMin;
+var MaxSimple;
+var MinSimple;
var ObjectIsFrozen;
var ObjectDefineProperty;
@@ -25,8 +25,8 @@ utils.Import(function(from) {
FLAG_harmony_tolength = from.FLAG_harmony_tolength;
GetIterator = from.GetIterator;
GetMethod = from.GetMethod;
- MathMax = from.MathMax;
- MathMin = from.MathMin;
+ MaxSimple = from.MaxSimple;
+ MinSimple = from.MinSimple;
ObjectIsFrozen = from.ObjectIsFrozen;
ObjectDefineProperty = from.ObjectDefineProperty;
});
@@ -37,28 +37,28 @@ function InnerArrayCopyWithin(target, start, end, array, length) {
target = TO_INTEGER(target);
var to;
if (target < 0) {
- to = MathMax(length + target, 0);
+ to = MaxSimple(length + target, 0);
} else {
- to = MathMin(target, length);
+ to = MinSimple(target, length);
}
start = TO_INTEGER(start);
var from;
if (start < 0) {
- from = MathMax(length + start, 0);
+ from = MaxSimple(length + start, 0);
} else {
- from = MathMin(start, length);
+ from = MinSimple(start, length);
}
end = IS_UNDEFINED(end) ? length : TO_INTEGER(end);
var final;
if (end < 0) {
- final = MathMax(length + end, 0);
+ final = MaxSimple(length + end, 0);
} else {
- final = MathMin(end, length);
+ final = MinSimple(end, length);
}
- var count = MathMin(final - from, length - to);
+ var count = MinSimple(final - from, length - to);
var direction = 1;
if (from < to && to < (from + count)) {
direction = -1;
« no previous file with comments | « src/js/arraybuffer.js ('k') | src/js/harmony-atomics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698