From bdd03a27c22dcd95fa7b375e4a0d1cf7ca9508bb Mon Sep 17 00:00:00 2001 From: HyukWoo Park Date: Thu, 4 Jun 2020 12:35:52 +0900 Subject: [PATCH] Fix memory tracing error in AsyncGeneratorObject * fix to trace ExecutionPauser and AsyncGeneratorQueue vector members correctly Signed-off-by: HyukWoo Park --- src/runtime/AsyncGeneratorObject.h | 4 ++++ src/runtime/ExecutionPauser.cpp | 2 +- src/runtime/ExecutionPauser.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runtime/AsyncGeneratorObject.h b/src/runtime/AsyncGeneratorObject.h index eaeaa15df..5dfd96c96 100644 --- a/src/runtime/AsyncGeneratorObject.h +++ b/src/runtime/AsyncGeneratorObject.h @@ -90,6 +90,10 @@ class AsyncGeneratorObject : public Object { GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_registerFile)); GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_byteCodeBlock)); GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_resumeValue)); + GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_promiseCapability.m_promise)); + GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_promiseCapability.m_resolveFunction)); + GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_executionPauser.m_promiseCapability.m_rejectFunction)); + GC_set_bit(desc, GC_WORD_OFFSET(AsyncGeneratorObject, m_asyncGeneratorQueue)); } friend Value asyncGeneratorEnqueue(ExecutionState& state, const Value& generator, AsyncGeneratorObject::AsyncGeneratorEnqueueType type, const Value& value); diff --git a/src/runtime/ExecutionPauser.cpp b/src/runtime/ExecutionPauser.cpp index 322ff874d..3857ac921 100644 --- a/src/runtime/ExecutionPauser.cpp +++ b/src/runtime/ExecutionPauser.cpp @@ -48,8 +48,8 @@ void* ExecutionPauser::operator new(size_t size) GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_byteCodeBlock)); GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_resumeValue)); GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_promiseCapability.m_promise)); - GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_promiseCapability.m_rejectFunction)); GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_promiseCapability.m_resolveFunction)); + GC_set_bit(desc, GC_WORD_OFFSET(ExecutionPauser, m_promiseCapability.m_rejectFunction)); descr = GC_make_descriptor(desc, GC_WORD_LEN(ExecutionPauser)); typeInited = true; } diff --git a/src/runtime/ExecutionPauser.h b/src/runtime/ExecutionPauser.h index 2b613a7ab..e52d35323 100644 --- a/src/runtime/ExecutionPauser.h +++ b/src/runtime/ExecutionPauser.h @@ -67,8 +67,8 @@ class ExecutionPauser : public gc { m_byteCodeBlock = nullptr; m_resumeValue = SmallValue(); m_promiseCapability.m_promise = nullptr; - m_promiseCapability.m_rejectFunction = nullptr; m_promiseCapability.m_resolveFunction = nullptr; + m_promiseCapability.m_rejectFunction = nullptr; } enum StartFrom {