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

Unified Diff: src/js/typedarray.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/runtime.js ('k') | test/mjsunit/minmax-simple.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/typedarray.js
diff --git a/src/js/typedarray.js b/src/js/typedarray.js
index e56b97d3a5bd4e0d642ba90b75bb28ab91c8b19e..deab424096dbe627c5c8be3acdf65bd08a6aa920 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -18,6 +18,8 @@ var GlobalDataView = global.DataView;
var GlobalObject = global.Object;
var InternalArray = utils.InternalArray;
var iteratorSymbol = utils.ImportNow("iterator_symbol");
+var MaxSimple;
+var MinSimple;
var ToPositiveInteger;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
@@ -42,6 +44,8 @@ TYPED_ARRAYS(DECLARE_GLOBALS)
utils.Import(function(from) {
ArrayValues = from.ArrayValues;
+ MaxSimple = from.MaxSimple;
+ MinSimple = from.MinSimple;
ToPositiveInteger = from.ToPositiveInteger;
});
@@ -213,15 +217,15 @@ function NAMESubArray(begin, end) {
}
if (beginInt < 0) {
- beginInt = MAX_SIMPLE(0, srcLength + beginInt);
+ beginInt = MaxSimple(0, srcLength + beginInt);
} else {
- beginInt = MIN_SIMPLE(beginInt, srcLength);
+ beginInt = MinSimple(beginInt, srcLength);
}
if (endInt < 0) {
- endInt = MAX_SIMPLE(0, srcLength + endInt);
+ endInt = MaxSimple(0, srcLength + endInt);
} else {
- endInt = MIN_SIMPLE(endInt, srcLength);
+ endInt = MinSimple(endInt, srcLength);
}
if (endInt < beginInt) {
« no previous file with comments | « src/js/runtime.js ('k') | test/mjsunit/minmax-simple.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698