Jelajahi Sumber

some refactor

blueloveTH 1 tahun lalu
induk
melakukan
beec29d0c3
2 mengubah file dengan 13 tambahan dan 11 penghapusan
  1. 2 11
      include/pocketpy/vm.h
  2. 11 0
      src/vm.cpp

+ 2 - 11
include/pocketpy/vm.h

@@ -166,18 +166,9 @@ public:
     VM(bool enable_os=true);
 
     void set_main_argv(int argc, char** argv);
+    
     void __breakpoint();
-
-    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
-    }
+    void __pop_frame();
 
     PyObject* py_str(PyObject* obj);
     PyObject* py_repr(PyObject* obj);

+ 11 - 0
src/vm.cpp

@@ -1513,6 +1513,17 @@ void NextBreakpoint::_step(VM* vm){
 }
 #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(){
 #if PK_ENABLE_PROFILER
     _next_breakpoint = NextBreakpoint();