Apply formating to all files. CLeanup

This commit is contained in:
IlyaShurupov 2023-10-22 17:07:28 +03:00 committed by Ilya Shurupov
parent b4ae5dde77
commit 91fb72bd49
928 changed files with 14515 additions and 21479 deletions

View file

@ -1,40 +1,36 @@
#include "NewPlacement.hpp"
#include "interpreter/callstack.h"
#include "interpreter/bytecode.h"
#include "primitives/methodobject.h"
using namespace obj;
void CallStack::enter(const CallStack::CallFrame& frame) {
if (mStack.size()) {
auto& last_frame = mStack.last();
last_frame.mIp = last_frame.mMethod->mScript->mBytecode.mInstructionIdx;
}
frame.mMethod->mScript->mBytecode.mArgumentsLoaded = 0;
frame.mMethod->mScript->mBytecode.mInstructionIdx = 0;
obj::NDO->refinc(frame.mMethod);
mStack.append(frame);
}
void CallStack::leave() {
auto frame = mStack.last();
obj::NDO->destroy(frame.mMethod);
mStack.pop();
if (mStack.size()) {
auto& last_frame = mStack.last();
last_frame.mMethod->mScript->mBytecode.mInstructionIdx = last_frame.mIp;
}
}
ByteCode* CallStack::getBytecode() {
return &mStack.last().mMethod->mScript->mBytecode;
}
tp::halni CallStack::len() const {
return mStack.size();
}
#include "NewPlacement.hpp"
#include "interpreter/callstack.h"
#include "interpreter/bytecode.h"
#include "primitives/methodobject.h"
using namespace obj;
void CallStack::enter(const CallStack::CallFrame& frame) {
if (mStack.size()) {
auto& last_frame = mStack.last();
last_frame.mIp = last_frame.mMethod->mScript->mBytecode.mInstructionIdx;
}
frame.mMethod->mScript->mBytecode.mArgumentsLoaded = 0;
frame.mMethod->mScript->mBytecode.mInstructionIdx = 0;
obj::NDO->refinc(frame.mMethod);
mStack.append(frame);
}
void CallStack::leave() {
auto frame = mStack.last();
obj::NDO->destroy(frame.mMethod);
mStack.pop();
if (mStack.size()) {
auto& last_frame = mStack.last();
last_frame.mMethod->mScript->mBytecode.mInstructionIdx = last_frame.mIp;
}
}
ByteCode* CallStack::getBytecode() { return &mStack.last().mMethod->mScript->mBytecode; }
tp::halni CallStack::len() const { return mStack.size(); }