From abeae456b11678a86ce1857f2f8969fbb2e9da29 Mon Sep 17 00:00:00 2001 From: songzhengchao Date: Thu, 27 Jan 2022 10:31:58 +0800 Subject: [PATCH] writebarrier fastpath stub issue:https://gitee.com/openharmony/ark_js_runtime/issues/I4SC94 Signed-off-by: songzhengchao Change-Id: Ic14c2f88aa98288639b5f45f560eac84593707da --- runtime/mem/gc/bitmap.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/runtime/mem/gc/bitmap.h b/runtime/mem/gc/bitmap.h index a8e2378ebd..58299644d4 100644 --- a/runtime/mem/gc/bitmap.h +++ b/runtime/mem/gc/bitmap.h @@ -56,10 +56,21 @@ public: return bitmap_; } + static constexpr uint32_t GetBitMapOffset() + { + return MEMBER_OFFSET(Bitmap, bitmap_); + } + static const size_t BITSPERBYTE = 8; static const size_t BITSPERWORD = BITSPERBYTE * sizeof(BitmapWordType); + static const size_t BITSPERWORD_64 = BITSPERBYTE * sizeof(uint64_t); + static const size_t BITSPERWORD_32 = BITSPERBYTE * sizeof(uint32_t); static constexpr size_t LOG_BITSPERBYTE = panda::helpers::math::GetIntLog2(static_cast(BITSPERBYTE)); static constexpr size_t LOG_BITSPERWORD = panda::helpers::math::GetIntLog2(static_cast(BITSPERWORD)); + static constexpr size_t LOG_BITSPERWORD_64 = panda::helpers::math::GetIntLog2( + static_cast(BITSPERWORD_64)); + static constexpr size_t LOG_BITSPERWORD_32 = panda::helpers::math::GetIntLog2( + static_cast(BITSPERWORD_32)); protected: /** @@ -277,6 +288,7 @@ protected: NO_COPY_SEMANTIC(Bitmap); NO_MOVE_SEMANTIC(Bitmap); + private: Span bitmap_; size_t bitsize_ = 0; @@ -636,7 +648,11 @@ private: pointer_type begin_addr_ {0}; pointer_type end_addr_ {0}; }; - +#ifdef PANDA_TARGET_64 +static_assert(Bitmap::LOG_BITSPERWORD_64 == Bitmap::LOG_BITSPERWORD); +#else +static_assert(Bitmap::LOG_BITSPERWORD_32 == Bitmap::LOG_BITSPERWORD); +#endif using MarkBitmap = MemBitmap; } // namespace panda::mem -- Gitee