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

Unified Diff: src/js/runtime.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/runtime.js
diff --git a/src/js/runtime.js b/src/js/runtime.js
index 6de87d5076787e515afe88de7d79d8f03885244f..b5eb0f407dc95d4a5834d39f5eb8d6f06d4ee252 100644
--- a/src/js/runtime.js
+++ b/src/js/runtime.js
@@ -220,6 +220,20 @@ function ToPositiveInteger(x, rangeErrorIndex) {
return i;
}
+
+function MaxSimple(a, b) {
+ return a > b ? a : b;
+}
+
+
+function MinSimple(a, b) {
+ return a > b ? b : a;
+}
+
+
+%SetForceInlineFlag(MaxSimple);
Jakob Kummerow 2015/10/15 14:18:48 Have you measured that this actually makes a diffe
skomski 2015/10/15 15:17:58 Measured and definitely makes a big difference >9%
+%SetForceInlineFlag(MinSimple);
+
//----------------------------------------------------------------------------
// NOTE: Setting the prototype for Array must take place as early as
@@ -237,6 +251,8 @@ $sameValueZero = SameValueZero;
utils.Export(function(to) {
to.ToPositiveInteger = ToPositiveInteger;
+ to.MaxSimple = MaxSimple;
+ to.MinSimple = MinSimple;
});
%InstallToContext([

Powered by Google App Engine
This is Rietveld 408576698