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

Side by Side Diff: src/code-stubs.cc

Issue 1828253002: [builtins] Provide Math.floor as TurboFan builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Address feedback. Created 4 years, 8 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
« no previous file with comments | « src/builtins.cc ('k') | src/compiler/code-stub-assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 } 852 }
853 } 853 }
854 } 854 }
855 } 855 }
856 856
857 assembler->Bind(&do_fadd); 857 assembler->Bind(&do_fadd);
858 { 858 {
859 Node* lhs_value = var_fadd_lhs.value(); 859 Node* lhs_value = var_fadd_lhs.value();
860 Node* rhs_value = var_fadd_rhs.value(); 860 Node* rhs_value = var_fadd_rhs.value();
861 Node* value = assembler->Float64Add(lhs_value, rhs_value); 861 Node* value = assembler->Float64Add(lhs_value, rhs_value);
862 // TODO(bmeurer): Introduce a ChangeFloat64ToTagged. 862 Node* result = assembler->ChangeFloat64ToTagged(value);
863 Node* result = assembler->AllocateHeapNumberWithValue(value);
864 assembler->Return(result); 863 assembler->Return(result);
865 } 864 }
866 } 865 }
867 866
868 void SubtractStub::GenerateAssembly( 867 void SubtractStub::GenerateAssembly(
869 compiler::CodeStubAssembler* assembler) const { 868 compiler::CodeStubAssembler* assembler) const {
870 typedef compiler::CodeStubAssembler::Label Label; 869 typedef compiler::CodeStubAssembler::Label Label;
871 typedef compiler::Node Node; 870 typedef compiler::Node Node;
872 typedef compiler::CodeStubAssembler::Variable Variable; 871 typedef compiler::CodeStubAssembler::Variable Variable;
873 872
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 assembler->Goto(&loop); 1019 assembler->Goto(&loop);
1021 } 1020 }
1022 } 1021 }
1023 } 1022 }
1024 1023
1025 assembler->Bind(&do_fsub); 1024 assembler->Bind(&do_fsub);
1026 { 1025 {
1027 Node* lhs_value = var_fsub_lhs.value(); 1026 Node* lhs_value = var_fsub_lhs.value();
1028 Node* rhs_value = var_fsub_rhs.value(); 1027 Node* rhs_value = var_fsub_rhs.value();
1029 Node* value = assembler->Float64Sub(lhs_value, rhs_value); 1028 Node* value = assembler->Float64Sub(lhs_value, rhs_value);
1030 // TODO(bmeurer): Introduce a ChangeFloat64ToTagged. 1029 Node* result = assembler->ChangeFloat64ToTagged(value);
1031 Node* result = assembler->AllocateHeapNumberWithValue(value);
1032 assembler->Return(result); 1030 assembler->Return(result);
1033 } 1031 }
1034 } 1032 }
1035 1033
1036 void BitwiseAndStub::GenerateAssembly( 1034 void BitwiseAndStub::GenerateAssembly(
1037 compiler::CodeStubAssembler* assembler) const { 1035 compiler::CodeStubAssembler* assembler) const {
1038 using compiler::Node; 1036 using compiler::Node;
1039 1037
1040 Node* lhs = assembler->Parameter(0); 1038 Node* lhs = assembler->Parameter(0);
1041 Node* rhs = assembler->Parameter(1); 1039 Node* rhs = assembler->Parameter(1);
(...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after
3377 if (type->Is(Type::UntaggedPointer())) { 3375 if (type->Is(Type::UntaggedPointer())) {
3378 return Representation::External(); 3376 return Representation::External();
3379 } 3377 }
3380 3378
3381 DCHECK(!type->Is(Type::Untagged())); 3379 DCHECK(!type->Is(Type::Untagged()));
3382 return Representation::Tagged(); 3380 return Representation::Tagged();
3383 } 3381 }
3384 3382
3385 } // namespace internal 3383 } // namespace internal
3386 } // namespace v8 3384 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/compiler/code-stub-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698