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

Unified Diff: src/js/arraybuffer.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/array.js ('k') | src/js/harmony-array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/arraybuffer.js
diff --git a/src/js/arraybuffer.js b/src/js/arraybuffer.js
index fb803caa5aace679c621158f2ce0f44bd55216d4..ebd6925a1f7dc7f16744c098e8cbe61d59d249a1 100644
--- a/src/js/arraybuffer.js
+++ b/src/js/arraybuffer.js
@@ -13,14 +13,14 @@
var GlobalArrayBuffer = global.ArrayBuffer;
var GlobalObject = global.Object;
-var MathMax;
-var MathMin;
+var MaxSimple;
+var MinSimple;
var ToPositiveInteger;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
- MathMax = from.MathMax;
- MathMin = from.MathMin;
+ MaxSimple = from.MaxSimple;
+ MinSimple = from.MinSimple;
ToPositiveInteger = from.ToPositiveInteger;
});
@@ -57,16 +57,16 @@ function ArrayBufferSlice(start, end) {
var first;
var byte_length = %_ArrayBufferGetByteLength(this);
if (relativeStart < 0) {
- first = MathMax(byte_length + relativeStart, 0);
+ first = MaxSimple(byte_length + relativeStart, 0);
} else {
- first = MathMin(relativeStart, byte_length);
+ first = MinSimple(relativeStart, byte_length);
}
var relativeEnd = IS_UNDEFINED(end) ? byte_length : end;
var fin;
if (relativeEnd < 0) {
- fin = MathMax(byte_length + relativeEnd, 0);
+ fin = MaxSimple(byte_length + relativeEnd, 0);
} else {
- fin = MathMin(relativeEnd, byte_length);
+ fin = MinSimple(relativeEnd, byte_length);
}
if (fin < first) {
« no previous file with comments | « src/js/array.js ('k') | src/js/harmony-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698