stage1 大量重构
This commit is contained in:
1 parent
e4347cc3ea
commit
2a84b61e3d
18 files changed
+1831
-1354
No files matched your search
+3
-3
@@ -555,8 +555,8 @@ void spl_vm_init_ex(spl_vm_t *vm, int stack_size, int call_depth) {
|
||||
#endif
|
||||
if (!vm)
|
||||
return;
|
||||
vm->config.max_stack_depth = stack_size > 0 ? stack_size : 1024 * 1024 * 8;
|
||||
vm->config.max_call_depth = call_depth > 0 ? call_depth : 128;
|
||||
vm->config.max_stack_depth = stack_size > 0 ? stack_size : 1024 * 1024 * 64;
|
||||
vm->config.max_call_depth = call_depth > 0 ? call_depth : 65536;
|
||||
|
||||
vec_init(vm->stacks);
|
||||
vec_realloc(vm->stacks, (usize)vm->config.max_stack_depth);
|
||||
@@ -699,7 +699,7 @@ void spl_vm_set_debug(spl_vm_t *vm, int enabled) {
|
||||
|
||||
static inline int spl_vm_call(spl_vm_t *vm, spl_vm_val_t addr, spl_vm_val_t nargs) {
|
||||
if (vm->cp >= vm->config.max_call_depth)
|
||||
VM_ERROR("CALLI: call stack overflow");
|
||||
VM_ERROR("call depth exceeded");
|
||||
// spl_vm_stackdump(vm, vm->sp);
|
||||
PUSH(SPL_STACK_CANARY);
|
||||
/* Shift args right by 1 to create gap for canary at fp-1 */
|
||||
|
||||
Reference in new issue
Block a user