: rel-exception-handler ( class -- )
rt-exception-handler add-relocation ;
+: rel-inline-cache-miss ( class -- )
+ rt-inline-cache-miss add-relocation ;
+
: init-relocation ( -- )
V{ } clone parameter-table set
V{ } clone literal-table set
CONSTANT: rt-decks-offset 11
CONSTANT: rt-exception-handler 12
CONSTANT: rt-dlsym-toc 13
+CONSTANT: rt-inline-cache-miss 14
: rc-absolute? ( n -- ? )
${
jit-save-context
ESP 4 [+] vm-reg MOV
ESP [] pic-tail-reg MOV
- "inline_cache_miss" jit-call
+ 0 CALL rc-relative rel-inline-cache-miss
jit-restore-context ;
[ jit-load-return-address jit-inline-cache-miss ]
jit-save-context
arg1 RBX MOV
arg2 vm-reg MOV
- "inline_cache_miss" jit-call
+ RAX 0 MOV rc-absolute-cell rel-inline-cache-miss
+ RAX CALL
jit-load-context
jit-restore-context ;
op.store_value(compute_dlsym_toc_address(parameters,index));
break;
#endif
+ case RT_INLINE_CACHE_MISS:
+ op.store_value((cell)&factor::inline_cache_miss);
+ break;
default:
critical_error("Bad rel type in store_external_address()",op.rel_type());
break;
RT_EXCEPTION_HANDLER,
/* arg is a literal table index, holding a pair (symbol/dll) */
RT_DLSYM_TOC,
+ /* address of inline_cache_miss function. This is a separate
+ relocation to reduce compile time and size for PICs. */
+ RT_INLINE_CACHE_MISS
};
enum relocation_class {
case RT_CARDS_OFFSET:
case RT_DECKS_OFFSET:
case RT_EXCEPTION_HANDLER:
+ case RT_INLINE_CACHE_MISS:
return 0;
default:
critical_error("Bad rel type in number_of_parameters()",rel_type());