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

Unified Diff: src/harmony-array.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/arraybuffer.js ('k') | src/harmony-atomics.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-array.js
diff --git a/src/harmony-array.js b/src/harmony-array.js
index 4cea1a4649e1baea9e0426e39e7aaba63d41862f..61bdbb689eed3e7a58c18c1a445da41e3d9eeb55 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -15,12 +15,16 @@
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;
});
@@ -31,28 +35,28 @@
target = TO_INTEGER(target);
var to;
if (target < 0) {
- to = MAX_SIMPLE(length + target, 0);
- } else {
- to = MIN_SIMPLE(target, length);
+ to = MathMax(length + target, 0);
+ } else {
+ to = MathMin(target, length);
}
start = TO_INTEGER(start);
var from;
if (start < 0) {
- from = MAX_SIMPLE(length + start, 0);
- } else {
- from = MIN_SIMPLE(start, length);
+ from = MathMax(length + start, 0);
+ } else {
+ from = MathMin(start, length);
}
end = IS_UNDEFINED(end) ? length : TO_INTEGER(end);
var final;
if (end < 0) {
- final = MAX_SIMPLE(length + end, 0);
- } else {
- final = MIN_SIMPLE(end, length);
- }
-
- var count = MIN_SIMPLE(final - from, length - to);
+ final = MathMax(length + end, 0);
+ } else {
+ final = MathMin(end, length);
+ }
+
+ var count = MathMin(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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698