MCPcopy Create free account
hub / github.com/ZDoom/Raze / newLabelId

Method newLabelId

libraries/asmjit/asmjit/base/codeholder.cpp:425–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425Error 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
449Error CodeHolder::newNamedLabelId(uint32_t& idOut, const char* name, size_t nameLength, uint32_t type, uint32_t parentId) noexcept {
450 idOut = 0;

Callers 2

registerLabelNodeMethod · 0.80
newLabelMethod · 0.80

Calls 5

erroredFunction · 0.85
willGrowMethod · 0.80
_setIdMethod · 0.80
appendUnsafeMethod · 0.80
getLengthMethod · 0.45

Tested by

no test coverage detected