4 static const cell special_object_count = 70;
7 OBJ_WALKER_HOOK = 3, /* non-local exit hook, used by library only */
8 OBJ_CALLCC_1, /* used to pass the value in callcc1 */
10 ERROR_HANDLER_QUOT = 5, /* quotation called when VM throws an error */
11 OBJ_ERROR, /* a marker consed onto kernel errors */
13 OBJ_CELL_SIZE = 7, /* sizeof(cell) */
14 OBJ_CPU, /* CPU architecture */
15 OBJ_OS, /* operating system name */
17 OBJ_ARGS = 10, /* command line arguments */
18 OBJ_STDIN, /* stdin FILE* handle */
19 OBJ_STDOUT, /* stdout FILE* handle */
21 OBJ_IMAGE = 13, /* image path name */
22 OBJ_EXECUTABLE, /* runtime executable path name */
24 OBJ_EMBEDDED = 15, /* are we embedded in another app? */
25 OBJ_EVAL_CALLBACK, /* used when Factor is embedded in a C app */
26 OBJ_YIELD_CALLBACK, /* used when Factor is embedded in a C app */
27 OBJ_SLEEP_CALLBACK, /* used when Factor is embedded in a C app */
29 OBJ_STARTUP_QUOT = 20, /* startup quotation */
30 OBJ_GLOBAL, /* global namespace */
31 OBJ_SHUTDOWN_QUOT, /* shutdown quotation */
33 /* Quotation compilation in quotations.c */
54 /* External entry points */
56 LAZY_JIT_COMPILE_WORD,
57 UNWIND_NATIVE_FRAMES_WORD,
59 /* Incremented on every modify-code-heap call; invalidates call( inline
61 REDEFINITION_COUNTER = 47,
63 /* Callback stub generation in callbacks.c */
66 /* Polymorphic inline cache generation in inline_cache.c */
76 /* Megamorphic cache generation in dispatch.c */
81 OBJ_UNDEFINED = 60, /* default quotation for undefined words */
83 OBJ_STDERR = 61, /* stderr FILE* handle */
85 OBJ_STAGE2 = 62, /* have we bootstrapped? */
87 OBJ_CURRENT_THREAD = 63,
93 OBJ_VM_COMPILER = 67, /* version string of the compiler we were built with */
96 /* save-image-and-exit discards special objects that are filled in on startup
97 anyway, to reduce image size */
98 #define OBJ_FIRST_SAVE OBJ_STARTUP_QUOT
99 #define OBJ_LAST_SAVE OBJ_STAGE2
101 inline static bool save_special_p(cell i)
103 return (i >= OBJ_FIRST_SAVE && i <= OBJ_LAST_SAVE);
106 template<typename Iterator> void object::each_slot(Iterator &iter)
108 cell scan = (cell)this;
109 cell payload_start = binary_payload_start();
110 cell end = scan + payload_start;
112 scan += sizeof(cell);
117 scan += sizeof(cell);