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

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: 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/prologue.js ('k') | src/js/typedarray.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/runtime.js
diff --git a/src/js/runtime.js b/src/js/runtime.js
index d584100bebb01beb2d16a29abba4b2ef4a108acf..6fe6ad80cd9d714177ffaacb6f98159221bc0f8c 100644
--- a/src/js/runtime.js
+++ b/src/js/runtime.js
@@ -216,6 +216,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);
+%SetForceInlineFlag(MinSimple);
+
//----------------------------------------------------------------------------
// NOTE: Setting the prototype for Array must take place as early as
@@ -229,9 +243,11 @@ function ToPositiveInteger(x, rangeErrorIndex) {
// Exports
utils.Export(function(to) {
- to.ToPositiveInteger = ToPositiveInteger;
+ to.MaxSimple = MaxSimple;
+ to.MinSimple = MinSimple;
to.SameValue = SameValue;
to.SameValueZero = SameValueZero;
+ to.ToPositiveInteger = ToPositiveInteger;
});
%InstallToContext([
« no previous file with comments | « src/js/prologue.js ('k') | src/js/typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698