MCPcopy Create free account
hub / github.com/Chemiculs/qengine / embedConstPool

Method embedConstPool

src/qengine/extern/asmjit/core/assembler.cpp:196–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194#endif
195
196Error BaseAssembler::embedConstPool(const Label& label, const ConstPool& pool) {
197 if (ASMJIT_UNLIKELY(!_code))
198 return reportError(DebugUtils::errored(kErrorNotInitialized));
199
200 if (ASMJIT_UNLIKELY(!isLabelValid(label)))
201 return reportError(DebugUtils::errored(kErrorInvalidLabel));
202
203 ASMJIT_PROPAGATE(align(AlignMode::kData, uint32_t(pool.alignment())));
204 ASMJIT_PROPAGATE(bind(label));
205
206 size_t size = pool.size();
207 if (!size)
208 return kErrorOk;
209
210 CodeWriter writer(this);
211 ASMJIT_PROPAGATE(writer.ensureSpace(this, size));
212
213#ifndef ASMJIT_NO_LOGGING
214 uint8_t* data = writer.cursor();
215#endif
216
217 pool.fill(writer.cursor());
218 writer.advance(size);
219 writer.done(this);
220
221#ifndef ASMJIT_NO_LOGGING
222 if (_logger) {
223 uint32_t dataSizeLog2 = Support::min<uint32_t>(Support::ctz(pool.minItemSize()), 3);
224 uint32_t dataSize = 1 << dataSizeLog2;
225
226 StringTmp<512> sb;
227 Formatter::formatData(sb, _logger->flags(), arch(), dataTypeIdBySize[dataSize], data, size >> dataSizeLog2);
228 sb.append('\n');
229 _logger->log(sb);
230 }
231#endif
232
233 return kErrorOk;
234}
235
236Error BaseAssembler::embedLabel(const Label& label, size_t dataSize) {
237 if (ASMJIT_UNLIKELY(!_code))

Callers

nothing calls this directly

Calls 15

erroredFunction · 0.85
isLabelValidFunction · 0.85
alignFunction · 0.85
ctzFunction · 0.85
formatDataFunction · 0.85
ensureSpaceMethod · 0.80
cursorMethod · 0.80
advanceMethod · 0.80
doneMethod · 0.80
minItemSizeMethod · 0.80
archFunction · 0.70
alignmentMethod · 0.45

Tested by

no test coverage detected