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()));
+ }
}
}
+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) {