Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 75bdde6e2943d5c1dde0067f333c76e1fa50893b..3181477700b9ef53ecbe4b9f14466ae07265d2de 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -2503,6 +2503,30 @@ void Builtins::Generate_MathLog1p(CodeStubAssembler* assembler) { |
assembler->Return(result); |
} |
+// ES6 section 20.2.2.23 Math.log2 ( x ) |
+void Builtins::Generate_MathLog2(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->Float64Log2(x_value); |
+ Node* result = assembler->ChangeFloat64ToTagged(value); |
+ assembler->Return(result); |
+} |
+ |
+// ES6 section 20.2.2.22 Math.log10 ( x ) |
+void Builtins::Generate_MathLog10(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->Float64Log10(x_value); |
+ Node* result = assembler->ChangeFloat64ToTagged(value); |
+ assembler->Return(result); |
+} |
+ |
// ES6 section 20.2.2.28 Math.round ( x ) |
void Builtins::Generate_MathRound(CodeStubAssembler* assembler) { |
Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Round); |