diff --git a/src/arm64/assembler-arm64-inl.h b/src/arm64/assembler-arm64-inl.h index b56e3ed2a1..3d12ac076c 100644 --- a/src/arm64/assembler-arm64-inl.h +++ b/src/arm64/assembler-arm64-inl.h @@ -1199,11 +1199,16 @@ void Assembler::LoadRelocated(const CPURegister& rt, const Operand& operand) { } -inline void Assembler::CheckBuffer() { +inline void Assembler::CheckBufferSpace() { ASSERT(pc_ < (buffer_ + buffer_size_)); if (buffer_space() < kGap) { GrowBuffer(); } +} + + +inline void Assembler::CheckBuffer() { + CheckBufferSpace(); if (pc_offset() >= next_veneer_pool_check_) { CheckVeneerPool(false, true); } diff --git a/src/arm64/assembler-arm64.h b/src/arm64/assembler-arm64.h index a5784a6f23..391a900763 100644 --- a/src/arm64/assembler-arm64.h +++ b/src/arm64/assembler-arm64.h @@ -2040,6 +2040,7 @@ class Assembler : public AssemblerBase { } void GrowBuffer(); + void CheckBufferSpace(); void CheckBuffer(); // Pc offset of the next constant pool check. @@ -2238,7 +2239,7 @@ class PatchingAssembler : public Assembler { class EnsureSpace BASE_EMBEDDED { public: explicit EnsureSpace(Assembler* assembler) { - assembler->CheckBuffer(); + assembler->CheckBufferSpace(); } };