Skip to content

Commit 5554b3f

Browse files
committed
feat: Implement the core virtual machine with stack management, runtime error handling, and comprehensive bytecode instruction execution.
1 parent c9d848c commit 5554b3f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/runtime/vm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static void concatenate(VM* pvm) {
125125

126126

127127
static InterpretResult run(VM* vm) {
128-
printf("DEBUG: Entering run()\n");
128+
// printf("DEBUG: Entering run()\n");
129129
CallFrame* frame = &vm->frames[vm->frameCount - 1];
130130

131131
#define READ_BYTE() (*frame->ip++)
@@ -1146,11 +1146,11 @@ InterpretResult interpretAST(VM* pvm, StmtList* statements) {
11461146
return INTERPRET_COMPILE_ERROR;
11471147
}
11481148

1149-
printf("DEBUG: Generated bytecode. Function: %p\n", function);
1149+
// printf("DEBUG: Generated bytecode. Function: %p\n", function);
11501150
if (function->chunk.code == NULL) {
1151-
printf("DEBUG: Chunk code is NULL!\n");
1151+
// printf("DEBUG: Chunk code is NULL!\n");
11521152
} else {
1153-
printf("DEBUG: Chunk code size: %d\n", function->chunk.count);
1153+
// printf("DEBUG: Chunk code size: %d\n", function->chunk.count);
11541154
}
11551155

11561156

@@ -1168,9 +1168,9 @@ InterpretResult interpretAST(VM* pvm, StmtList* statements) {
11681168
frame->ip = function->chunk.code;
11691169
frame->slots = pvm->stack;
11701170

1171-
printf("DEBUG: Starting execution...\n");
1171+
// printf("DEBUG: Starting execution...\n");
11721172
InterpretResult result = run(pvm);
1173-
printf("DEBUG: Execution finished with result: %d\n", result);
1173+
// printf("DEBUG: Execution finished with result: %d\n", result);
11741174

11751175
return result;
11761176
}

0 commit comments

Comments
 (0)