Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion blutter/src/CodeAnalyzer_arm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ static VarValue* getPoolObject(DartApp& app, intptr_t offset, A64::Register dstR
static inline void handleDecompressPointer(AsmIterator& insn, arm64_reg reg) {
INSN_ASSERT(insn.id() == ARM64_INS_ADD);
INSN_ASSERT(insn.ops(0).reg == insn.ops(1).reg && insn.ops(0).reg == reg);
#if defined(DART_COMPRESSED_POINTERS)
INSN_ASSERT(insn.ops(2).reg == CSREG_DART_HEAP && insn.ops(2).shift.value == 32);
#endif
++insn;
}

Expand Down Expand Up @@ -2201,13 +2203,15 @@ std::unique_ptr<MoveRegInstr> FunctionAnalyzer::processMoveRegInstr(AsmIterator&

std::unique_ptr<DecompressPointerInstr> FunctionAnalyzer::processDecompressPointerInstr(AsmIterator& insn)
{
#if defined(DART_COMPRESSED_POINTERS)
if (insn.id() == ARM64_INS_ADD && insn.ops(2).reg == CSREG_DART_HEAP && insn.ops(2).shift.value == 32) {
INSN_ASSERT(insn.ops(0).reg == insn.ops(1).reg);
const auto reg = A64::Register{ insn.ops(0).reg };
const auto ins0_addr = insn.address();
++insn;
return std::make_unique<DecompressPointerInstr>(insn.Wrap(ins0_addr), reg);
}
#endif
return nullptr;
}

Expand Down Expand Up @@ -2959,7 +2963,9 @@ std::unique_ptr<WriteBarrierInstr> FunctionAnalyzer::processWriteBarrierInstr(As

INSN_ASSERT(insn.id() == ARM64_INS_TST);
INSN_ASSERT(insn.ops(0).reg == CSREG_DART_TMP);
#if defined(DART_COMPRESSED_POINTERS)
INSN_ASSERT(insn.ops(1).reg == CSREG_DART_HEAP);
#endif
INSN_ASSERT(insn.ops(1).shift.type == ARM64_SFT_LSR && insn.ops(1).shift.value == 32);
++insn;

Expand Down Expand Up @@ -3381,4 +3387,4 @@ AsmTexts CodeAnalyzer::convertAsm(AsmInstructions& asm_insns)
return AsmTexts{ asm_texts, first_stack_limit_addr, max_param_stack_offset };
}

#endif // NO_CODE_ANALYSIS
#endif // NO_CODE_ANALYSIS