Chromium Code Reviews

Unified Diff: src/js/harmony-atomics.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.
Jump to:
View side-by-side diff with in-line comments
Index: src/js/harmony-atomics.js
diff --git a/src/js/harmony-atomics.js b/src/js/harmony-atomics.js
index 7412494e30368e9e984174f72b642aa97ed3f7d7..4d66017c26a6e8542635b3aeb7f49c7cbc610279 100644
--- a/src/js/harmony-atomics.js
+++ b/src/js/harmony-atomics.js
@@ -12,11 +12,11 @@
// Imports
var GlobalObject = global.Object;
-var MathMax;
var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
+var MaxSimple;
Jakob Kummerow 2015/10/15 14:18:48 nit: please preserve alpha-sorting
skomski 2015/10/15 15:17:58 Done.
utils.Import(function(from) {
- MathMax = from.MathMax;
+ MaxSimple = from.MaxSimple;
});
// -------------------------------------------------------------------
@@ -146,7 +146,7 @@ function AtomicsFutexWaitJS(ia, index, value, timeout) {
if (NUMBER_IS_NAN(timeout)) {
timeout = INFINITY;
} else {
- timeout = MathMax(0, timeout);
+ timeout = MaxSimple(0, timeout);
}
}
return %AtomicsFutexWait(ia, index, value, timeout);
@@ -158,14 +158,14 @@ function AtomicsFutexWakeJS(ia, index, count) {
if (index < 0 || index >= %_TypedArrayGetLength(ia)) {
return UNDEFINED;
}
- count = MathMax(0, TO_INTEGER(count));
+ count = MaxSimple(0, TO_INTEGER(count));
return %AtomicsFutexWake(ia, index, count);
}
function AtomicsFutexWakeOrRequeueJS(ia, index1, count, value, index2) {
CheckSharedInteger32TypedArray(ia);
index1 = TO_INTEGER(index1);
- count = MathMax(0, TO_INTEGER(count));
+ count = MaxSimple(0, TO_INTEGER(count));
value = TO_INT32(value);
index2 = TO_INTEGER(index2);
if (index1 < 0 || index1 >= %_TypedArrayGetLength(ia) ||

Powered by Google App Engine