Skip to content

Commit

Permalink
remove code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawSumma committed May 15, 2024
1 parent 67b1c51 commit 60b2160
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 48 deletions.
4 changes: 0 additions & 4 deletions main/test/ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ int main(int argc, char **argv) {
"huge.fib",
vm_main_test_huge_fib
);
// vm_test(
// "table.env",
// vm_main_test_table_env
// );
vm_test(
"table.load.basic",
vm_main_test_table_load_basic
Expand Down
2 changes: 0 additions & 2 deletions vm/backend/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ void *vm_cache_comp(const char *comp, const char *flags, const char *src, const
void *handle = LoadLibrary(so_file);
void *sym = GetProcAddress(handle, entry);
remove(so_file);
// printf("<funcptr: %p>\n", sym);
return sym;
}
#else
Expand Down Expand Up @@ -107,7 +106,6 @@ void *vm_cache_comp(const char *comp, const char *flags, const char *src, const
void *handle = dlopen(so_file, RTLD_LAZY);
void *sym = dlsym(handle, entry);
remove(so_file);
// printf("<funcptr: %p>\n", sym);
return sym;
}
#endif
Expand Down
4 changes: 0 additions & 4 deletions vm/backend/tb.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ vm_std_value_t vm_tb_run_repl(vm_config_t *config, vm_block_t *entry, vm_blocks_

for (size_t i = 0; i < blocks->len; i++) {
vm_block_t *block = blocks->blocks[i];
// for (size_t j = 0; j < block->cache.len; j++) {
// vm_rblock_reset(block->cache.keys[j]);
// vm_free_block_sub(block->cache.values[j]);
// }
block->cache.len = 0;
}

Expand Down
26 changes: 0 additions & 26 deletions vm/backend/tb_dyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,6 @@ TB_Node *vm_tb_dyn_block(vm_tb_dyn_state_t *state, vm_block_t *block) {
TB_Node *is_number1 = tb_inst_region(state->func);
TB_Node *is_number2 = tb_inst_region(state->func);
TB_Node *is_error = tb_inst_region(state->func);
// tb_inst_set_region_name(state->func, is_number1, -1, "br_arg1_num");
// tb_inst_set_region_name(state->func, is_number2, -1, "br_arg2_num");
// tb_inst_set_region_name(state->func, is_error, -1, "is_error");

vm_tb_dyn_pair_t arg1 = vm_tb_dyn_arg(state, branch.args[0]);
vm_tb_dyn_pair_t arg2 = vm_tb_dyn_arg(state, branch.args[1]);
Expand Down Expand Up @@ -894,13 +891,6 @@ TB_Node *vm_tb_dyn_block(vm_tb_dyn_state_t *state, vm_block_t *block) {
{
tb_inst_set_control(state->func, is_closure);

// TB_PrototypeParam *call_proto_params = vm_malloc(sizeof(TB_PrototypeParam) * num_args);

// for (size_t arg = 0; branch.args[arg].type != VM_ARG_NONE; arg++) {
// call_proto_params[arg * 2 + 0] = (TB_PrototypeParam){VM_TB_TYPE_VALUE};
// call_proto_params[arg * 2 + 1] = (TB_PrototypeParam){VM_TB_TYPE_TAG};
// }

TB_PrototypeParam call_proto_params[1] = {
{TB_TYPE_PTR},
};
Expand Down Expand Up @@ -1023,16 +1013,6 @@ void vm_tb_dyn_func(vm_tb_dyn_state_t *state, TB_Function *xfunc, vm_block_t *en
state->regs = vm_malloc(sizeof(vm_tb_dyn_pair_t) * entry->nregs);

for (size_t i = 0; i < entry->nregs; i++) {
// TB_Node *ptr = tb_inst_local(state->func, sizeof(vm_std_value_t *), 4);
// TB_Node *local = tb_inst_member_access(state->func, locals, sizeof(vm_std_value_t) * i);
// tb_inst_store(
// state->func,
// TB_TYPE_PTR,
// ptr,
// local,
// 4,
// false
// );
state->regs[i] = (vm_tb_dyn_pair_t) {
.tag = tb_inst_local(state->func, sizeof(vm_tag_t), 1),
.val = tb_inst_local(state->func, sizeof(vm_value_t), 4),
Expand Down Expand Up @@ -1106,12 +1086,6 @@ void vm_tb_dyn_func(vm_tb_dyn_state_t *state, TB_Function *xfunc, vm_block_t *en
tb_inst_set_control(state->func, compiled_start);

tb_inst_goto(state->func, compiled_first);

// TB_Node *returns[2] = {
// tb_inst_uint(state->func, VM_TB_TYPE_VALUE, 0),
// tb_inst_uint(state->func, TB_TYPE_PTR, (uint64_t) (size_t) VM_TAG_NIL),
// };
// tb_inst_ret(state->func, num_returns, returns);
}

vm_tb_dyn_func_t *vm_tb_dyn_comp(vm_tb_dyn_state_t *state, vm_block_t *entry) {
Expand Down
1 change: 0 additions & 1 deletion vm/backend/tb_ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,6 @@ static void *vm_tb_ver_rfunc_comp(vm_rblock_t *rblock) {
}

static void vm_tb_ver_rblock_del(vm_rblock_t *rblock) {
// TB_JIT *jit = rblock->jit;
}

static void *vm_tb_ver_full_comp(vm_tb_ver_state_t *state, vm_block_t *block) {
Expand Down
11 changes: 0 additions & 11 deletions vm/std/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,16 +240,6 @@ void vm_io_debug(vm_io_buffer_t *out, size_t indent, const char *prefix, vm_std_
}
break;
}
// case VM_TAG_I64: {
// vm_std_value_t val = (vm_std_value_t){
// .tag = p.val_tag,
// .value = p.val_val,
// };
// char buf[64];
// snprintf(buf, 63, "%" PRIi64 " = ", p.key_val.i64);
// vm_io_debug(out, indent + 1, buf, val, &next);
// break;
// }
case VM_TAG_I8: {
vm_std_value_t val = (vm_std_value_t){
.tag = p.val_tag,
Expand Down Expand Up @@ -341,7 +331,6 @@ void vm_io_debug(vm_io_buffer_t *out, size_t indent, const char *prefix, vm_std_
default: {
vm_indent(out, indent, prefix);
vm_io_buffer_format(out, "<0x%zx: %p>\n", (size_t)vm_type_tag(value.tag), value.value.all);
// __builtin_trap();
break;
}
}
Expand Down

0 comments on commit 60b2160

Please sign in to comment.