factor/vm/quotations.hpp

35 lines
821 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-09-23 14:05:46 -04:00
quotation_jit(cell quot, bool compiling_, bool relocate_, factor_vm *vm)
2009-08-17 16:37:09 -04:00
: jit(QUOTATION_TYPE,quot,vm),
elements(owner.as<quotation>().untagged()->array,vm),
2009-05-02 10:19:09 -04:00
compiling(compiling_),
relocate(relocate_){};
2009-05-02 10:19:09 -04:00
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();
};
PRIMITIVE(jit_compile);
2009-05-02 10:19:09 -04:00
PRIMITIVE(array_to_quotation);
PRIMITIVE(quotation_xt);
2009-05-02 10:19:09 -04:00
2009-09-23 14:05:46 -04:00
VM_ASM_API cell lazy_jit_compile_impl(cell quot, stack_frame *stack, factor_vm *myvm);
2009-05-04 02:46:13 -04:00
PRIMITIVE(quot_compiled_p);
2009-05-04 02:46:13 -04:00
}