11cb0ef41Sopenharmony_ci
21cb0ef41Sopenharmony_ci// Copyright (c) 1994-2006 Sun Microsystems Inc.
31cb0ef41Sopenharmony_ci// All Rights Reserved.
41cb0ef41Sopenharmony_ci//
51cb0ef41Sopenharmony_ci// Redistribution and use in source and binary forms, with or without
61cb0ef41Sopenharmony_ci// modification, are permitted provided that the following conditions are
71cb0ef41Sopenharmony_ci// met:
81cb0ef41Sopenharmony_ci//
91cb0ef41Sopenharmony_ci// - Redistributions of source code must retain the above copyright notice,
101cb0ef41Sopenharmony_ci// this list of conditions and the following disclaimer.
111cb0ef41Sopenharmony_ci//
121cb0ef41Sopenharmony_ci// - Redistribution in binary form must reproduce the above copyright
131cb0ef41Sopenharmony_ci// notice, this list of conditions and the following disclaimer in the
141cb0ef41Sopenharmony_ci// documentation and/or other materials provided with the distribution.
151cb0ef41Sopenharmony_ci//
161cb0ef41Sopenharmony_ci// - Neither the name of Sun Microsystems or the names of contributors may
171cb0ef41Sopenharmony_ci// be used to endorse or promote products derived from this software without
181cb0ef41Sopenharmony_ci// specific prior written permission.
191cb0ef41Sopenharmony_ci//
201cb0ef41Sopenharmony_ci// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
211cb0ef41Sopenharmony_ci// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
221cb0ef41Sopenharmony_ci// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
231cb0ef41Sopenharmony_ci// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
241cb0ef41Sopenharmony_ci// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
251cb0ef41Sopenharmony_ci// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
261cb0ef41Sopenharmony_ci// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
271cb0ef41Sopenharmony_ci// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
281cb0ef41Sopenharmony_ci// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
291cb0ef41Sopenharmony_ci// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
301cb0ef41Sopenharmony_ci// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci// The original source code covered by the above license above has been
331cb0ef41Sopenharmony_ci// modified significantly by Google Inc.
341cb0ef41Sopenharmony_ci// Copyright 2012 the V8 project authors. All rights reserved.
351cb0ef41Sopenharmony_ci
361cb0ef41Sopenharmony_ci#ifndef V8_CODEGEN_MIPS64_ASSEMBLER_MIPS64_INL_H_
371cb0ef41Sopenharmony_ci#define V8_CODEGEN_MIPS64_ASSEMBLER_MIPS64_INL_H_
381cb0ef41Sopenharmony_ci
391cb0ef41Sopenharmony_ci#include "src/codegen/mips64/assembler-mips64.h"
401cb0ef41Sopenharmony_ci
411cb0ef41Sopenharmony_ci#include "src/codegen/assembler.h"
421cb0ef41Sopenharmony_ci#include "src/debug/debug.h"
431cb0ef41Sopenharmony_ci#include "src/objects/objects-inl.h"
441cb0ef41Sopenharmony_ci
451cb0ef41Sopenharmony_cinamespace v8 {
461cb0ef41Sopenharmony_cinamespace internal {
471cb0ef41Sopenharmony_ci
481cb0ef41Sopenharmony_cibool CpuFeatures::SupportsOptimizer() { return IsSupported(FPU); }
491cb0ef41Sopenharmony_ci
501cb0ef41Sopenharmony_ci// -----------------------------------------------------------------------------
511cb0ef41Sopenharmony_ci// Operand and MemOperand.
521cb0ef41Sopenharmony_ci
531cb0ef41Sopenharmony_cibool Operand::is_reg() const { return rm_.is_valid(); }
541cb0ef41Sopenharmony_ci
551cb0ef41Sopenharmony_ciint64_t Operand::immediate() const {
561cb0ef41Sopenharmony_ci  DCHECK(!is_reg());
571cb0ef41Sopenharmony_ci  DCHECK(!IsHeapObjectRequest());
581cb0ef41Sopenharmony_ci  return value_.immediate;
591cb0ef41Sopenharmony_ci}
601cb0ef41Sopenharmony_ci
611cb0ef41Sopenharmony_ci// -----------------------------------------------------------------------------
621cb0ef41Sopenharmony_ci// RelocInfo.
631cb0ef41Sopenharmony_ci
641cb0ef41Sopenharmony_civoid RelocInfo::apply(intptr_t delta) {
651cb0ef41Sopenharmony_ci  if (IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)) {
661cb0ef41Sopenharmony_ci    // Absolute code pointer inside code object moves with the code object.
671cb0ef41Sopenharmony_ci    Assembler::RelocateInternalReference(rmode_, pc_, delta);
681cb0ef41Sopenharmony_ci  }
691cb0ef41Sopenharmony_ci}
701cb0ef41Sopenharmony_ci
711cb0ef41Sopenharmony_ciAddress RelocInfo::target_address() {
721cb0ef41Sopenharmony_ci  DCHECK(IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) || IsWasmCall(rmode_));
731cb0ef41Sopenharmony_ci  return Assembler::target_address_at(pc_, constant_pool_);
741cb0ef41Sopenharmony_ci}
751cb0ef41Sopenharmony_ci
761cb0ef41Sopenharmony_ciAddress RelocInfo::target_address_address() {
771cb0ef41Sopenharmony_ci  DCHECK(HasTargetAddressAddress());
781cb0ef41Sopenharmony_ci  // Read the address of the word containing the target_address in an
791cb0ef41Sopenharmony_ci  // instruction stream.
801cb0ef41Sopenharmony_ci  // The only architecture-independent user of this function is the serializer.
811cb0ef41Sopenharmony_ci  // The serializer uses it to find out how many raw bytes of instruction to
821cb0ef41Sopenharmony_ci  // output before the next target.
831cb0ef41Sopenharmony_ci  // For an instruction like LUI/ORI where the target bits are mixed into the
841cb0ef41Sopenharmony_ci  // instruction bits, the size of the target will be zero, indicating that the
851cb0ef41Sopenharmony_ci  // serializer should not step forward in memory after a target is resolved
861cb0ef41Sopenharmony_ci  // and written. In this case the target_address_address function should
871cb0ef41Sopenharmony_ci  // return the end of the instructions to be patched, allowing the
881cb0ef41Sopenharmony_ci  // deserializer to deserialize the instructions as raw bytes and put them in
891cb0ef41Sopenharmony_ci  // place, ready to be patched with the target. After jump optimization,
901cb0ef41Sopenharmony_ci  // that is the address of the instruction that follows J/JAL/JR/JALR
911cb0ef41Sopenharmony_ci  // instruction.
921cb0ef41Sopenharmony_ci  return pc_ + Assembler::kInstructionsFor64BitConstant * kInstrSize;
931cb0ef41Sopenharmony_ci}
941cb0ef41Sopenharmony_ci
951cb0ef41Sopenharmony_ciAddress RelocInfo::constant_pool_entry_address() { UNREACHABLE(); }
961cb0ef41Sopenharmony_ci
971cb0ef41Sopenharmony_ciint RelocInfo::target_address_size() { return Assembler::kSpecialTargetSize; }
981cb0ef41Sopenharmony_ci
991cb0ef41Sopenharmony_civoid Assembler::deserialization_set_special_target_at(
1001cb0ef41Sopenharmony_ci    Address instruction_payload, Code code, Address target) {
1011cb0ef41Sopenharmony_ci  set_target_address_at(instruction_payload,
1021cb0ef41Sopenharmony_ci                        !code.is_null() ? code.constant_pool() : kNullAddress,
1031cb0ef41Sopenharmony_ci                        target);
1041cb0ef41Sopenharmony_ci}
1051cb0ef41Sopenharmony_ci
1061cb0ef41Sopenharmony_ciint Assembler::deserialization_special_target_size(
1071cb0ef41Sopenharmony_ci    Address instruction_payload) {
1081cb0ef41Sopenharmony_ci  return kSpecialTargetSize;
1091cb0ef41Sopenharmony_ci}
1101cb0ef41Sopenharmony_ci
1111cb0ef41Sopenharmony_civoid Assembler::set_target_internal_reference_encoded_at(Address pc,
1121cb0ef41Sopenharmony_ci                                                         Address target) {
1131cb0ef41Sopenharmony_ci  // Encoded internal references are j/jal instructions.
1141cb0ef41Sopenharmony_ci  Instr instr = Assembler::instr_at(pc + 0 * kInstrSize);
1151cb0ef41Sopenharmony_ci
1161cb0ef41Sopenharmony_ci  uint64_t imm28 = target & static_cast<uint64_t>(kImm28Mask);
1171cb0ef41Sopenharmony_ci
1181cb0ef41Sopenharmony_ci  instr &= ~kImm26Mask;
1191cb0ef41Sopenharmony_ci  uint64_t imm26 = imm28 >> 2;
1201cb0ef41Sopenharmony_ci  DCHECK(is_uint26(imm26));
1211cb0ef41Sopenharmony_ci
1221cb0ef41Sopenharmony_ci  instr_at_put(pc, instr | (imm26 & kImm26Mask));
1231cb0ef41Sopenharmony_ci  // Currently used only by deserializer, and all code will be flushed
1241cb0ef41Sopenharmony_ci  // after complete deserialization, no need to flush on each reference.
1251cb0ef41Sopenharmony_ci}
1261cb0ef41Sopenharmony_ci
1271cb0ef41Sopenharmony_civoid Assembler::deserialization_set_target_internal_reference_at(
1281cb0ef41Sopenharmony_ci    Address pc, Address target, RelocInfo::Mode mode) {
1291cb0ef41Sopenharmony_ci  if (mode == RelocInfo::INTERNAL_REFERENCE_ENCODED) {
1301cb0ef41Sopenharmony_ci    DCHECK(IsJ(instr_at(pc)));
1311cb0ef41Sopenharmony_ci    set_target_internal_reference_encoded_at(pc, target);
1321cb0ef41Sopenharmony_ci  } else {
1331cb0ef41Sopenharmony_ci    DCHECK(mode == RelocInfo::INTERNAL_REFERENCE);
1341cb0ef41Sopenharmony_ci    Memory<Address>(pc) = target;
1351cb0ef41Sopenharmony_ci  }
1361cb0ef41Sopenharmony_ci}
1371cb0ef41Sopenharmony_ci
1381cb0ef41Sopenharmony_ciHeapObject RelocInfo::target_object(PtrComprCageBase cage_base) {
1391cb0ef41Sopenharmony_ci  DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
1401cb0ef41Sopenharmony_ci         IsDataEmbeddedObject(rmode_));
1411cb0ef41Sopenharmony_ci  if (IsDataEmbeddedObject(rmode_)) {
1421cb0ef41Sopenharmony_ci    return HeapObject::cast(Object(ReadUnalignedValue<Address>(pc_)));
1431cb0ef41Sopenharmony_ci  }
1441cb0ef41Sopenharmony_ci  return HeapObject::cast(
1451cb0ef41Sopenharmony_ci      Object(Assembler::target_address_at(pc_, constant_pool_)));
1461cb0ef41Sopenharmony_ci}
1471cb0ef41Sopenharmony_ci
1481cb0ef41Sopenharmony_ciHandle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) {
1491cb0ef41Sopenharmony_ci  if (IsDataEmbeddedObject(rmode_)) {
1501cb0ef41Sopenharmony_ci    return Handle<HeapObject>::cast(ReadUnalignedValue<Handle<Object>>(pc_));
1511cb0ef41Sopenharmony_ci  } else {
1521cb0ef41Sopenharmony_ci    DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_));
1531cb0ef41Sopenharmony_ci    return Handle<HeapObject>(reinterpret_cast<Address*>(
1541cb0ef41Sopenharmony_ci        Assembler::target_address_at(pc_, constant_pool_)));
1551cb0ef41Sopenharmony_ci  }
1561cb0ef41Sopenharmony_ci}
1571cb0ef41Sopenharmony_ci
1581cb0ef41Sopenharmony_civoid RelocInfo::set_target_object(Heap* heap, HeapObject target,
1591cb0ef41Sopenharmony_ci                                  WriteBarrierMode write_barrier_mode,
1601cb0ef41Sopenharmony_ci                                  ICacheFlushMode icache_flush_mode) {
1611cb0ef41Sopenharmony_ci  DCHECK(IsCodeTarget(rmode_) || IsFullEmbeddedObject(rmode_) ||
1621cb0ef41Sopenharmony_ci         IsDataEmbeddedObject(rmode_));
1631cb0ef41Sopenharmony_ci  if (IsDataEmbeddedObject(rmode_)) {
1641cb0ef41Sopenharmony_ci    WriteUnalignedValue(pc_, target.ptr());
1651cb0ef41Sopenharmony_ci    // No need to flush icache since no instructions were changed.
1661cb0ef41Sopenharmony_ci  } else {
1671cb0ef41Sopenharmony_ci    Assembler::set_target_address_at(pc_, constant_pool_, target.ptr(),
1681cb0ef41Sopenharmony_ci                                     icache_flush_mode);
1691cb0ef41Sopenharmony_ci  }
1701cb0ef41Sopenharmony_ci  if (write_barrier_mode == UPDATE_WRITE_BARRIER && !host().is_null() &&
1711cb0ef41Sopenharmony_ci      !FLAG_disable_write_barriers) {
1721cb0ef41Sopenharmony_ci    WriteBarrierForCode(host(), this, target);
1731cb0ef41Sopenharmony_ci  }
1741cb0ef41Sopenharmony_ci}
1751cb0ef41Sopenharmony_ci
1761cb0ef41Sopenharmony_ciAddress RelocInfo::target_external_reference() {
1771cb0ef41Sopenharmony_ci  DCHECK(rmode_ == EXTERNAL_REFERENCE);
1781cb0ef41Sopenharmony_ci  return Assembler::target_address_at(pc_, constant_pool_);
1791cb0ef41Sopenharmony_ci}
1801cb0ef41Sopenharmony_ci
1811cb0ef41Sopenharmony_civoid RelocInfo::set_target_external_reference(
1821cb0ef41Sopenharmony_ci    Address target, ICacheFlushMode icache_flush_mode) {
1831cb0ef41Sopenharmony_ci  DCHECK(rmode_ == RelocInfo::EXTERNAL_REFERENCE);
1841cb0ef41Sopenharmony_ci  Assembler::set_target_address_at(pc_, constant_pool_, target,
1851cb0ef41Sopenharmony_ci                                   icache_flush_mode);
1861cb0ef41Sopenharmony_ci}
1871cb0ef41Sopenharmony_ci
1881cb0ef41Sopenharmony_ciAddress RelocInfo::target_internal_reference() {
1891cb0ef41Sopenharmony_ci  if (rmode_ == INTERNAL_REFERENCE) {
1901cb0ef41Sopenharmony_ci    return Memory<Address>(pc_);
1911cb0ef41Sopenharmony_ci  } else {
1921cb0ef41Sopenharmony_ci    // Encoded internal references are j/jal instructions.
1931cb0ef41Sopenharmony_ci    DCHECK(rmode_ == INTERNAL_REFERENCE_ENCODED);
1941cb0ef41Sopenharmony_ci    Instr instr = Assembler::instr_at(pc_ + 0 * kInstrSize);
1951cb0ef41Sopenharmony_ci    instr &= kImm26Mask;
1961cb0ef41Sopenharmony_ci    uint64_t imm28 = instr << 2;
1971cb0ef41Sopenharmony_ci    uint64_t segment = pc_ & ~static_cast<uint64_t>(kImm28Mask);
1981cb0ef41Sopenharmony_ci    return static_cast<Address>(segment | imm28);
1991cb0ef41Sopenharmony_ci  }
2001cb0ef41Sopenharmony_ci}
2011cb0ef41Sopenharmony_ci
2021cb0ef41Sopenharmony_ciAddress RelocInfo::target_internal_reference_address() {
2031cb0ef41Sopenharmony_ci  DCHECK(rmode_ == INTERNAL_REFERENCE || rmode_ == INTERNAL_REFERENCE_ENCODED);
2041cb0ef41Sopenharmony_ci  return pc_;
2051cb0ef41Sopenharmony_ci}
2061cb0ef41Sopenharmony_ci
2071cb0ef41Sopenharmony_ciAddress RelocInfo::target_runtime_entry(Assembler* origin) {
2081cb0ef41Sopenharmony_ci  DCHECK(IsRuntimeEntry(rmode_));
2091cb0ef41Sopenharmony_ci  return target_address();
2101cb0ef41Sopenharmony_ci}
2111cb0ef41Sopenharmony_ci
2121cb0ef41Sopenharmony_civoid RelocInfo::set_target_runtime_entry(Address target,
2131cb0ef41Sopenharmony_ci                                         WriteBarrierMode write_barrier_mode,
2141cb0ef41Sopenharmony_ci                                         ICacheFlushMode icache_flush_mode) {
2151cb0ef41Sopenharmony_ci  DCHECK(IsRuntimeEntry(rmode_));
2161cb0ef41Sopenharmony_ci  if (target_address() != target)
2171cb0ef41Sopenharmony_ci    set_target_address(target, write_barrier_mode, icache_flush_mode);
2181cb0ef41Sopenharmony_ci}
2191cb0ef41Sopenharmony_ci
2201cb0ef41Sopenharmony_ciAddress RelocInfo::target_off_heap_target() {
2211cb0ef41Sopenharmony_ci  DCHECK(IsOffHeapTarget(rmode_));
2221cb0ef41Sopenharmony_ci  return Assembler::target_address_at(pc_, constant_pool_);
2231cb0ef41Sopenharmony_ci}
2241cb0ef41Sopenharmony_ci
2251cb0ef41Sopenharmony_civoid RelocInfo::WipeOut() {
2261cb0ef41Sopenharmony_ci  DCHECK(IsFullEmbeddedObject(rmode_) || IsCodeTarget(rmode_) ||
2271cb0ef41Sopenharmony_ci         IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) ||
2281cb0ef41Sopenharmony_ci         IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_) ||
2291cb0ef41Sopenharmony_ci         IsOffHeapTarget(rmode_));
2301cb0ef41Sopenharmony_ci  if (IsInternalReference(rmode_)) {
2311cb0ef41Sopenharmony_ci    Memory<Address>(pc_) = kNullAddress;
2321cb0ef41Sopenharmony_ci  } else if (IsInternalReferenceEncoded(rmode_)) {
2331cb0ef41Sopenharmony_ci    Assembler::set_target_internal_reference_encoded_at(pc_, kNullAddress);
2341cb0ef41Sopenharmony_ci  } else {
2351cb0ef41Sopenharmony_ci    Assembler::set_target_address_at(pc_, constant_pool_, kNullAddress);
2361cb0ef41Sopenharmony_ci  }
2371cb0ef41Sopenharmony_ci}
2381cb0ef41Sopenharmony_ci
2391cb0ef41Sopenharmony_ci// -----------------------------------------------------------------------------
2401cb0ef41Sopenharmony_ci// Assembler.
2411cb0ef41Sopenharmony_ci
2421cb0ef41Sopenharmony_civoid Assembler::CheckBuffer() {
2431cb0ef41Sopenharmony_ci  if (buffer_space() <= kGap) {
2441cb0ef41Sopenharmony_ci    GrowBuffer();
2451cb0ef41Sopenharmony_ci  }
2461cb0ef41Sopenharmony_ci}
2471cb0ef41Sopenharmony_ci
2481cb0ef41Sopenharmony_civoid Assembler::CheckForEmitInForbiddenSlot() {
2491cb0ef41Sopenharmony_ci  if (!is_buffer_growth_blocked()) {
2501cb0ef41Sopenharmony_ci    CheckBuffer();
2511cb0ef41Sopenharmony_ci  }
2521cb0ef41Sopenharmony_ci  if (IsPrevInstrCompactBranch()) {
2531cb0ef41Sopenharmony_ci    // Nop instruction to precede a CTI in forbidden slot:
2541cb0ef41Sopenharmony_ci    Instr nop = SPECIAL | SLL;
2551cb0ef41Sopenharmony_ci    *reinterpret_cast<Instr*>(pc_) = nop;
2561cb0ef41Sopenharmony_ci    pc_ += kInstrSize;
2571cb0ef41Sopenharmony_ci
2581cb0ef41Sopenharmony_ci    ClearCompactBranchState();
2591cb0ef41Sopenharmony_ci  }
2601cb0ef41Sopenharmony_ci}
2611cb0ef41Sopenharmony_ci
2621cb0ef41Sopenharmony_civoid Assembler::EmitHelper(Instr x, CompactBranchType is_compact_branch) {
2631cb0ef41Sopenharmony_ci  if (IsPrevInstrCompactBranch()) {
2641cb0ef41Sopenharmony_ci    if (Instruction::IsForbiddenAfterBranchInstr(x)) {
2651cb0ef41Sopenharmony_ci      // Nop instruction to precede a CTI in forbidden slot:
2661cb0ef41Sopenharmony_ci      Instr nop = SPECIAL | SLL;
2671cb0ef41Sopenharmony_ci      *reinterpret_cast<Instr*>(pc_) = nop;
2681cb0ef41Sopenharmony_ci      pc_ += kInstrSize;
2691cb0ef41Sopenharmony_ci    }
2701cb0ef41Sopenharmony_ci    ClearCompactBranchState();
2711cb0ef41Sopenharmony_ci  }
2721cb0ef41Sopenharmony_ci  *reinterpret_cast<Instr*>(pc_) = x;
2731cb0ef41Sopenharmony_ci  pc_ += kInstrSize;
2741cb0ef41Sopenharmony_ci  if (is_compact_branch == CompactBranchType::COMPACT_BRANCH) {
2751cb0ef41Sopenharmony_ci    EmittedCompactBranchInstruction();
2761cb0ef41Sopenharmony_ci  }
2771cb0ef41Sopenharmony_ci  CheckTrampolinePoolQuick();
2781cb0ef41Sopenharmony_ci}
2791cb0ef41Sopenharmony_ci
2801cb0ef41Sopenharmony_citemplate <>
2811cb0ef41Sopenharmony_ciinline void Assembler::EmitHelper(uint8_t x);
2821cb0ef41Sopenharmony_ci
2831cb0ef41Sopenharmony_citemplate <typename T>
2841cb0ef41Sopenharmony_civoid Assembler::EmitHelper(T x) {
2851cb0ef41Sopenharmony_ci  *reinterpret_cast<T*>(pc_) = x;
2861cb0ef41Sopenharmony_ci  pc_ += sizeof(x);
2871cb0ef41Sopenharmony_ci  CheckTrampolinePoolQuick();
2881cb0ef41Sopenharmony_ci}
2891cb0ef41Sopenharmony_ci
2901cb0ef41Sopenharmony_citemplate <>
2911cb0ef41Sopenharmony_civoid Assembler::EmitHelper(uint8_t x) {
2921cb0ef41Sopenharmony_ci  *reinterpret_cast<uint8_t*>(pc_) = x;
2931cb0ef41Sopenharmony_ci  pc_ += sizeof(x);
2941cb0ef41Sopenharmony_ci  if (reinterpret_cast<intptr_t>(pc_) % kInstrSize == 0) {
2951cb0ef41Sopenharmony_ci    CheckTrampolinePoolQuick();
2961cb0ef41Sopenharmony_ci  }
2971cb0ef41Sopenharmony_ci}
2981cb0ef41Sopenharmony_ci
2991cb0ef41Sopenharmony_civoid Assembler::emit(Instr x, CompactBranchType is_compact_branch) {
3001cb0ef41Sopenharmony_ci  if (!is_buffer_growth_blocked()) {
3011cb0ef41Sopenharmony_ci    CheckBuffer();
3021cb0ef41Sopenharmony_ci  }
3031cb0ef41Sopenharmony_ci  EmitHelper(x, is_compact_branch);
3041cb0ef41Sopenharmony_ci}
3051cb0ef41Sopenharmony_ci
3061cb0ef41Sopenharmony_civoid Assembler::emit(uint64_t data) {
3071cb0ef41Sopenharmony_ci  CheckForEmitInForbiddenSlot();
3081cb0ef41Sopenharmony_ci  EmitHelper(data);
3091cb0ef41Sopenharmony_ci}
3101cb0ef41Sopenharmony_ci
3111cb0ef41Sopenharmony_ciEnsureSpace::EnsureSpace(Assembler* assembler) { assembler->CheckBuffer(); }
3121cb0ef41Sopenharmony_ci
3131cb0ef41Sopenharmony_ci}  // namespace internal
3141cb0ef41Sopenharmony_ci}  // namespace v8
3151cb0ef41Sopenharmony_ci
3161cb0ef41Sopenharmony_ci#endif  // V8_CODEGEN_MIPS64_ASSEMBLER_MIPS64_INL_H_
317