From c2699b32eea1b9a826c056b66837d487f42ef934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 16 Dec 2014 18:40:19 +0100 Subject: [PATCH] Comment about MCJIT and caching pointers to entry functions --- libevmjit/ExecutionEngine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libevmjit/ExecutionEngine.cpp b/libevmjit/ExecutionEngine.cpp index fb3b878e23..cb4e16784a 100644 --- a/libevmjit/ExecutionEngine.cpp +++ b/libevmjit/ExecutionEngine.cpp @@ -111,6 +111,14 @@ namespace { 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*); auto entryFuncVoidPtr = _exec.engine->getPointerToFunction(_exec.entryFunc); auto entryFuncPtr = static_cast(entryFuncVoidPtr);