Apply cpp naming to files
This commit is contained in:
parent
430ba869d0
commit
9a9262f6d0
73 changed files with 160 additions and 160 deletions
34
Objects/private/interpreter/CallStack.cpp
Normal file
34
Objects/private/interpreter/CallStack.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
#include "interpreter/CallStack.hpp"
|
||||
|
||||
#include "interpreter/ByteCode.hpp"
|
||||
#include "primitives/MethodObject.hpp"
|
||||
|
||||
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(); }
|
||||
Loading…
Add table
Add a link
Reference in a new issue