From 8c24fc1ba49a1623dbecbea82c9fef238f17c4ee Mon Sep 17 00:00:00 2001 From: letouzey Date: Tue, 2 Oct 2012 15:58:10 +0000 Subject: Remove some dead code in the vm Apparently Cysmtable.set_global_boxed is unused, and removing it allows to get rid of a bunch of C code concerning "boxed" things (including ACCUMULATECOND instruction). Still TODO: Csymtable.set_transparent_const and Csymtable.set_opaque_const appear to be no-ops. Should we remove them ? git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15845 85f007b7-540e-0410-9357-904b9bb8a0f7 --- kernel/byterun/coq_fix_code.c | 13 ++----------- kernel/byterun/coq_fix_code.h | 1 - kernel/byterun/coq_instruct.h | 2 +- kernel/byterun/coq_interp.c | 20 -------------------- kernel/byterun/coq_memory.c | 34 ---------------------------------- kernel/byterun/coq_memory.h | 3 --- 6 files changed, 3 insertions(+), 70 deletions(-) (limited to 'kernel/byterun') diff --git a/kernel/byterun/coq_fix_code.c b/kernel/byterun/coq_fix_code.c index 9a59a773f..3fded6638 100644 --- a/kernel/byterun/coq_fix_code.c +++ b/kernel/byterun/coq_fix_code.c @@ -55,7 +55,7 @@ void init_arity () { arity[PUSHOFFSETCLOSURE]=arity[GETGLOBAL]=arity[PUSHGETGLOBAL]= arity[MAKEBLOCK1]=arity[MAKEBLOCK2]=arity[MAKEBLOCK3]=arity[MAKEBLOCK4]= arity[MAKEACCU]=arity[CONSTINT]=arity[PUSHCONSTINT]=arity[GRABREC]= - arity[PUSHFIELDS]=arity[GETFIELD]=arity[SETFIELD]=arity[ACCUMULATECOND]= + arity[PUSHFIELDS]=arity[GETFIELD]=arity[SETFIELD]= arity[BRANCH]=arity[ISCONST]= 1; /* instruction with two operands */ arity[APPTERM]=arity[MAKEBLOCK]=arity[CLOSURE]= @@ -85,15 +85,6 @@ value coq_makeaccu (value i) { return (value)res; } -value coq_accucond (value i) { - code_t q; - code_t res = coq_stat_alloc(8); - q = res; - *q++ = VALINSTR(ACCUMULATECOND); - *q = (opcode_t)Int_val(i); - return (value)res; -} - value coq_pushpop (value i) { code_t res; int n; @@ -118,7 +109,7 @@ value coq_is_accumulate_code(value code){ code_t q; int res; q = (code_t)code; - res = Is_instruction(q,ACCUMULATECOND) || Is_instruction(q,ACCUMULATE); + res = Is_instruction(q,ACCUMULATE); return Val_bool(res); } diff --git a/kernel/byterun/coq_fix_code.h b/kernel/byterun/coq_fix_code.h index c1a4e0ae6..5c85389dd 100644 --- a/kernel/byterun/coq_fix_code.h +++ b/kernel/byterun/coq_fix_code.h @@ -29,7 +29,6 @@ void init_arity(); value coq_tcode_of_code(value code, value len); value coq_makeaccu (value i); value coq_pushpop (value i); -value coq_accucond (value i); value coq_is_accumulate_code(value code); #endif /* _COQ_FIX_CODE_ */ diff --git a/kernel/byterun/coq_instruct.h b/kernel/byterun/coq_instruct.h index d1136b2dc..9cbf4077e 100644 --- a/kernel/byterun/coq_instruct.h +++ b/kernel/byterun/coq_instruct.h @@ -38,7 +38,7 @@ enum instructions { SETFIELD0, SETFIELD1, SETFIELD, CONST0, CONST1, CONST2, CONST3, CONSTINT, PUSHCONST0, PUSHCONST1, PUSHCONST2, PUSHCONST3, PUSHCONSTINT, - ACCUMULATE, ACCUMULATECOND, + ACCUMULATE, MAKESWITCHBLOCK, MAKEACCU, MAKEPROD, /* spiwack: */ BRANCH, diff --git a/kernel/byterun/coq_interp.c b/kernel/byterun/coq_interp.c index 216919ae3..84bc08d2b 100644 --- a/kernel/byterun/coq_interp.c +++ b/kernel/byterun/coq_interp.c @@ -922,26 +922,6 @@ value coq_interprete } /* Special operations for reduction of open term */ - Instruct(ACCUMULATECOND) { - int i, num; - print_instr("ACCUMULATECOND"); - num = *pc; - pc++; - if (Field(coq_global_boxed, num) == Val_false || coq_all_transp) { - /* printf ("false\n"); - printf ("tag = %d", Tag_val(Field(accu,1))); */ - num = Wosize_val(coq_env); - for(i = 2; i < num; i++) *--sp = Field(accu,i); - coq_extra_args = coq_extra_args + (num - 2); - coq_env = Field(Field(accu,1),1); - pc = Code_val(coq_env); - accu = coq_env; - /* printf ("end\n"); */ - Next; - }; - /* printf ("true\n"); */ - } - Instruct(ACCUMULATE) { mlsize_t i, size; print_instr("ACCUMULATE"); diff --git a/kernel/byterun/coq_memory.c b/kernel/byterun/coq_memory.c index 00f5eb3b0..8d03829ab 100644 --- a/kernel/byterun/coq_memory.c +++ b/kernel/byterun/coq_memory.c @@ -26,7 +26,6 @@ asize_t coq_max_stack_size = Coq_max_stack_size; value coq_global_data; -value coq_global_boxed; int coq_all_transp; value coq_atom_tbl; @@ -62,7 +61,6 @@ static void coq_scan_roots(scanning_action action) register value * i; /* Scan the global variables */ (*action)(coq_global_data, &coq_global_data); - (*action)(coq_global_boxed, &coq_global_boxed); (*action)(coq_atom_tbl, &coq_atom_tbl); /* Scan the stack */ for (i = coq_sp; i < coq_stack_high; i++) { @@ -90,14 +88,6 @@ void init_coq_global_data(long requested_size) Field (coq_global_data, i) = Val_unit; } -void init_coq_global_boxed(long requested_size) -{ - int i; - coq_global_boxed = alloc_shr(requested_size, 0); - for (i = 0; i < requested_size; i++) - Field (coq_global_boxed, i) = Val_true; -} - void init_coq_atom_tbl(long requested_size){ int i; coq_atom_tbl = alloc_shr(requested_size, 0); @@ -125,7 +115,6 @@ value init_coq_vm(value unit) /* ML */ /* Allocate the table of global and the stack */ init_coq_stack(); init_coq_global_data(Coq_global_data_Size); - init_coq_global_boxed(40); init_coq_atom_tbl(40); /* Initialing the interpreter */ coq_all_transp = 0; @@ -181,11 +170,6 @@ value get_coq_atom_tbl(value unit) /* ML */ return coq_atom_tbl; } -value get_coq_global_boxed(value unit) /* ML */ -{ - return coq_global_boxed; -} - value realloc_coq_global_data(value size) /* ML */ { mlsize_t requested_size, actual_size, i; @@ -205,24 +189,6 @@ value realloc_coq_global_data(value size) /* ML */ return Val_unit; } -value realloc_coq_global_boxed(value size) /* ML */ -{ - mlsize_t requested_size, actual_size, i; - value new_global_boxed; - requested_size = Long_val(size); - actual_size = Wosize_val(coq_global_boxed); - if (requested_size >= actual_size) { - requested_size = (requested_size + 0x100) & 0xFFFFFF00; - new_global_boxed = alloc_shr(requested_size, 0); - for (i = 0; i < actual_size; i++) - initialize(&Field(new_global_boxed, i), Field(coq_global_boxed, i)); - for (i = actual_size; i < requested_size; i++) - Field (new_global_boxed, i) = Val_long (0); - coq_global_boxed = new_global_boxed; - } - return Val_unit; -} - value realloc_coq_atom_tbl(value size) /* ML */ { mlsize_t requested_size, actual_size, i; diff --git a/kernel/byterun/coq_memory.h b/kernel/byterun/coq_memory.h index 79e4d0fea..cec34f566 100644 --- a/kernel/byterun/coq_memory.h +++ b/kernel/byterun/coq_memory.h @@ -35,7 +35,6 @@ extern value * coq_stack_threshold; /* global_data */ extern value coq_global_data; -extern value coq_global_boxed; extern int coq_all_transp; extern value coq_atom_tbl; @@ -56,8 +55,6 @@ value re_init_coq_vm(value unit); /* ML */ void realloc_coq_stack(asize_t required_space); value get_coq_global_data(value unit); /* ML */ value realloc_coq_global_data(value size); /* ML */ -value get_coq_global_boxed(value unit); -value realloc_coq_global_boxed(value size); /* ML */ value get_coq_atom_tbl(value unit); /* ML */ value realloc_coq_atom_tbl(value size); /* ML */ value coq_set_transp_value(value transp); /* ML */ -- cgit v1.2.3