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([ |