factor/vm/quotations.hpp

41 lines
983 B
C++
Raw Normal View History

2009-05-04 02:46:13 -04:00
namespace factor
{
2009-05-02 10:19:09 -04:00
struct quotation_jit : public jit {
2009-05-04 05:50:24 -04:00
gc_root<array> elements;
2009-05-02 10:19:09 -04:00
bool compiling, relocate;
2009-08-17 16:37:09 -04:00
quotation_jit(cell quot, bool compiling_, bool relocate_, factorvm *vm)
: jit(QUOTATION_TYPE,quot,vm),
2009-05-04 05:50:24 -04:00
elements(owner.as<quotation>().untagged()->array),
2009-05-02 10:19:09 -04:00
compiling(compiling_),
relocate(relocate_) {};
2009-05-04 05:50:24 -04:00
void emit_mega_cache_lookup(cell methods, fixnum index, cell cache);
bool primitive_call_p(cell i);
bool fast_if_p(cell i);
bool fast_dip_p(cell i);
bool fast_2dip_p(cell i);
bool fast_3dip_p(cell i);
bool mega_lookup_p(cell i);
2009-05-02 10:19:09 -04:00
bool stack_frame_p();
void iterate_quotation();
};
2009-05-04 05:50:24 -04:00
void set_quot_xt(quotation *quot, code_block *code);
void jit_compile(cell quot, bool relocate);
fixnum quot_code_offset_to_scan(cell quot, cell offset);
2009-05-02 10:19:09 -04:00
PRIMITIVE(jit_compile);
2009-05-02 10:19:09 -04:00
2009-05-05 12:33:35 -04:00
void compile_all_words();
2009-05-02 10:19:09 -04:00
PRIMITIVE(array_to_quotation);
PRIMITIVE(quotation_xt);
2009-05-02 10:19:09 -04:00
2009-05-04 05:50:24 -04:00
VM_ASM_API cell lazy_jit_compile_impl(cell quot, stack_frame *stack);
2009-05-04 02:46:13 -04:00
PRIMITIVE(quot_compiled_p);
2009-05-04 02:46:13 -04:00
}