]> gitweb.factorcode.org Git - factor.git/blob - vm/quotations.hpp
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / vm / quotations.hpp
1 namespace factor
2 {
3
4 struct quotation_jit : public jit {
5         gc_root<array> elements;
6         bool compiling, relocate;
7
8         quotation_jit(cell quot, bool compiling_, bool relocate_)
9                 : jit(QUOTATION_TYPE,quot),
10                   elements(owner.as<quotation>().untagged()->array),
11                   compiling(compiling_),
12                   relocate(relocate_) {};
13
14         void emit_mega_cache_lookup(cell methods, fixnum index, cell cache);
15         bool primitive_call_p(cell i);
16         bool fast_if_p(cell i);
17         bool fast_dip_p(cell i);
18         bool fast_2dip_p(cell i);
19         bool fast_3dip_p(cell i);
20         bool mega_lookup_p(cell i);
21         bool stack_frame_p();
22         void iterate_quotation();
23 };
24
25 void set_quot_xt(quotation *quot, code_block *code);
26 void jit_compile(cell quot, bool relocate);
27 fixnum quot_code_offset_to_scan(cell quot, cell offset);
28
29 PRIMITIVE(jit_compile);
30
31 void compile_all_words();
32
33 PRIMITIVE(array_to_quotation);
34 PRIMITIVE(quotation_xt);
35
36 VM_ASM_API cell lazy_jit_compile_impl(cell quot, stack_frame *stack);
37
38 PRIMITIVE(quot_compiled_p);
39
40 }