| 423 | } |
| 424 | |
| 425 | Error CodeHolder::newLabelId(uint32_t& idOut) noexcept { |
| 426 | idOut = 0; |
| 427 | |
| 428 | size_t index = _labels.getLength(); |
| 429 | if (ASMJIT_LIKELY(index >= Operand::kPackedIdCount)) |
| 430 | return DebugUtils::errored(kErrorLabelIndexOverflow); |
| 431 | |
| 432 | ASMJIT_PROPAGATE(_labels.willGrow(&_baseHeap)); |
| 433 | LabelEntry* le = _baseHeap.allocZeroedT<LabelEntry>(); |
| 434 | |
| 435 | if (ASMJIT_UNLIKELY(!le)) |
| 436 | return DebugUtils::errored(kErrorNoHeapMemory);; |
| 437 | |
| 438 | uint32_t id = Operand::packId(static_cast<uint32_t>(index)); |
| 439 | le->_setId(id); |
| 440 | le->_parentId = 0; |
| 441 | le->_sectionId = SectionEntry::kInvalidId; |
| 442 | le->_offset = 0; |
| 443 | |
| 444 | _labels.appendUnsafe(le); |
| 445 | idOut = id; |
| 446 | return kErrorOk; |
| 447 | } |
| 448 | |
| 449 | Error CodeHolder::newNamedLabelId(uint32_t& idOut, const char* name, size_t nameLength, uint32_t type, uint32_t parentId) noexcept { |
| 450 | idOut = 0; |
no test coverage detected