MCPcopy Create free account
hub / github.com/WheretIB/nullc / nullcLinkCode

Function nullcLinkCode

NULLC/nullc.cpp:327–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327nullres nullcLinkCode(const char *bytecode)
328{
329 using namespace NULLC;
330 NULLC_CHECK_INITIALIZED(false);
331
332#ifndef NULLC_NO_EXECUTOR
333 if(!linker->LinkCode(bytecode))
334 {
335 nullcLastError = linker->GetLinkError();
336 return false;
337 }
338 nullcLastError = linker->GetLinkError();
339#else
340 (void)bytecode;
341 nullcLastError = "No executor available, compile library without NULLC_NO_EXECUTOR";
342#endif
343#ifndef NULLC_NO_EXECUTOR
344 if(currExec == NULLC_VM)
345 executor->UpdateInstructionPointer();
346#endif
347 if(currExec == NULLC_X86)
348 {
349#ifdef NULLC_BUILD_X86_JIT
350 bool res = executorX86->TranslateToNative();
351 if(!res)
352 {
353 nullcLastError = executorX86->GetExecError();
354 }
355#else
356 nullcLastError = "X86 JIT isn't available";
357 return false;
358#endif
359 }
360#ifndef NULLC_NO_EXECUTOR
361 return true;
362#else
363 return false;
364#endif
365}
366
367nullres nullcBuild(const char* code)
368{

Callers 5

nullcBuildFunction · 0.85
OverrideFunction · 0.85
RunCodeMethod · 0.85
RunInterfaceTestsFunction · 0.85
SpeedTestTextFunction · 0.85

Calls 5

LinkCodeMethod · 0.80
GetLinkErrorMethod · 0.80
TranslateToNativeMethod · 0.80
GetExecErrorMethod · 0.45

Tested by 3

RunCodeMethod · 0.68
RunInterfaceTestsFunction · 0.68
SpeedTestTextFunction · 0.68