mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 12:00:18 +00:00
some fix
This commit is contained in:
parent
9837ef8354
commit
aa8360cc22
@ -29,6 +29,7 @@ namespace pkpy{
|
|||||||
|
|
||||||
typedef PyObject* (*BinaryFuncC)(VM*, PyObject*, PyObject*);
|
typedef PyObject* (*BinaryFuncC)(VM*, PyObject*, PyObject*);
|
||||||
|
|
||||||
|
#if PK_ENABLE_PROFILER
|
||||||
struct NextBreakpoint{
|
struct NextBreakpoint{
|
||||||
int callstack_size;
|
int callstack_size;
|
||||||
int lineno;
|
int lineno;
|
||||||
@ -38,6 +39,7 @@ struct NextBreakpoint{
|
|||||||
void _step(VM* vm);
|
void _step(VM* vm);
|
||||||
bool empty() const { return callstack_size == 0; }
|
bool empty() const { return callstack_size == 0; }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
struct PyTypeInfo{
|
struct PyTypeInfo{
|
||||||
PyObject* obj; // never be garbage collected
|
PyObject* obj; // never be garbage collected
|
||||||
|
@ -598,7 +598,7 @@ Str VM::disassemble(CodeObject_ co){
|
|||||||
|
|
||||||
pod_vector<int> jumpTargets;
|
pod_vector<int> jumpTargets;
|
||||||
for(auto byte : co->codes){
|
for(auto byte : co->codes){
|
||||||
if(byte.op == OP_JUMP_ABSOLUTE || byte.op == OP_POP_JUMP_IF_FALSE || byte.op == OP_SHORTCUT_IF_FALSE_OR_POP){
|
if(byte.op == OP_JUMP_ABSOLUTE || byte.op == OP_POP_JUMP_IF_FALSE || byte.op == OP_SHORTCUT_IF_FALSE_OR_POP || byte.op == OP_LOOP_CONTINUE){
|
||||||
jumpTargets.push_back(byte.arg);
|
jumpTargets.push_back(byte.arg);
|
||||||
}
|
}
|
||||||
if(byte.op == OP_GOTO){
|
if(byte.op == OP_GOTO){
|
||||||
@ -1419,6 +1419,7 @@ void NativeFunc::check_size(VM* vm, ArgsView args) const{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if PK_ENABLE_PROFILER
|
||||||
void NextBreakpoint::_step(VM* vm){
|
void NextBreakpoint::_step(VM* vm){
|
||||||
int curr_callstack_size = vm->callstack.size();
|
int curr_callstack_size = vm->callstack.size();
|
||||||
int curr_lineno = vm->top_frame()->curr_lineno();
|
int curr_lineno = vm->top_frame()->curr_lineno();
|
||||||
@ -1435,6 +1436,7 @@ void NextBreakpoint::_step(VM* vm){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void VM::_breakpoint(){
|
void VM::_breakpoint(){
|
||||||
#if PK_ENABLE_PROFILER
|
#if PK_ENABLE_PROFILER
|
||||||
|
Loading…
x
Reference in New Issue
Block a user