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

Side by Side Diff: src/builtins.cc

Issue 2060743002: [builtins] Introduce proper Float64Log1p operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@Math_Log
Patch Set: REBASE Created 4 years, 6 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 unified diff | Download patch
OLDNEW
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/once.h" 10 #include "src/base/once.h"
(...skipping 2456 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 using compiler::Node; 2467 using compiler::Node;
2468 2468
2469 Node* x = assembler->Parameter(1); 2469 Node* x = assembler->Parameter(1);
2470 Node* context = assembler->Parameter(4); 2470 Node* context = assembler->Parameter(4);
2471 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); 2471 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2472 Node* value = assembler->Float64Log(x_value); 2472 Node* value = assembler->Float64Log(x_value);
2473 Node* result = assembler->ChangeFloat64ToTagged(value); 2473 Node* result = assembler->ChangeFloat64ToTagged(value);
2474 assembler->Return(result); 2474 assembler->Return(result);
2475 } 2475 }
2476 2476
2477 // ES6 section 20.2.2.21 Math.log1p ( x )
2478 void Builtins::Generate_MathLog1p(CodeStubAssembler* assembler) {
2479 using compiler::Node;
2480
2481 Node* x = assembler->Parameter(1);
2482 Node* context = assembler->Parameter(4);
2483 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2484 Node* value = assembler->Float64Log1p(x_value);
2485 Node* result = assembler->ChangeFloat64ToTagged(value);
2486 assembler->Return(result);
Yang 2016/06/13 05:36:33 If only we could reduce duplicate code for these s
Benedikt Meurer 2016/06/13 05:40:17 Acknowledged.
2487 }
2488
2477 // ES6 section 20.2.2.28 Math.round ( x ) 2489 // ES6 section 20.2.2.28 Math.round ( x )
2478 void Builtins::Generate_MathRound(CodeStubAssembler* assembler) { 2490 void Builtins::Generate_MathRound(CodeStubAssembler* assembler) {
2479 Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Round); 2491 Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Round);
2480 } 2492 }
2481 2493
2482 // ES6 section 20.2.2.32 Math.sqrt ( x ) 2494 // ES6 section 20.2.2.32 Math.sqrt ( x )
2483 void Builtins::Generate_MathSqrt(CodeStubAssembler* assembler) { 2495 void Builtins::Generate_MathSqrt(CodeStubAssembler* assembler) {
2484 using compiler::Node; 2496 using compiler::Node;
2485 2497
2486 Node* x = assembler->Parameter(1); 2498 Node* x = assembler->Parameter(1);
(...skipping 3442 matching lines...) Expand 10 before | Expand all | Expand 10 after
5929 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) 5941 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T)
5930 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 5942 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
5931 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 5943 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
5932 #undef DEFINE_BUILTIN_ACCESSOR_C 5944 #undef DEFINE_BUILTIN_ACCESSOR_C
5933 #undef DEFINE_BUILTIN_ACCESSOR_A 5945 #undef DEFINE_BUILTIN_ACCESSOR_A
5934 #undef DEFINE_BUILTIN_ACCESSOR_T 5946 #undef DEFINE_BUILTIN_ACCESSOR_T
5935 #undef DEFINE_BUILTIN_ACCESSOR_H 5947 #undef DEFINE_BUILTIN_ACCESSOR_H
5936 5948
5937 } // namespace internal 5949 } // namespace internal
5938 } // namespace v8 5950 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698