mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Comment about MCJIT and caching pointers to entry functions
This commit is contained in:
parent
91cd37e98d
commit
c2699b32ee
1 changed files with 8 additions and 0 deletions
|
|
@ -111,6 +111,14 @@ namespace
|
||||||
{
|
{
|
||||||
ReturnCode runEntryFunc(ExecBundle const& _exec, Runtime* _runtime)
|
ReturnCode runEntryFunc(ExecBundle const& _exec, Runtime* _runtime)
|
||||||
{
|
{
|
||||||
|
// That function uses long jumps to handle "execeptions".
|
||||||
|
// Do not create any non-POD objects here
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
// Getting pointer to function seems to be cachable,
|
||||||
|
// but it looks like getPointerToFunction() method does something special
|
||||||
|
// to allow function to be executed.
|
||||||
|
// That might be related to memory manager. Can we share one?
|
||||||
typedef ReturnCode(*EntryFuncPtr)(Runtime*);
|
typedef ReturnCode(*EntryFuncPtr)(Runtime*);
|
||||||
auto entryFuncVoidPtr = _exec.engine->getPointerToFunction(_exec.entryFunc);
|
auto entryFuncVoidPtr = _exec.engine->getPointerToFunction(_exec.entryFunc);
|
||||||
auto entryFuncPtr = static_cast<EntryFuncPtr>(entryFuncVoidPtr);
|
auto entryFuncPtr = static_cast<EntryFuncPtr>(entryFuncVoidPtr);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue