Implement general tail call optimization

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
HyukWoo Park 2024-01-26 19:12:55 +09:00 committed by Patrick Kim
commit 023b7ea014
27 changed files with 368 additions and 89 deletions

View file

@ -31,6 +31,9 @@
#include "runtime/ReloadableString.h"
#include "intl/Intl.h"
#include "interpreter/ByteCode.h"
#if defined(ENABLE_TCO)
#include "interpreter/ByteCodeInterpreter.h"
#endif
#if defined(ENABLE_CODE_CACHE)
#include "codecache/CodeCache.h"
#endif
@ -398,7 +401,6 @@ VMInstance::VMInstance(const char* locale, const char* timezone, const char* bas
}
#endif
// add gc event callback
GCEventListenerSet& list = ThreadLocal::gcEventListenerSet();
list.ensureMarkStartListeners()->push_back(std::make_pair(vmMarkStartCallback, this));
@ -480,6 +482,12 @@ VMInstance::VMInstance(const char* locale, const char* timezone, const char* bas
m_jobQueue = new JobQueue();
#if defined(ENABLE_TCO)
if (!Interpreter::tcoBuffer) {
Interpreter::initTCOBuffer();
}
#endif
#if defined(ENABLE_CODE_CACHE)
if (UNLIKELY(!baseCacheDir || strlen(baseCacheDir) == 0)) {
const char* homeDir = getenv("HOME");