Index: src/compiler/mips64/code-generator-mips64.cc |
diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc |
index b122cbf9553af9bf8b2f7e4d07f4510e9d65352a..15894a70a17f5e81eded1e99e645b8f7c605d2a7 100644 |
--- a/src/compiler/mips64/code-generator-mips64.cc |
+++ b/src/compiler/mips64/code-generator-mips64.cc |
@@ -558,8 +558,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
case kArchCallCodeObject: { |
EnsureSpaceForLazyDeopt(); |
if (instr->InputAt(0)->IsImmediate()) { |
- __ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
- RelocInfo::CODE_TARGET); |
+ Constant callee_operand = i.ToConstant(instr->InputAt(0)); |
+ if (callee_operand.type() == Constant::Type::kInt32) { |
+ __ Call(reinterpret_cast<Address>(callee_operand.ToInt32()), |
+ RelocInfo::WASM_DIRECT_CALL); |
+ } else { |
+ __ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
+ RelocInfo::CODE_TARGET); |
+ } |
} else { |
__ daddiu(at, i.InputRegister(0), Code::kHeaderSize - kHeapObjectTag); |
__ Call(at); |