| Index: src/compiler/x64/code-generator-x64.cc
|
| diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
|
| index a4ece5d557ac0a21887a363a5d63c942c615a331..6167d1a1dd02573c56e55ef026c663dfa36d5cef 100644
|
| --- a/src/compiler/x64/code-generator-x64.cc
|
| +++ b/src/compiler/x64/code-generator-x64.cc
|
| @@ -659,8 +659,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
|
| case kArchCallCodeObject: {
|
| EnsureSpaceForLazyDeopt();
|
| if (HasImmediateInput(instr, 0)) {
|
| - Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
|
| - __ Call(code, RelocInfo::CODE_TARGET);
|
| + Constant callee_operand = i.ToConstant(instr->InputAt(0));
|
| + if (callee_operand.type() == Constant::Type::kInt32) {
|
| + __ wasm_direct_call(callee_operand.ToInt32());
|
| + } else {
|
| + Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0));
|
| + __ Call(code, RelocInfo::CODE_TARGET);
|
| + }
|
| } else {
|
| Register reg = i.InputRegister(0);
|
| __ addp(reg, Immediate(Code::kHeaderSize - kHeapObjectTag));
|
|
|