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

Unified Diff: src/harmony-array.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
Index: src/harmony-array.js
diff --git a/src/harmony-array.js b/src/harmony-array.js
index 61bdbb689eed3e7a58c18c1a445da41e3d9eeb55..4cea1a4649e1baea9e0426e39e7aaba63d41862f 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -15,16 +15,12 @@ var GetIterator;
var GetMethod;
var GlobalArray = global.Array;
var iteratorSymbol = utils.ImportNow("iterator_symbol");
-var MathMax;
-var MathMin;
var ObjectIsFrozen;
var ObjectDefineProperty;
utils.Import(function(from) {
GetIterator = from.GetIterator;
GetMethod = from.GetMethod;
- MathMax = from.MathMax;
- MathMin = from.MathMin;
ObjectIsFrozen = from.ObjectIsFrozen;
ObjectDefineProperty = from.ObjectDefineProperty;
});
@@ -35,28 +31,28 @@ function InnerArrayCopyWithin(target, start, end, array, length) {
target = TO_INTEGER(target);
var to;
if (target < 0) {
- to = MathMax(length + target, 0);
+ to = MAX_SIMPLE(length + target, 0);
} else {
- to = MathMin(target, length);
+ to = MIN_SIMPLE(target, length);
}
start = TO_INTEGER(start);
var from;
if (start < 0) {
- from = MathMax(length + start, 0);
+ from = MAX_SIMPLE(length + start, 0);
} else {
- from = MathMin(start, length);
+ from = MIN_SIMPLE(start, length);
}
end = IS_UNDEFINED(end) ? length : TO_INTEGER(end);
var final;
if (end < 0) {
- final = MathMax(length + end, 0);
+ final = MAX_SIMPLE(length + end, 0);
} else {
- final = MathMin(end, length);
+ final = MIN_SIMPLE(end, length);
}
- var count = MathMin(final - from, length - to);
+ var count = MIN_SIMPLE(final - from, length - to);
var direction = 1;
if (from < to && to < (from + count)) {
direction = -1;
« no previous file with comments | « src/arraybuffer.js ('k') | src/harmony-atomics.js » ('j') | src/harmony-atomics.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698