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

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

Issue 1269183002: [turbofan] Handle void returns in instruction selector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | test/cctest/compiler/test-run-machops.cc » ('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 <limits> 7 #include <limits>
8 8
9 #include "src/base/adapters.h" 9 #include "src/base/adapters.h"
10 #include "src/compiler/instruction-selector-impl.h" 10 #include "src/compiler/instruction-selector-impl.h"
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 void InstructionSelector::VisitGoto(BasicBlock* target) { 993 void InstructionSelector::VisitGoto(BasicBlock* target) {
994 // jump to the next block. 994 // jump to the next block.
995 OperandGenerator g(this); 995 OperandGenerator g(this);
996 Emit(kArchJmp, g.NoOutput(), g.Label(target)); 996 Emit(kArchJmp, g.NoOutput(), g.Label(target));
997 } 997 }
998 998
999 999
1000 void InstructionSelector::VisitReturn(Node* value) { 1000 void InstructionSelector::VisitReturn(Node* value) {
1001 DCHECK_NOT_NULL(value); 1001 DCHECK_NOT_NULL(value);
1002 OperandGenerator g(this); 1002 OperandGenerator g(this);
1003 Emit(kArchRet, g.NoOutput(), 1003 if (linkage()->GetIncomingDescriptor()->ReturnCount() == 0) {
1004 g.UseLocation(value, linkage()->GetReturnLocation(), 1004 Emit(kArchRet, g.NoOutput());
1005 linkage()->GetReturnType())); 1005 } else {
1006 Emit(kArchRet, g.NoOutput(),
1007 g.UseLocation(value, linkage()->GetReturnLocation(),
1008 linkage()->GetReturnType()));
1009 }
1006 } 1010 }
1007 1011
1008 1012
1009 void InstructionSelector::VisitDeoptimize(Node* value) { 1013 void InstructionSelector::VisitDeoptimize(Node* value) {
1010 OperandGenerator g(this); 1014 OperandGenerator g(this);
1011 1015
1012 FrameStateDescriptor* desc = GetFrameStateDescriptor(value); 1016 FrameStateDescriptor* desc = GetFrameStateDescriptor(value);
1013 size_t arg_count = desc->GetTotalSize() + 1; // Include deopt id. 1017 size_t arg_count = desc->GetTotalSize() + 1; // Include deopt id.
1014 1018
1015 InstructionOperandVector args(instruction_zone()); 1019 InstructionOperandVector args(instruction_zone());
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 MachineOperatorBuilder::Flags 1159 MachineOperatorBuilder::Flags
1156 InstructionSelector::SupportedMachineOperatorFlags() { 1160 InstructionSelector::SupportedMachineOperatorFlags() {
1157 return MachineOperatorBuilder::Flag::kNoFlags; 1161 return MachineOperatorBuilder::Flag::kNoFlags;
1158 } 1162 }
1159 1163
1160 #endif // !V8_TURBOFAN_BACKEND 1164 #endif // !V8_TURBOFAN_BACKEND
1161 1165
1162 } // namespace compiler 1166 } // namespace compiler
1163 } // namespace internal 1167 } // namespace internal
1164 } // namespace v8 1168 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/compiler/test-run-machops.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698