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

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: use existing export in runtime 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/js/typedarray.js
diff --git a/src/js/typedarray.js b/src/js/typedarray.js
index e56b97d3a5bd4e0d642ba90b75bb28ab91c8b19e..a68ac6dbe5a7c07c051566c049655ae4b8e4cb21 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -20,6 +20,13 @@ var InternalArray = utils.InternalArray;
var iteratorSymbol = utils.ImportNow("iterator_symbol");
var ToPositiveInteger;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
+var MaxSimple;
+var MinSimple;
+
+utils.Import(function(from) {
+ MaxSimple = from.MaxSimple;
+ MinSimple = from.MinSimple;
+});
macro TYPED_ARRAYS(FUNCTION)
// arrayIds below should be synchronized with Runtime_TypedArrayInitialize.
@@ -213,15 +220,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) {

Powered by Google App Engine
This is Rietveld 408576698