Commit 6b63aa06 authored by titzer's avatar titzer Committed by Commit bot

[turbofan] Handle void returns in instruction selector.

R=jarin@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1269183002

Cr-Commit-Position: refs/heads/master@{#29999}
parent 222b70d1
......@@ -1000,9 +1000,13 @@ void InstructionSelector::VisitGoto(BasicBlock* target) {
void InstructionSelector::VisitReturn(Node* value) {
DCHECK_NOT_NULL(value);
OperandGenerator g(this);
Emit(kArchRet, g.NoOutput(),
g.UseLocation(value, linkage()->GetReturnLocation(),
linkage()->GetReturnType()));
if (linkage()->GetIncomingDescriptor()->ReturnCount() == 0) {
Emit(kArchRet, g.NoOutput());
} else {
Emit(kArchRet, g.NoOutput(),
g.UseLocation(value, linkage()->GetReturnLocation(),
linkage()->GetReturnType()));
}
}
......
......@@ -82,6 +82,13 @@ TEST(CodeGenInt32Binop) {
}
TEST(CodeGenNop) {
RawMachineAssemblerTester<void> m;
m.Return(m.Int32Constant(0));
m.GenerateCode();
}
#if V8_TURBOFAN_BACKEND_64
static Node* Int64Input(RawMachineAssemblerTester<int64_t>* m, int index) {
switch (index) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment