示例#1
0
HLInst* X86Compiler::newInst(uint32_t code, const Operand& o0, const Operand& o1, const Operand& o2, const Operand& o3, const Operand& o4) {
  size_t size = X86Compiler_getInstSize(code);
  HLInst* inst = static_cast<HLInst*>(_zoneAllocator.alloc(size + 5 * sizeof(Operand)));

  if (inst == NULL)
    goto _NoMemory;

  {
    Operand* opList = reinterpret_cast<Operand*>(reinterpret_cast<uint8_t*>(inst) + size);
    opList[0] = o0;
    opList[1] = o1;
    opList[2] = o2;
    opList[3] = o3;
    opList[4] = o4;
    ASMJIT_ASSERT_OPERAND(o0);
    ASMJIT_ASSERT_OPERAND(o1);
    ASMJIT_ASSERT_OPERAND(o2);
    ASMJIT_ASSERT_OPERAND(o3);
    ASMJIT_ASSERT_OPERAND(o4);
    return X86Compiler_newInst(this, inst, code, getInstOptionsAndReset(), opList, 5);
  }

_NoMemory:
  setLastError(kErrorNoHeapMemory);
  return NULL;
}
示例#2
0
HLInst* X86Compiler::newInst(uint32_t code) {
  size_t size = X86Compiler_getInstSize(code);
  HLInst* inst = static_cast<HLInst*>(_zoneAllocator.alloc(size));

  if (inst == NULL)
    goto _NoMemory;

  return X86Compiler_newInst(this, inst, code, getInstOptionsAndReset(), NULL, 0);

_NoMemory:
  setLastError(kErrorNoHeapMemory);
  return NULL;
}
示例#3
0
HLInst* X86Compiler::newInst(uint32_t code, const Operand& o0) noexcept {
  size_t size = X86Compiler_getInstSize(code);
  HLInst* inst = static_cast<HLInst*>(_zoneAllocator.alloc(size + 1 * sizeof(Operand)));

  if (inst == nullptr)
    goto _NoMemory;

  {
    Operand* opList = reinterpret_cast<Operand*>(reinterpret_cast<uint8_t*>(inst) + size);
    opList[0] = o0;
    ASMJIT_ASSERT_OPERAND(o0);
    return X86Compiler_newInst(this, inst, code, getInstOptionsAndReset(), opList, 1);
  }

_NoMemory:
  setLastError(kErrorNoHeapMemory);
  return nullptr;
}