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

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

Powered by Google App Engine
This is Rietveld 408576698