| 325 | } |
| 326 | |
| 327 | nullres 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 | |
| 367 | nullres nullcBuild(const char* code) |
| 368 | { |