diff --git a/src/runtime/Context.cpp b/src/runtime/Context.cpp index 7dbb5bd1e..94c03de47 100644 --- a/src/runtime/Context.cpp +++ b/src/runtime/Context.cpp @@ -79,7 +79,7 @@ Context::Context(VMInstance* instance) , m_defaultStructureForMappedArgumentsObject(instance->m_defaultStructureForMappedArgumentsObject) , m_defaultStructureForUnmappedArgumentsObject(instance->m_defaultStructureForUnmappedArgumentsObject) , m_defaultPrivateMemberStructure(instance->m_defaultPrivateMemberStructure) - , m_toStringRecursionPreventer(&instance->m_toStringRecursionPreventer) + , m_toStringRecursionPreventer(instance->m_toStringRecursionPreventer) , m_virtualIdentifierCallback(nullptr) , m_securityPolicyCheckCallback(nullptr) , m_virtualIdentifierCallbackPublic(nullptr) diff --git a/src/runtime/VMInstance.cpp b/src/runtime/VMInstance.cpp index 97c70b389..70607c05e 100644 --- a/src/runtime/VMInstance.cpp +++ b/src/runtime/VMInstance.cpp @@ -178,7 +178,7 @@ void* VMInstance::operator new(size_t size) GC_set_bit(desc, GC_WORD_OFFSET(VMInstance, m_defaultPrivateMemberStructure)); markHashSet(desc, GC_WORD_OFFSET(VMInstance, m_rootedObjectStructure)); GC_set_bit(desc, GC_WORD_OFFSET(VMInstance, m_onVMInstanceDestroyData)); - GC_set_bit(desc, GC_WORD_OFFSET(VMInstance, m_toStringRecursionPreventer.m_registeredItems)); + GC_set_bit(desc, GC_WORD_OFFSET(VMInstance, m_toStringRecursionPreventer)); GC_set_bit(desc, GC_WORD_OFFSET(VMInstance, m_regexpCache)); GC_set_bit(desc, GC_WORD_OFFSET(VMInstance, m_regexpOptionStringCache)); GC_set_bit(desc, GC_WORD_OFFSET(VMInstance, m_cachedUTC)); @@ -351,7 +351,17 @@ VMInstance::VMInstance(const char* locale, const char* timezone, const char* bas , m_promiseHookPublic(nullptr) , m_promiseRejectCallback(nullptr) , m_promiseRejectCallbackPublic(nullptr) + , m_toStringRecursionPreventer(nullptr) + , m_regexpCache(nullptr) + , m_regexpOptionStringCache(nullptr) +#ifdef ENABLE_ICU + , m_calendar(nullptr) +#endif , m_cachedUTC(nullptr) + , m_jobQueue(nullptr) +#if defined(ENABLE_CODE_CACHE) + , m_codeCache(nullptr) +#endif { GC_REGISTER_FINALIZER_NO_ORDER(this, [](void* obj, void*) { VMInstance* self = (VMInstance*)obj; @@ -365,6 +375,8 @@ VMInstance::VMInstance(const char* locale, const char* timezone, const char* bas } m_staticStrings.initStaticStrings(); + m_toStringRecursionPreventer = new ToStringRecursionPreventer(); + m_regexpCache = new (GC) RegExpCacheMap(); m_regexpOptionStringCache = (ASCIIString**)GC_MALLOC(64 * sizeof(ASCIIString*)); memset(m_regexpOptionStringCache, 0, 64 * sizeof(ASCIIString*)); diff --git a/src/runtime/VMInstance.h b/src/runtime/VMInstance.h index 8df648e96..13caf9835 100644 --- a/src/runtime/VMInstance.h +++ b/src/runtime/VMInstance.h @@ -178,11 +178,6 @@ class VMInstance : public gc { void somePrototypeObjectDefineIndexedProperty(ExecutionState& state); - ToStringRecursionPreventer& toStringRecursionPreventer() - { - return m_toStringRecursionPreventer; - } - JobQueue* jobQueue() { return m_jobQueue; @@ -463,7 +458,7 @@ class VMInstance : public gc { PromiseRejectCallback m_promiseRejectCallback; void* m_promiseRejectCallbackPublic; - ToStringRecursionPreventer m_toStringRecursionPreventer; + ToStringRecursionPreventer* m_toStringRecursionPreventer; // regexp object data RegExpCacheMap* m_regexpCache; diff --git a/test/vendortest b/test/vendortest index 311dd115e..dab636534 160000 --- a/test/vendortest +++ b/test/vendortest @@ -1 +1 @@ -Subproject commit 311dd115e4d25d0f985cc9666340995fae32bafd +Subproject commit dab6365343219e88a11f0aebb5c3b4f6bb8551bd