diff --git a/assembler_arm64.cc b/assembler_arm64.cc index 86991ee5b887..721a93141ca1 100644 --- a/assembler_arm64.cc +++ b/assembler_arm64.cc @@ -619,16 +619,14 @@ void Assembler::Branch(const Code& target, br(TMP); } -void Assembler::BranchPatchable(const Code& code) { - Branch(code, PP, ObjectPoolBuilderEntry::kPatchable); -} - void Assembler::BranchLink(const Code& target, - ObjectPoolBuilderEntry::Patchability patchable) { + ObjectPoolBuilderEntry::Patchability patchable, + CodeEntryKind entry_kind) { const int32_t offset = target::ObjectPool::element_offset( object_pool_builder().FindObject(ToObject(target), patchable)); LoadWordFromPoolOffset(CODE_REG, offset); - ldr(TMP, FieldAddress(CODE_REG, target::Code::entry_point_offset())); + ldr(TMP, + FieldAddress(CODE_REG, target::Code::entry_point_offset(entry_kind))); blr(TMP); } @@ -638,11 +636,13 @@ void Assembler::BranchLinkToRuntime() { } void Assembler::BranchLinkWithEquivalence(const Code& target, - const Object& equivalence) { + const Object& equivalence, + CodeEntryKind entry_kind) { const int32_t offset = target::ObjectPool::element_offset( object_pool_builder().FindObject(ToObject(target), equivalence)); LoadWordFromPoolOffset(CODE_REG, offset); - ldr(TMP, FieldAddress(CODE_REG, target::Code::entry_point_offset())); + ldr(TMP, + FieldAddress(CODE_REG, target::Code::entry_point_offset(entry_kind))); blr(TMP); } @@ -1514,10 +1514,10 @@ void Assembler::LeaveStubFrame() { // R0 receiver, R5 ICData entries array // Preserve R4 (ARGS_DESC_REG), not required today, but maybe later. void Assembler::MonomorphicCheckedEntryJIT() { - ASSERT(has_single_entry_point_); has_single_entry_point_ = false; const bool saved_use_far_branches = use_far_branches(); set_use_far_branches(false); + const intptr_t start = CodeSize(); Label immediate, miss; Bind(&miss); @@ -1525,7 +1525,8 @@ void Assembler::MonomorphicCheckedEntryJIT() { br(IP0); Comment("MonomorphicCheckedEntry"); - ASSERT(CodeSize() == target::Instructions::kMonomorphicEntryOffsetJIT); + ASSERT(CodeSize() - start == + target::Instructions::kMonomorphicEntryOffsetJIT); const intptr_t cid_offset = target::Array::element_offset(0); const intptr_t count_offset = target::Array::element_offset(1); @@ -1541,7 +1542,8 @@ void Assembler::MonomorphicCheckedEntryJIT() { LoadImmediate(R4, 0); // GC-safe for OptimizeInvokedFunction. // Fall through to unchecked entry. - ASSERT(CodeSize() == target::Instructions::kPolymorphicEntryOffsetJIT); + ASSERT(CodeSize() - start == + target::Instructions::kPolymorphicEntryOffsetJIT); set_use_far_branches(saved_use_far_branches); } @@ -1549,7 +1551,6 @@ void Assembler::MonomorphicCheckedEntryJIT() { // R0 receiver, R5 guarded cid as Smi. // Preserve R4 (ARGS_DESC_REG), not required today, but maybe later. void Assembler::MonomorphicCheckedEntryAOT() { - ASSERT(has_single_entry_point_); has_single_entry_point_ = false; bool saved_use_far_branches = use_far_branches(); set_use_far_branches(false); diff --git a/assembler_arm64.h b/assembler_arm64.h index 33212a3ea3ad..0493e0809ac8 100644 --- a/assembler_arm64.h +++ b/assembler_arm64.h @@ -1371,14 +1371,15 @@ class Assembler : public AssemblerBase { Register pp, ObjectPoolBuilderEntry::Patchability patchable = ObjectPoolBuilderEntry::kNotPatchable); - void BranchPatchable(const Code& code); void BranchLink(const Code& code, ObjectPoolBuilderEntry::Patchability patchable = - ObjectPoolBuilderEntry::kNotPatchable); + ObjectPoolBuilderEntry::kNotPatchable, + CodeEntryKind entry_kind = CodeEntryKind::kNormal); - void BranchLinkPatchable(const Code& code) { - BranchLink(code, ObjectPoolBuilderEntry::kPatchable); + void BranchLinkPatchable(const Code& code, + CodeEntryKind entry_kind = CodeEntryKind::kNormal) { + BranchLink(code, ObjectPoolBuilderEntry::kPatchable, entry_kind); } void BranchLinkToRuntime(); @@ -1388,7 +1389,10 @@ class Assembler : public AssemblerBase { // Emit a call that shares its object pool entries with other calls // that have the same equivalence marker. - void BranchLinkWithEquivalence(const Code& code, const Object& equivalence); + void BranchLinkWithEquivalence( + const Code& code, + const Object& equivalence, + CodeEntryKind entry_kind = CodeEntryKind::kNormal); void AddImmediate(Register dest, int64_t imm) { AddImmediate(dest, dest, imm); @@ -1675,9 +1679,9 @@ class Assembler : public AssemblerBase { // Returns object data offset for address calculation; for heap objects also // accounts for the tag. static int32_t HeapDataOffset(bool is_external, intptr_t cid) { - return is_external ? - 0 : - (target::Instance::DataOffsetFor(cid) - kHeapObjectTag); + return is_external + ? 0 + : (target::Instance::DataOffsetFor(cid) - kHeapObjectTag); } static int32_t EncodeImm26BranchOffset(int64_t imm, int32_t instr) {