Index: src/compiler/arm64/code-generator-arm64.cc |
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc |
index 91efff57e3184038347afb608c408481c1c5c4c3..217677ea72a22a8d14bb44ca3f24e2bcbe4f89c2 100644 |
--- a/src/compiler/arm64/code-generator-arm64.cc |
+++ b/src/compiler/arm64/code-generator-arm64.cc |
@@ -658,6 +658,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
ArchOpcode arch_opcode = ArchOpcodeField::decode(opcode); |
switch (arch_opcode) { |
case kArchCallCodeObject: { |
+ // We must not share code targets for calls to builtins for wasm code, as |
+ // they might need to be patched individually. |
+ internal::Assembler::BlockCodeTargetSharingScope scope; |
+ if (info()->IsWasm()) scope.Open(masm()); |
+ |
EnsureSpaceForLazyDeopt(); |
if (instr->InputAt(0)->IsImmediate()) { |
__ Call(Handle<Code>::cast(i.InputHeapObject(0)), |
@@ -685,6 +690,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
} |
case kArchTailCallCodeObjectFromJSFunction: |
case kArchTailCallCodeObject: { |
+ // We must not share code targets for calls to builtins for wasm code, as |
+ // they might need to be patched individually. |
+ internal::Assembler::BlockCodeTargetSharingScope scope; |
+ if (info()->IsWasm()) scope.Open(masm()); |
+ |
if (arch_opcode == kArchTailCallCodeObjectFromJSFunction) { |
AssemblePopArgumentsAdaptorFrame(kJavaScriptCallArgCountRegister, |
i.TempRegister(0), i.TempRegister(1), |