OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api-arguments.h" | 7 #include "src/api-arguments.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/base/ieee754.h" | 10 #include "src/base/ieee754.h" |
(...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2496 using compiler::Node; | 2496 using compiler::Node; |
2497 | 2497 |
2498 Node* x = assembler->Parameter(1); | 2498 Node* x = assembler->Parameter(1); |
2499 Node* context = assembler->Parameter(4); | 2499 Node* context = assembler->Parameter(4); |
2500 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); | 2500 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); |
2501 Node* value = assembler->Float64Log1p(x_value); | 2501 Node* value = assembler->Float64Log1p(x_value); |
2502 Node* result = assembler->ChangeFloat64ToTagged(value); | 2502 Node* result = assembler->ChangeFloat64ToTagged(value); |
2503 assembler->Return(result); | 2503 assembler->Return(result); |
2504 } | 2504 } |
2505 | 2505 |
| 2506 // ES6 section 20.2.2.23 Math.log2 ( x ) |
| 2507 void Builtins::Generate_MathLog2(CodeStubAssembler* assembler) { |
| 2508 using compiler::Node; |
| 2509 |
| 2510 Node* x = assembler->Parameter(1); |
| 2511 Node* context = assembler->Parameter(4); |
| 2512 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); |
| 2513 Node* value = assembler->Float64Log2(x_value); |
| 2514 Node* result = assembler->ChangeFloat64ToTagged(value); |
| 2515 assembler->Return(result); |
| 2516 } |
| 2517 |
| 2518 // ES6 section 20.2.2.22 Math.log10 ( x ) |
| 2519 void Builtins::Generate_MathLog10(CodeStubAssembler* assembler) { |
| 2520 using compiler::Node; |
| 2521 |
| 2522 Node* x = assembler->Parameter(1); |
| 2523 Node* context = assembler->Parameter(4); |
| 2524 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); |
| 2525 Node* value = assembler->Float64Log10(x_value); |
| 2526 Node* result = assembler->ChangeFloat64ToTagged(value); |
| 2527 assembler->Return(result); |
| 2528 } |
| 2529 |
2506 // ES6 section 20.2.2.28 Math.round ( x ) | 2530 // ES6 section 20.2.2.28 Math.round ( x ) |
2507 void Builtins::Generate_MathRound(CodeStubAssembler* assembler) { | 2531 void Builtins::Generate_MathRound(CodeStubAssembler* assembler) { |
2508 Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Round); | 2532 Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Round); |
2509 } | 2533 } |
2510 | 2534 |
2511 // ES6 section 20.2.2.32 Math.sqrt ( x ) | 2535 // ES6 section 20.2.2.32 Math.sqrt ( x ) |
2512 void Builtins::Generate_MathSqrt(CodeStubAssembler* assembler) { | 2536 void Builtins::Generate_MathSqrt(CodeStubAssembler* assembler) { |
2513 using compiler::Node; | 2537 using compiler::Node; |
2514 | 2538 |
2515 Node* x = assembler->Parameter(1); | 2539 Node* x = assembler->Parameter(1); |
(...skipping 3513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6029 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 6053 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
6030 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 6054 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
6031 #undef DEFINE_BUILTIN_ACCESSOR_C | 6055 #undef DEFINE_BUILTIN_ACCESSOR_C |
6032 #undef DEFINE_BUILTIN_ACCESSOR_A | 6056 #undef DEFINE_BUILTIN_ACCESSOR_A |
6033 #undef DEFINE_BUILTIN_ACCESSOR_T | 6057 #undef DEFINE_BUILTIN_ACCESSOR_T |
6034 #undef DEFINE_BUILTIN_ACCESSOR_S | 6058 #undef DEFINE_BUILTIN_ACCESSOR_S |
6035 #undef DEFINE_BUILTIN_ACCESSOR_H | 6059 #undef DEFINE_BUILTIN_ACCESSOR_H |
6036 | 6060 |
6037 } // namespace internal | 6061 } // namespace internal |
6038 } // namespace v8 | 6062 } // namespace v8 |
OLD | NEW |