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

Method embedConstPool

libraries/asmjit/asmjit/base/assembler.cpp:333–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333Error Assembler::embedConstPool(const Label& label, const ConstPool& pool) {
334 if (_lastError) return _lastError;
335
336 if (!isLabelValid(label))
337 return DebugUtils::errored(kErrorInvalidLabel);
338
339 ASMJIT_PROPAGATE(align(kAlignData, static_cast<uint32_t>(pool.getAlignment())));
340 ASMJIT_PROPAGATE(bind(label));
341
342 size_t size = pool.getSize();
343 if (getRemainingSpace() < size) {
344 Error err = _code->growBuffer(&_section->_buffer, size);
345 if (ASMJIT_UNLIKELY(err)) return setLastError(err);
346 }
347
348 uint8_t* p = _bufferPtr;
349 pool.fill(p);
350
351#if !defined(ASMJIT_DISABLE_LOGGING)
352 if (_globalOptions & kOptionLoggingEnabled)
353 _code->_logger->logBinary(p, size);
354#endif // !ASMJIT_DISABLE_LOGGING
355
356 _bufferPtr += size;
357 return kErrorOk;
358}
359
360// ============================================================================
361// [asmjit::Assembler - Emit-Helpers]

Callers

nothing calls this directly

Calls 8

isLabelValidFunction · 0.85
erroredFunction · 0.85
getRemainingSpaceFunction · 0.85
growBufferMethod · 0.80
logBinaryMethod · 0.80
getAlignmentMethod · 0.45
getSizeMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected