// compute the offset from RSP to the spill area at each block start. void Vxls::analyzeRsp() { auto num_blocks = unit.blocks.size(); boost::dynamic_bitset<> visited(num_blocks); spill_offsets.resize(num_blocks); for (auto b : blocks) { int offset; if (visited.test(b)) { offset = spill_offsets[b]; } else { offset = 0; } for (auto& inst : unit.blocks[b].code) { offset -= rspEffect(unit, inst); } for (auto s : succs(unit.blocks[b])) { if (visited.test(s)) { assert_flog(offset == spill_offsets[s], "rsp mismatch on edge B{}->B{}, expected {} got {}", size_t(b), size_t(s), spill_offsets[s], offset); } else { spill_offsets[s] = offset; visited.set(s); } } } }
bool Type::checkValid() const { // Note: be careful, the TFoo objects aren't all constructed yet in this // function. if (m_extra) { assertx(((m_bits & kClsSpecBits) == 0 || (m_bits & kArrSpecBits) == 0) && "Conflicting specialization"); } // We should have one canonical representation of Bottom. if (m_bits == kBottom) { assert_flog(*this == TBottom, "Bottom m_bits but nonzero others in {:#16x}:{}:{}:{:#16x}", m_bits, m_ptrVal, m_hasConstVal, m_extra); } return true; }
void addTranslation(const TransRec& transRec) { if (Trace::moduleEnabledRelease(Trace::trans, 1)) { // Log the translation's size, creation time, SrcKey, and size Trace::traceRelease( "New translation: %" PRId64 " %s %u %u %d\n", HPHP::Timer::GetCurrentTimeMicros() - mcgen::jitInitTime(), folly::format("{}:{}:{}", transRec.src.unit()->filepath(), transRec.src.funcID(), transRec.src.offset()).str().c_str(), transRec.aLen, transRec.acoldLen, static_cast<int>(transRec.kind)); } if (!enabled()) return; tc::assertOwnsCodeLock(); TransID id = transRec.id == kInvalidTransID ? s_translations.size() : transRec.id; assert_flog(transRec.isConsistent(), "{}", transRec.print()); if (id >= s_translations.size()) { s_translations.resize(id + 1); } s_translations[id] = transRec; s_translations[id].id = id; if (transRec.aLen > 0) { s_transDB[transRec.aStart] = id; } if (transRec.acoldLen > 0) { s_transDB[transRec.acoldStart] = id; } // Optimize storage of the created TransRec. s_translations[id].optimizeForMemory(); }