Skip to content

Commit

Permalink
Change some store_ptr and _store_ptr use in VMMethod
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Jul 19, 2024
1 parent 525725c commit 431f159
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/vmobjects/VMMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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]);
}
}
}

Expand Down

0 comments on commit 431f159

Please sign in to comment.