mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
backup
This commit is contained in:
parent
330e005881
commit
45842638b3
@ -62,8 +62,6 @@ int Frame__dellocal(Frame* self, py_Name name) PY_RAISE;
|
|||||||
py_Ref Frame__getclosure(Frame* self, py_Name name);
|
py_Ref Frame__getclosure(Frame* self, py_Name name);
|
||||||
py_StackRef Frame__getlocal_noproxy(Frame* self, py_Name name);
|
py_StackRef Frame__getlocal_noproxy(Frame* self, py_Name name);
|
||||||
|
|
||||||
py_StackRef Frame__locals_sp(Frame* self);
|
|
||||||
|
|
||||||
int Frame__prepare_jump_exception_handler(Frame* self, ValueStack*);
|
int Frame__prepare_jump_exception_handler(Frame* self, ValueStack*);
|
||||||
|
|
||||||
UnwindTarget* Frame__find_unwind_target(Frame* self, int iblock);
|
UnwindTarget* Frame__find_unwind_target(Frame* self, int iblock);
|
||||||
|
@ -80,10 +80,6 @@ void Frame__delete(Frame* self) {
|
|||||||
FixedMemoryPool__dealloc(&pk_current_vm->pool_frame, self);
|
FixedMemoryPool__dealloc(&pk_current_vm->pool_frame, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
py_StackRef Frame__locals_sp(Frame* self) {
|
|
||||||
return !self->is_locals_special ? self->locals : self->p0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Frame__prepare_jump_exception_handler(Frame* self, ValueStack* _s) {
|
int Frame__prepare_jump_exception_handler(Frame* self, ValueStack* _s) {
|
||||||
// try to find a parent try block
|
// try to find a parent try block
|
||||||
int iblock = Frame__iblock(self);
|
int iblock = Frame__iblock(self);
|
||||||
@ -94,7 +90,7 @@ int Frame__prepare_jump_exception_handler(Frame* self, ValueStack* _s) {
|
|||||||
}
|
}
|
||||||
if(iblock < 0) return -1;
|
if(iblock < 0) return -1;
|
||||||
UnwindTarget* uw = Frame__find_unwind_target(self, iblock);
|
UnwindTarget* uw = Frame__find_unwind_target(self, iblock);
|
||||||
_s->sp = (Frame__locals_sp(self) + uw->offset); // unwind the stack
|
_s->sp = (self->p0 + uw->offset); // unwind the stack
|
||||||
return c11__at(CodeBlock, &self->co->blocks, iblock)->end;
|
return c11__at(CodeBlock, &self->co->blocks, iblock)->end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,10 +106,10 @@ void Frame__set_unwind_target(Frame* self, py_TValue* sp) {
|
|||||||
int iblock = Frame__iblock(self);
|
int iblock = Frame__iblock(self);
|
||||||
UnwindTarget* existing = Frame__find_unwind_target(self, iblock);
|
UnwindTarget* existing = Frame__find_unwind_target(self, iblock);
|
||||||
if(existing) {
|
if(existing) {
|
||||||
existing->offset = sp - Frame__locals_sp(self);
|
existing->offset = sp - self->p0;
|
||||||
} else {
|
} else {
|
||||||
UnwindTarget* prev = self->uw_list;
|
UnwindTarget* prev = self->uw_list;
|
||||||
self->uw_list = UnwindTarget__new(prev, iblock, sp - Frame__locals_sp(self));
|
self->uw_list = UnwindTarget__new(prev, iblock, sp - self->p0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user