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

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 745633002: [turbofan] Clean up and factor out branch generation logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix IA32 fall through. Created 6 years, 1 month 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/compiler/instruction-codes.h ('k') | src/compiler/instruction-selector-impl.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/instruction-selector.h" 5 #include "src/compiler/instruction-selector.h"
6 6
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/instruction-selector-impl.h" 8 #include "src/compiler/instruction-selector-impl.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 959
960 void InstructionSelector::VisitConstant(Node* node) { 960 void InstructionSelector::VisitConstant(Node* node) {
961 // We must emit a NOP here because every live range needs a defining 961 // We must emit a NOP here because every live range needs a defining
962 // instruction in the register allocator. 962 // instruction in the register allocator.
963 OperandGenerator g(this); 963 OperandGenerator g(this);
964 Emit(kArchNop, g.DefineAsConstant(node)); 964 Emit(kArchNop, g.DefineAsConstant(node));
965 } 965 }
966 966
967 967
968 void InstructionSelector::VisitGoto(BasicBlock* target) { 968 void InstructionSelector::VisitGoto(BasicBlock* target) {
969 if (IsNextInAssemblyOrder(target)) { 969 // jump to the next block.
970 // fall through to the next block. 970 OperandGenerator g(this);
971 Emit(kArchNop, NULL)->MarkAsControl(); 971 Emit(kArchJmp, NULL, g.Label(target))->MarkAsControl();
972 } else {
973 // jump to the next block.
974 OperandGenerator g(this);
975 Emit(kArchJmp, NULL, g.Label(target))->MarkAsControl();
976 }
977 } 972 }
978 973
979 974
980 void InstructionSelector::VisitReturn(Node* value) { 975 void InstructionSelector::VisitReturn(Node* value) {
981 OperandGenerator g(this); 976 OperandGenerator g(this);
982 if (value != NULL) { 977 if (value != NULL) {
983 Emit(kArchRet, NULL, g.UseLocation(value, linkage()->GetReturnLocation(), 978 Emit(kArchRet, NULL, g.UseLocation(value, linkage()->GetReturnLocation(),
984 linkage()->GetReturnType())); 979 linkage()->GetReturnType()));
985 } else { 980 } else {
986 Emit(kArchRet, NULL); 981 Emit(kArchRet, NULL);
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 MachineOperatorBuilder::Flags 1108 MachineOperatorBuilder::Flags
1114 InstructionSelector::SupportedMachineOperatorFlags() { 1109 InstructionSelector::SupportedMachineOperatorFlags() {
1115 return MachineOperatorBuilder::Flag::kNoFlags; 1110 return MachineOperatorBuilder::Flag::kNoFlags;
1116 } 1111 }
1117 1112
1118 #endif // !V8_TURBOFAN_BACKEND 1113 #endif // !V8_TURBOFAN_BACKEND
1119 1114
1120 } // namespace compiler 1115 } // namespace compiler
1121 } // namespace internal 1116 } // namespace internal
1122 } // namespace v8 1117 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction-codes.h ('k') | src/compiler/instruction-selector-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698