Add ThreadLocal structure

* ThreadLocal manage global values allocated for each thread
* Update PlatformRef to allow users to add thread-local custom data

Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
This commit is contained in:
HyukWoo Park 2021-07-26 15:39:57 +09:00 committed by Boram Bae
commit 13c774e49f
20 changed files with 420 additions and 275 deletions

View file

@ -27,7 +27,7 @@
#include "parser/CodeBlock.h"
#include "interpreter/ByteCode.h"
#include "runtime/Context.h"
#include "runtime/VMInstance.h"
#include "runtime/ThreadLocal.h"
#include "runtime/ObjectStructurePropertyName.h"
namespace Escargot {
@ -867,7 +867,7 @@ ByteCodeBlock* CodeCacheReader::loadByteCodeBlock(Context* context, InterpretedC
size = m_buffer.get<size_t>();
bigIntData.resizeWithUninitializedValues(size);
for (size_t i = 0; i < size; i++) {
bigIntData[i] = new BigInt(m_buffer.getBF(VMInstance::bfContext()));
bigIntData[i] = new BigInt(m_buffer.getBF(ThreadLocal::bfContext()));
}
// ByteCodeBlock::m_code bytecode stream