Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 4a41fe4c7f1f6aab991cd7e188a79993bb47cd27..343970b77b3f6b17f2ce3f0b06deaf7245e0f000 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -2421,6 +2421,18 @@ void Builtins::Generate_MathClz32(CodeStubAssembler* assembler) { |
} |
} |
+// ES6 section 20.2.2.12 Math.cos ( x ) |
+void Builtins::Generate_MathCos(CodeStubAssembler* assembler) { |
+ using compiler::Node; |
+ |
+ Node* x = assembler->Parameter(1); |
+ Node* context = assembler->Parameter(4); |
+ Node* x_value = assembler->TruncateTaggedToFloat64(context, x); |
+ Node* value = assembler->Float64Cos(x_value); |
+ Node* result = assembler->ChangeFloat64ToTagged(value); |
+ assembler->Return(result); |
+} |
+ |
// ES6 section 20.2.2.14 Math.exp ( x ) |
void Builtins::Generate_MathExp(CodeStubAssembler* assembler) { |
using compiler::Node; |
@@ -2525,6 +2537,18 @@ void Builtins::Generate_MathRound(CodeStubAssembler* assembler) { |
Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Round); |
} |
+// ES6 section 20.2.2.30 Math.sin ( x ) |
+void Builtins::Generate_MathSin(CodeStubAssembler* assembler) { |
+ using compiler::Node; |
+ |
+ Node* x = assembler->Parameter(1); |
+ Node* context = assembler->Parameter(4); |
+ Node* x_value = assembler->TruncateTaggedToFloat64(context, x); |
+ Node* value = assembler->Float64Sin(x_value); |
+ Node* result = assembler->ChangeFloat64ToTagged(value); |
+ assembler->Return(result); |
+} |
+ |
// ES6 section 20.2.2.32 Math.sqrt ( x ) |
void Builtins::Generate_MathSqrt(CodeStubAssembler* assembler) { |
using compiler::Node; |