Added generic secure JIT support for RandomX.
This commit is contained in:
parent
f9c0933f05
commit
ec62ded279
19 changed files with 227 additions and 110 deletions
|
@ -1,5 +1,7 @@
|
|||
/*
|
||||
Copyright (c) 2018-2019, tevador <tevador@gmail.com>
|
||||
Copyright (c) 2018-2020, tevador <tevador@gmail.com>
|
||||
Copyright (c) 2019-2020, SChernykh <https://github.com/SChernykh>
|
||||
Copyright (c) 2019-2020, XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
@ -36,14 +38,33 @@ namespace randomx {
|
|||
void CompiledLightVm<softAes>::setCache(randomx_cache* cache) {
|
||||
cachePtr = cache;
|
||||
mem.memory = cache->memory;
|
||||
|
||||
# ifdef XMRIG_SECURE_JIT
|
||||
compiler.enableWriting();
|
||||
# endif
|
||||
|
||||
compiler.generateSuperscalarHash(cache->programs);
|
||||
|
||||
# ifdef XMRIG_SECURE_JIT
|
||||
compiler.enableExecution();
|
||||
# endif
|
||||
}
|
||||
|
||||
template<int softAes>
|
||||
void CompiledLightVm<softAes>::run(void* seed) {
|
||||
VmBase<softAes>::generateProgram(seed);
|
||||
randomx_vm::initialize();
|
||||
|
||||
# ifdef XMRIG_SECURE_JIT
|
||||
compiler.enableWriting();
|
||||
# endif
|
||||
|
||||
compiler.generateProgramLight(program, config, datasetOffset);
|
||||
|
||||
# ifdef XMRIG_SECURE_JIT
|
||||
compiler.enableExecution();
|
||||
# endif
|
||||
|
||||
CompiledVm<softAes>::execute();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue