SSATmp* IRUnit::findConst(Type type) { assert(type.isConst()); IRInstruction inst(DefConst, BCMarker()); inst.setTypeParam(type); if (SSATmp* tmp = m_constTable.lookup(&inst)) { assert(tmp->type().equals(type)); return tmp; } return m_constTable.insert(cloneInstruction(&inst)->dst()); }
SSATmp* IRFactory::findConst(ConstData& cdata, Type ctype) { IRInstruction inst(DefConst, BCMarker()); inst.setExtra(&cdata); inst.setTypeParam(ctype); if (SSATmp* tmp = m_constTable.lookup(&inst)) { assert(tmp->type().equals(ctype)); return tmp; } return m_constTable.insert(cloneInstruction(&inst)->dst()); }
IRInstruction* IRUnit::defLabel(unsigned numDst, BCMarker marker) { IRInstruction inst(DefLabel, marker); IRInstruction* label = cloneInstruction(&inst); if (numDst > 0) { SSATmp* dsts = (SSATmp*) m_arena.alloc(numDst * sizeof(SSATmp)); for (unsigned i = 0; i < numDst; ++i) { new (&dsts[i]) SSATmp(m_nextOpndId++, label); } label->setDsts(numDst, dsts); } return label; }
IRInstruction* IRUnit::defLabel(unsigned numDst, BCMarker marker, const jit::vector<uint32_t>& producedRefs) { IRInstruction inst(DefLabel, marker); IRInstruction* label = cloneInstruction(&inst); always_assert(producedRefs.size() == numDst); m_labelRefs[label] = producedRefs; if (numDst > 0) { SSATmp* dsts = (SSATmp*) m_arena.alloc(numDst * sizeof(SSATmp)); for (unsigned i = 0; i < numDst; ++i) { new (&dsts[i]) SSATmp(m_nextOpndId++, label); } label->setDsts(numDst, dsts); } return label; }