]> gitweb.factorcode.org Git - factor.git/blob - vm/quotations.hpp
VM: Refactor quotations.cpp/hpp to Factor style
[factor.git] / vm / quotations.hpp
1 namespace factor {
2
3 struct quotation_jit : public jit {
4   data_root<array> elements;
5   bool compiling, relocate;
6
7   explicit quotation_jit(cell owner, bool compiling_, bool relocate_,
8                          factor_vm* vm)
9       : jit(code_block_unoptimized, owner, vm),
10         elements(false_object, vm),
11         compiling(compiling_),
12         relocate(relocate_) {}
13   ;
14
15   void init_quotation(cell quot);
16   void emit_mega_cache_lookup(cell methods, fixnum index, cell cache);
17   bool primitive_call_p(cell i, cell length);
18   bool trivial_quotation_p(array* elements);
19   void emit_quot(cell quot);
20   void emit_prolog(bool safepoint, bool stack_frame);
21   void emit_epilog(bool safepoint, bool stack_frame);
22   bool fast_if_p(cell i, cell length);
23   bool fast_dip_p(cell i, cell length);
24   bool fast_2dip_p(cell i, cell length);
25   bool fast_3dip_p(cell i, cell length);
26   bool mega_lookup_p(cell i, cell length);
27   bool declare_p(cell i, cell length);
28   bool special_subprimitive_p(cell obj);
29   bool word_stack_frame_p(cell obj);
30   cell word_stack_frame_size(cell obj);
31   bool word_safepoint_p(cell obj);
32   bool stack_frame_p();
33   bool safepoint_p();
34   void iterate_quotation();
35 };
36
37 VM_C_API cell lazy_jit_compile(cell quot, factor_vm* parent);
38
39 }