The {instance,bytecodes,bclosure}.entry{,_fixed} fields were not always filled

This commit is contained in:
Juan Jose Garcia Ripoll 2009-02-15 16:25:01 +01:00
parent 85cf59cee6
commit 8697d90d4b
7 changed files with 24 additions and 11 deletions

View file

@ -212,6 +212,8 @@ ecl_alloc_instance(cl_index slots)
i = ecl_alloc_object(t_instance);
i->instance.slots = (cl_object *)ecl_alloc(sizeof(cl_object) * slots);
i->instance.length = slots;
i->instance.entry = FEnot_funcallable_vararg;
i->instance.entry_fixed = FEnot_funcallable_fixed;
return i;
}

View file

@ -176,6 +176,8 @@ asm_end(cl_index beginning) {
bytecodes->bytecodes.data[i] = CAR(ENV->constants);
ENV->constants = CDR(ENV->constants);
}
bytecodes->bytecodes.entry = _ecl_bytecodes_dispatch_vararg;
bytecodes->bytecodes.entry_fixed = FEnot_a_fixed_no_arguments;
asm_clear(beginning);
return bytecodes;
}

View file

@ -21,8 +21,8 @@
static cl_object generic_function_dispatch_vararg(cl_narg, ...);
static cl_object
not_funcallable_fixed()
cl_object
FEnot_funcallable_fixed()
{
cl_env_ptr env = ecl_process_env();
cl_object fun = env->function;
@ -30,10 +30,10 @@ not_funcallable_fixed()
@(return);
}
static cl_object
not_funcallable_vararg(cl_narg narg, ...)
cl_object
FEnot_funcallable_vararg(cl_narg narg, ...)
{
return not_funcallable_fixed();
return FEnot_funcallable_fixed();
}
static cl_object
@ -83,8 +83,8 @@ si_set_raw_funcallable(cl_object instance, cl_object function)
instance->instance.slots = slots;
instance->instance.length = length;
instance->instance.isgf = 0;
instance->instance.entry = not_funcallable_vararg;
instance->instance.entry_fixed = not_funcallable_fixed;
instance->instance.entry = FEnot_funcallable_vararg;
instance->instance.entry_fixed = FEnot_funcallable_fixed;
}
} else {
if (instance->instance.isgf == 0) {
@ -117,8 +117,8 @@ clos_set_funcallable_instance_function(cl_object x, cl_object function_or_t)
x->instance.entry_fixed = FEnot_a_fixed_no_arguments;
} else if (function_or_t == Cnil) {
x->instance.isgf = ECL_NOT_FUNCALLABLE;
x->instance.entry = not_funcallable_vararg;
x->instance.entry_fixed = not_funcallable_fixed;
x->instance.entry = FEnot_funcallable_vararg;
x->instance.entry_fixed = FEnot_funcallable_fixed;
} else if (Null(cl_functionp(function_or_t))) {
FEwrong_type_argument(@'function', function_or_t);
} else {

View file

@ -25,7 +25,7 @@ ecl_allocate_instance(cl_object clas, cl_index size)
CLASS_OF(x) = clas;
for (i = 0; i < size; i++)
x->instance.slots[i] = ECL_UNBOUND;
return(x);
return x;
}
cl_object

View file

@ -889,10 +889,15 @@ sharp_Y_reader(cl_object in, cl_object c, cl_object d)
for ( i=0, nth=CAR(x) ; !ecl_endp(nth) ; i++, nth=CDR(nth) )
((cl_object*)(rv->bytecodes.data))[i] = CAR(nth);
rv->bytecodes.entry = _ecl_bytecodes_dispatch_vararg;
rv->bytecodes.entry_fixed = FEnot_a_fixed_no_arguments;
if (lex != Cnil) {
cl_object x = ecl_alloc_object(t_bclosure);
x->bclosure.code = rv;
x->bclosure.lex = lex;
x->bclosure.entry = _ecl_bclosure_dispatch_vararg;
x->bclosure.entry_fixed = FEnot_a_fixed_no_arguments;
rv = x;
}
@(return rv);

View file

@ -19,7 +19,8 @@
;;; included in the compiled code. The default value is OFF.
(defconstant +init-env-form+
'((*compiler-in-use* t)
'((*gensym-counter* 0)
(*compiler-in-use* t)
(*compiler-phase* 't1)
(*callbacks* nil)
(*max-temp* 0)

View file

@ -179,6 +179,9 @@ extern void ecl_extend_hashtable(cl_object hashtable);
#define GFUN_SPEC(x) ((x)->instance.slots[1])
#define GFUN_COMB(x) ((x)->instance.slots[2])
extern cl_object FEnot_funcallable_fixed();
extern cl_object FEnot_funcallable_vararg();
/* package.d */
extern cl_object ecl_find_symbol_nolock(cl_object name, cl_object p, int *intern_flag);