some refactor

This commit is contained in:
blueloveTH 2024-05-03 19:51:41 +08:00
parent fd12deeec3
commit beec29d0c3
2 changed files with 13 additions and 11 deletions

View File

@ -166,18 +166,9 @@ public:
VM(bool enable_os=true); VM(bool enable_os=true);
void set_main_argv(int argc, char** argv); void set_main_argv(int argc, char** argv);
void __breakpoint(); void __breakpoint();
void __pop_frame();
void __pop_frame(){
s_data.reset(callstack.top()._sp_base);
callstack.pop();
#if PK_ENABLE_PROFILER
if(!_next_breakpoint.empty() && callstack.size()<_next_breakpoint.callstack_size){
_next_breakpoint = NextBreakpoint();
}
#endif
}
PyObject* py_str(PyObject* obj); PyObject* py_str(PyObject* obj);
PyObject* py_repr(PyObject* obj); PyObject* py_repr(PyObject* obj);

View File

@ -1513,6 +1513,17 @@ void NextBreakpoint::_step(VM* vm){
} }
#endif #endif
void VM::__pop_frame(){
s_data.reset(callstack.top()._sp_base);
callstack.pop();
#if PK_ENABLE_PROFILER
if(!_next_breakpoint.empty() && callstack.size()<_next_breakpoint.callstack_size){
_next_breakpoint = NextBreakpoint();
}
#endif
}
void VM::__breakpoint(){ void VM::__breakpoint(){
#if PK_ENABLE_PROFILER #if PK_ENABLE_PROFILER
_next_breakpoint = NextBreakpoint(); _next_breakpoint = NextBreakpoint();