mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2025-12-06 02:40:26 -08:00
core: define protect and dummy tags as constants
Both tags have a special meaning to the low-level runtime (most notably the frame stack). Extracting them from "all symbols" is a step towards multiple runtimes.
This commit is contained in:
parent
9314e8b192
commit
a7f71259ed
5 changed files with 50 additions and 23 deletions
|
|
@ -71,6 +71,14 @@ ecl_def_ct_long_float(ecl_ct_longfloat_minus_zero,-0.0l,,const);
|
|||
ecl_def_ct_ratio(ecl_ct_plus_half,ecl_make_fixnum(1),ecl_make_fixnum(2),,const);
|
||||
ecl_def_ct_ratio(ecl_ct_minus_half,ecl_make_fixnum(-1),ecl_make_fixnum(2),,const);
|
||||
|
||||
/* These two tags have a special meaning for the frame stack. */
|
||||
|
||||
ecl_def_ct_base_string(ecl_ct_ptag_string,"PROTECT-TAG",11,static,const);
|
||||
ecl_def_ct_base_string(ecl_ct_dtag_string,"DUMMY-TAG",9,static,const);
|
||||
|
||||
ecl_def_ct_token(ecl_ct_protect_tag,ecl_stp_constant,ecl_ct_ptag_string,ECL_NIL,,const);
|
||||
ecl_def_ct_token(ecl_ct_dummy_tag ,ecl_stp_constant,ecl_ct_dtag_string,ECL_NIL,,const);
|
||||
|
||||
/************************ GLOBAL INITIALIZATION ***********************/
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -104,8 +104,6 @@ cl_symbols[] = {
|
|||
{"NIL" ECL_FUN(NULL, NULL, -1) ECL_VAR(CL_ORDINARY, OBJNULL)},
|
||||
{"T" ECL_FUN(NULL, NULL, -1) ECL_VAR(CL_ORDINARY, OBJNULL)},
|
||||
{SYS_ "UNBOUND" ECL_FUN("si_unbound", si_unbound, 0) ECL_VAR(SI_CONSTANT, ECL_UNBOUND)},
|
||||
{SYS_ "PROTECT-TAG" ECL_FUN(NULL, NULL, -1) ECL_VAR(SI_ORDINARY, OBJNULL)},
|
||||
{SYS_ "DUMMY-TAG" ECL_FUN(NULL, NULL, -1) ECL_VAR(SI_ORDINARY, OBJNULL)},
|
||||
{SYS_ "*RESTART-CLUSTERS*" ECL_FUN(NULL, NULL, -1) ECL_VAR(SI_SPECIAL, ECL_NIL)},
|
||||
{SYS_ "*HANDLER-CLUSTERS*" ECL_FUN(NULL, NULL, -1) ECL_VAR(SI_SPECIAL, ECL_NIL)},
|
||||
{EXT_ "*INTERRUPTS-ENABLED*" ECL_FUN(NULL, NULL, 1) ECL_VAR(EXT_SPECIAL, ECL_T)},
|
||||
|
|
|
|||
|
|
@ -129,6 +129,23 @@
|
|||
#define ecl_cast_ptr(type,n) ((type)(n))
|
||||
#endif
|
||||
|
||||
#ifdef ECL_THREADS
|
||||
#define ecl_def_ct_token(name,stype,sname,value,static,const) \
|
||||
static const struct ecl_symbol name ## _data = { \
|
||||
(int8_t)t_symbol, 0, stype, 0, \
|
||||
value, ECL_NIL, NULL /*ecl_undefined_function_entry*/, \
|
||||
ECL_NIL, ECL_NIL, ECL_NIL, sname, ECL_NIL, ECL_NIL, \
|
||||
ECL_MISSING_SPECIAL_BINDING }; \
|
||||
static const cl_object name = (cl_object)(& name ## _data)
|
||||
#else
|
||||
#define ecl_def_ct_token(name,stype,sname,value,static,const) \
|
||||
static const struct ecl_symbol name ## _data = { \
|
||||
(int8_t)t_symbol, 0, stype, 0, \
|
||||
value, ECL_NIL, NULL /*ecl_undefined_function_entry*/, \
|
||||
ECL_NIL, ECL_NIL, ECL_NIL, sname, ECL_NIL, ECL_NIL }; \
|
||||
static const cl_object name = (cl_object)(& name ## _data)
|
||||
#endif
|
||||
|
||||
#define ecl_def_string_array(name,static,const) \
|
||||
static const union { \
|
||||
struct ecl_base_string elt; \
|
||||
|
|
|
|||
|
|
@ -267,6 +267,9 @@ extern ECL_API const cl_object ecl_ct_longfloat_minus_zero;
|
|||
extern ECL_API const cl_object ecl_ct_plus_half;
|
||||
extern ECL_API const cl_object ecl_ct_minus_half;
|
||||
|
||||
extern ECL_API const cl_object ecl_ct_protect_tag;
|
||||
extern ECL_API const cl_object ecl_ct_dummy_tag;
|
||||
|
||||
/* alloc.c / alloc_2.c */
|
||||
|
||||
extern ECL_API cl_object ecl_alloc_object(cl_type t);
|
||||
|
|
|
|||
|
|
@ -258,14 +258,15 @@ enum ecl_stype { /* symbol type */
|
|||
};
|
||||
|
||||
#define ECL_NIL ((cl_object)t_list)
|
||||
#define ECL_PROTECT_TAG ecl_ct_protect_tag
|
||||
#define ECL_DUMMY_TAG ecl_ct_dummy_tag
|
||||
|
||||
#define ECL_NIL_SYMBOL ((cl_object)cl_symbols)
|
||||
#define ECL_T ((cl_object)(cl_symbols+1))
|
||||
#define ECL_UNBOUND ((cl_object)(cl_symbols+2))
|
||||
#define ECL_PROTECT_TAG ((cl_object)(cl_symbols+3))
|
||||
#define ECL_DUMMY_TAG ((cl_object)(cl_symbols+4))
|
||||
#define ECL_RESTART_CLUSTERS ((cl_object)(cl_symbols+5))
|
||||
#define ECL_HANDLER_CLUSTERS ((cl_object)(cl_symbols+6))
|
||||
#define ECL_INTERRUPTS_ENABLED ((cl_object)(cl_symbols+7))
|
||||
#define ECL_RESTART_CLUSTERS ((cl_object)(cl_symbols+3))
|
||||
#define ECL_HANDLER_CLUSTERS ((cl_object)(cl_symbols+4))
|
||||
#define ECL_INTERRUPTS_ENABLED ((cl_object)(cl_symbols+5))
|
||||
#define ECL_NO_TL_BINDING ((cl_object)(1 << ECL_TAG_BITS))
|
||||
|
||||
struct ecl_symbol {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue