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

Side by Side Diff: src/builtins.cc

Issue 2077533002: [builtins] Introduce proper Float64Exp operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Import tests from Raymond. 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/ieee754.h" 10 #include "src/base/ieee754.h"
(...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 2445
2446 assembler->Bind(&do_clz32); 2446 assembler->Bind(&do_clz32);
2447 { 2447 {
2448 Node* x_value = var_clz32_x.value(); 2448 Node* x_value = var_clz32_x.value();
2449 Node* value = assembler->Word32Clz(x_value); 2449 Node* value = assembler->Word32Clz(x_value);
2450 Node* result = assembler->ChangeInt32ToTagged(value); 2450 Node* result = assembler->ChangeInt32ToTagged(value);
2451 assembler->Return(result); 2451 assembler->Return(result);
2452 } 2452 }
2453 } 2453 }
2454 2454
2455 // ES6 section 20.2.2.14 Math.exp ( x )
2456 void Builtins::Generate_MathExp(CodeStubAssembler* assembler) {
2457 using compiler::Node;
2458
2459 Node* x = assembler->Parameter(1);
2460 Node* context = assembler->Parameter(4);
2461 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2462 Node* value = assembler->Float64Exp(x_value);
2463 Node* result = assembler->ChangeFloat64ToTagged(value);
2464 assembler->Return(result);
2465 }
2466
2455 // ES6 section 20.2.2.16 Math.floor ( x ) 2467 // ES6 section 20.2.2.16 Math.floor ( x )
2456 void Builtins::Generate_MathFloor(CodeStubAssembler* assembler) { 2468 void Builtins::Generate_MathFloor(CodeStubAssembler* assembler) {
2457 Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Floor); 2469 Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Floor);
2458 } 2470 }
2459 2471
2460 // ES6 section 20.2.2.17 Math.fround ( x ) 2472 // ES6 section 20.2.2.17 Math.fround ( x )
2461 BUILTIN(MathFround) { 2473 BUILTIN(MathFround) {
2462 HandleScope scope(isolate); 2474 HandleScope scope(isolate);
2463 DCHECK_EQ(2, args.length()); 2475 DCHECK_EQ(2, args.length());
2464 Handle<Object> x = args.at<Object>(1); 2476 Handle<Object> x = args.at<Object>(1);
(...skipping 3588 matching lines...) Expand 10 before | Expand all | Expand 10 after
6053 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 6065 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
6054 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 6066 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
6055 #undef DEFINE_BUILTIN_ACCESSOR_C 6067 #undef DEFINE_BUILTIN_ACCESSOR_C
6056 #undef DEFINE_BUILTIN_ACCESSOR_A 6068 #undef DEFINE_BUILTIN_ACCESSOR_A
6057 #undef DEFINE_BUILTIN_ACCESSOR_T 6069 #undef DEFINE_BUILTIN_ACCESSOR_T
6058 #undef DEFINE_BUILTIN_ACCESSOR_S 6070 #undef DEFINE_BUILTIN_ACCESSOR_S
6059 #undef DEFINE_BUILTIN_ACCESSOR_H 6071 #undef DEFINE_BUILTIN_ACCESSOR_H
6060 6072
6061 } // namespace internal 6073 } // namespace internal
6062 } // namespace v8 6074 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/codegen.h » ('j') | test/unittests/base/ieee754-unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698