| 331 | } |
| 332 | |
| 333 | Error 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] |
nothing calls this directly
no test coverage detected