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. |