From 431f159b728bdc6fba46a07af92a489e8ed4d55d Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Fri, 19 Jul 2024 23:20:40 +0100 Subject: [PATCH] Change some store_ptr and _store_ptr use in VMMethod Signed-off-by: Stefan Marr --- src/vmobjects/VMMethod.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/vmobjects/VMMethod.cpp b/src/vmobjects/VMMethod.cpp index 083a2ae7..1c8148c9 100644 --- a/src/vmobjects/VMMethod.cpp +++ b/src/vmobjects/VMMethod.cpp @@ -52,11 +52,11 @@ VMMethod::VMMethod(long bcCount, long numberOfConstants) : #ifdef UNSAFE_FRAME_OPTIMIZATION cachedFrame = nullptr; #endif - bcLength = _store_ptr(NEW_INT(bcCount)); - numberOfLocals = _store_ptr(NEW_INT(0)); - maximumNumberOfStackElements = _store_ptr(NEW_INT(0)); - numberOfArguments = _store_ptr(NEW_INT(0)); - this->numberOfConstants = _store_ptr(NEW_INT(numberOfConstants)); + store_ptr(bcLength, NEW_INT(bcCount)); + store_ptr(numberOfLocals, NEW_INT(0)); + store_ptr(maximumNumberOfStackElements, NEW_INT(0)); + store_ptr(numberOfArguments, NEW_INT(0)); + store_ptr(this->numberOfConstants, NEW_INT(numberOfConstants)); indexableFields = (gc_oop_t*)(&indexableFields + 2); for (long i = 0; i < numberOfConstants; ++i) { @@ -95,8 +95,9 @@ void VMMethod::WalkObjects(walk_heap_fn walk) { long numIndexableFields = GetNumberOfIndexableFields(); for (long i = 0; i < numIndexableFields; ++i) { - if (GetIndexableField(i) != nullptr) - indexableFields[i] = walk(_store_ptr(GetIndexableField(i))); + if (indexableFields[i] != nullptr) { + indexableFields[i] = walk(indexableFields[i]); + } } }