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

Unified Diff: src/builtins.h

Issue 1641083003: [builtins] Make Math.max and Math.min fast by default. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: SKIP unrelated ignition failures. Created 4 years, 11 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/builtins.h
diff --git a/src/builtins.h b/src/builtins.h
index dfe39d6b522aee2cb11c5eb123151fcddd7d8efd..e56369223c0ab1c0e14019a994032bfbae87b1ed 100644
--- a/src/builtins.h
+++ b/src/builtins.h
@@ -264,6 +264,9 @@ inline bool operator&(BuiltinExtraArguments lhs, BuiltinExtraArguments rhs) {
V(InternalArrayCode, BUILTIN, UNINITIALIZED, kNoExtraICState) \
V(ArrayCode, BUILTIN, UNINITIALIZED, kNoExtraICState) \
\
+ V(MathMax, BUILTIN, UNINITIALIZED, kNoExtraICState) \
+ V(MathMin, BUILTIN, UNINITIALIZED, kNoExtraICState) \
+ \
V(NumberConstructor, BUILTIN, UNINITIALIZED, kNoExtraICState) \
V(NumberConstructor_ConstructStub, BUILTIN, UNINITIALIZED, kNoExtraICState) \
\
@@ -546,6 +549,17 @@ class Builtins {
static void Generate_InternalArrayCode(MacroAssembler* masm);
static void Generate_ArrayCode(MacroAssembler* masm);
+ enum class MathMaxMinKind { kMax, kMin };
+ static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind);
+ // ES6 section 20.2.2.24 Math.max ( value1, value2 , ...values )
+ static void Generate_MathMax(MacroAssembler* masm) {
+ Generate_MathMaxMin(masm, MathMaxMinKind::kMax);
+ }
+ // ES6 section 20.2.2.25 Math.min ( value1, value2 , ...values )
+ static void Generate_MathMin(MacroAssembler* masm) {
+ Generate_MathMaxMin(masm, MathMaxMinKind::kMin);
+ }
+
// ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case.
static void Generate_NumberConstructor(MacroAssembler* masm);
// ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case.

Powered by Google App Engine
This is Rietveld 408576698