just in time native code: now compiles by doing cmake; make.
no workie in this version, though :)
This commit is contained in:
parent
42d7b305c0
commit
ba978d8275
67
C/absmi.c
67
C/absmi.c
@ -501,7 +501,8 @@
|
||||
We next discuss several issues on trying to make Prolog programs run
|
||||
fast in YAP. We assume two different programming styles:
|
||||
|
||||
+ Execution of <em>deterministic</em> programs often
|
||||
+ Execution of <em>deterministic</em> programs ofte
|
||||
n
|
||||
boils down to a recursive loop of the form:
|
||||
|
||||
~~~~~
|
||||
@ -516,11 +517,30 @@ loop(Env) :-
|
||||
#define IN_ABSMI_C 1
|
||||
#define HAS_CACHE_REGS 1
|
||||
|
||||
|
||||
|
||||
#include "absmi.h"
|
||||
#include "heapgc.h"
|
||||
|
||||
#include "cut_c.h"
|
||||
|
||||
#if YAP_JIT
|
||||
#include "IsGround.h"
|
||||
|
||||
NativeContext *NativeArea;
|
||||
IntermediatecodeContext *IntermediatecodeArea;
|
||||
|
||||
CELL l;
|
||||
|
||||
CELL nnexec;
|
||||
|
||||
static Int traced_absmi(void)
|
||||
{
|
||||
return Yap_traced_absmi();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef PUSH_X
|
||||
#else
|
||||
|
||||
@ -537,31 +557,6 @@ Term Yap_XREGS[MaxTemps]; /* 29 */
|
||||
//#include "sprint_op.hpp"
|
||||
//#include "print_op.hpp"
|
||||
|
||||
#if YAP_JIT
|
||||
#include "IsGround.h"
|
||||
#include "yaam_macros.hpp"
|
||||
#include "fprintblock.h"
|
||||
|
||||
#if YAP_DBG_PREDS
|
||||
#include "debug_printers.h"
|
||||
#endif
|
||||
|
||||
struct JIT_Compiler *J;
|
||||
|
||||
NativeContext *NativeArea;
|
||||
IntermediatecodeContext *IntermediatecodeArea;
|
||||
void shutdown_llvm(void);
|
||||
|
||||
CELL l;
|
||||
short global;
|
||||
CELL nnexec;
|
||||
yamop* HEADPREG;
|
||||
CELL BLOCK;
|
||||
CELL BLOCKADDRESS;
|
||||
CELL FAILED;
|
||||
|
||||
#endif /* YAP_JIT */
|
||||
|
||||
#ifdef COROUTINING
|
||||
/*
|
||||
Imagine we are interrupting the execution, say, because we have a spy
|
||||
@ -1588,10 +1583,6 @@ Yap_absmi(int inp)
|
||||
#define I_R (XREGS[0])
|
||||
|
||||
#if YAP_JIT
|
||||
#if YAP_STAT_PREDS
|
||||
struct timeval timstart, timend;
|
||||
struct rusage rustart, ruend;
|
||||
#endif
|
||||
static void *control_labels[] = { &&fail, &&NoStackCut, &&NoStackCommitY, &&NoStackCutT, &&NoStackEither, &&NoStackExecute, &&NoStackCall, &&NoStackDExecute, &&NoStackDeallocate, &¬railleft, &&NoStackFail, &&NoStackCommitX };
|
||||
curtrace = NULL;
|
||||
curpreg = NULL;
|
||||
@ -1638,7 +1629,8 @@ Yap_absmi(int inp)
|
||||
};
|
||||
|
||||
#if YAP_JIT
|
||||
ExpEnv.config_struc.TOTAL_OF_OPCODES = sizeof(OpAddress)/(2*sizeof(void*));
|
||||
ExpEnv.config_struc.TOTAL_OF_OPCODES =
|
||||
sizeof(OpAddress)/(2*sizeof(void*));
|
||||
#endif
|
||||
|
||||
#endif /* USE_THREADED_CODE */
|
||||
@ -1693,6 +1685,7 @@ Yap_absmi(int inp)
|
||||
/* absmadr */
|
||||
if (inp > 0) {
|
||||
Yap_ABSMI_OPCODES = OpAddress;
|
||||
Yap_ABSMI_ControlLabels = control_labels;
|
||||
#if BP_FREE
|
||||
P1REG = PCBACKUP;
|
||||
#endif
|
||||
@ -1819,16 +1812,6 @@ Yap_absmi(int inp)
|
||||
// so that they are easier to analyse.
|
||||
#include "absmi_insts.h"
|
||||
|
||||
#if YAP_JIT
|
||||
#include "traced_absmi_insts.h"
|
||||
#if YAPOR
|
||||
#include "traced_or.insts.h"
|
||||
#endif
|
||||
#if TABLING
|
||||
#include "traced_tab.insts.h"
|
||||
#include "traced_tab.tries.insts.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !USE_THREADED_CODE
|
||||
default:
|
||||
@ -1850,8 +1833,6 @@ Yap_absmi(int inp)
|
||||
|
||||
return (0);
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* dummy function that is needed for profiler */
|
||||
|
@ -55,7 +55,8 @@ BOp(Ystop, l);
|
||||
fprintf(stderr, "%s", (char*)ExpEnv.debug_struc.pprint_me.criticals);
|
||||
}
|
||||
#endif
|
||||
goto critical_lbl;
|
||||
traced_absmi();
|
||||
|
||||
}
|
||||
#if YAP_DBG_PREDS
|
||||
print_main_when_head(PREG, ON_INTERPRETER);
|
||||
|
2
C/init.c
2
C/init.c
@ -93,6 +93,8 @@ int Yap_page_size;
|
||||
#if USE_THREADED_CODE
|
||||
/* easy access to instruction opcodes */
|
||||
void **Yap_ABSMI_OPCODES;
|
||||
void **Yap_ABSMI_ControlLabels;
|
||||
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
|
@ -342,8 +342,9 @@ static Int p_set_yap_flags(USES_REGS1);
|
||||
static Int p_break(USES_REGS1);
|
||||
|
||||
#if YAP_JIT
|
||||
void* (*Yap_JitCall)(struct JIT_Compiler* jc, yamop* p);
|
||||
void* (*Yap_JitCall)(JIT_Compiler* jc, yamop* p);
|
||||
void (* Yap_llvmShutdown)(void ) ;
|
||||
Int (* Yap_traced_absmi)(void ) ;
|
||||
|
||||
Environment ExpEnv;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -141,6 +141,7 @@ endif()
|
||||
# Model Specific
|
||||
if (HAVE_GCC)
|
||||
set_property( DIRECTORY APPEND_STRING PROPERTY COMPILE_OPTIONS -Wall;-Wstrict-prototypes;-Wmissing-prototypes )
|
||||
set_property( DIRECTORY APPEND_STRING PROPERTY COMPILE_OPTIONS -fexceptions )
|
||||
endif()
|
||||
|
||||
message(STATUS "Original CMAKE_C_FLAGS ${CMAKE_C_FLAGS}")
|
||||
|
405
H/YapOpcodes.h
405
H/YapOpcodes.h
@ -422,414 +422,9 @@
|
||||
OPCODE(trie_trust_gterm ,e),
|
||||
OPCODE(trie_try_gterm ,e),
|
||||
OPCODE(trie_retry_gterm ,e),
|
||||
#endif
|
||||
#ifdef YAP_JIT
|
||||
OPCODE(traced_Ystop ,l),
|
||||
OPCODE(traced_Nstop ,e),
|
||||
OPCODE(traced_try_me ,Otapl),
|
||||
OPCODE(traced_retry_me ,Otapl),
|
||||
OPCODE(traced_trust_me ,Otapl),
|
||||
OPCODE(traced_enter_profiling ,p),
|
||||
OPCODE(traced_retry_profiled ,p),
|
||||
OPCODE(traced_profiled_retry_me ,Otapl),
|
||||
OPCODE(traced_profiled_trust_me ,Otapl),
|
||||
OPCODE(traced_profiled_retry_logical,OtaLl),
|
||||
OPCODE(traced_profiled_trust_logical,OtILl),
|
||||
OPCODE(traced_count_call ,p),
|
||||
OPCODE(traced_count_retry ,p),
|
||||
OPCODE(traced_count_retry_me ,Otapl),
|
||||
OPCODE(traced_count_trust_me ,Otapl),
|
||||
OPCODE(traced_count_retry_logical ,OtaLl),
|
||||
OPCODE(traced_count_trust_logical ,OtILl),
|
||||
OPCODE(traced_lock_lu ,p),
|
||||
OPCODE(traced_unlock_lu ,e),
|
||||
OPCODE(traced_alloc_for_logical_pred,L),
|
||||
OPCODE(traced_copy_idb_term ,e),
|
||||
OPCODE(traced_unify_idb_term ,e),
|
||||
OPCODE(traced_ensure_space ,Osbpa),
|
||||
OPCODE(traced_spy_or_trymark ,Otapl),
|
||||
OPCODE(traced_try_and_mark ,Otapl),
|
||||
OPCODE(traced_count_retry_and_mark,Otapl),
|
||||
OPCODE(traced_profiled_retry_and_mark,Otapl),
|
||||
OPCODE(traced_retry_and_mark ,Otapl),
|
||||
OPCODE(traced_trust_fail ,e),
|
||||
OPCODE(traced_op_fail ,e),
|
||||
OPCODE(traced_cut ,s),
|
||||
OPCODE(traced_cut_t ,s),
|
||||
OPCODE(traced_cut_e ,s),
|
||||
OPCODE(traced_save_b_x ,x),
|
||||
OPCODE(traced_save_b_y ,y),
|
||||
OPCODE(traced_commit_b_x ,xps),
|
||||
OPCODE(traced_commit_b_y ,yps),
|
||||
OPCODE(traced_execute ,pp),
|
||||
OPCODE(traced_dexecute ,pp),
|
||||
OPCODE(traced_fcall ,Osbpp),
|
||||
OPCODE(traced_call ,Osbpp),
|
||||
OPCODE(traced_procceed ,p),
|
||||
OPCODE(traced_allocate ,e),
|
||||
OPCODE(traced_deallocate ,p),
|
||||
OPCODE(traced_retry_eam ,e),
|
||||
OPCODE(traced_run_eam ,os),
|
||||
OPCODE(traced_get_x_var ,xx),
|
||||
OPCODE(traced_get_y_var ,yx),
|
||||
OPCODE(traced_get_yy_var ,yyxx),
|
||||
OPCODE(traced_get_x_val ,xx),
|
||||
OPCODE(traced_get_y_val ,yx),
|
||||
OPCODE(traced_get_atom ,xc),
|
||||
OPCODE(traced_get_2atoms ,cc),
|
||||
OPCODE(traced_get_3atoms ,ccc),
|
||||
OPCODE(traced_get_4atoms ,cccc),
|
||||
OPCODE(traced_get_5atoms ,ccccc),
|
||||
OPCODE(traced_get_6atoms ,cccccc),
|
||||
OPCODE(traced_get_list ,x),
|
||||
OPCODE(traced_get_struct ,xfa),
|
||||
OPCODE(traced_get_float ,xd),
|
||||
OPCODE(traced_get_longint ,xi),
|
||||
OPCODE(traced_get_bigint ,xN),
|
||||
OPCODE(traced_get_dbterm ,xD),
|
||||
OPCODE(traced_glist_valx ,xx),
|
||||
OPCODE(traced_glist_valy ,yx),
|
||||
OPCODE(traced_gl_void_varx ,xx),
|
||||
OPCODE(traced_gl_void_vary ,yx),
|
||||
OPCODE(traced_gl_void_valx ,xx),
|
||||
OPCODE(traced_gl_void_valy ,yx),
|
||||
OPCODE(traced_unify_x_var ,ox),
|
||||
OPCODE(traced_unify_x_var_write ,ox),
|
||||
OPCODE(traced_unify_l_x_var ,ox),
|
||||
OPCODE(traced_unify_l_x_var_write ,ox),
|
||||
OPCODE(traced_unify_x_var2 ,oxx),
|
||||
OPCODE(traced_unify_x_var2_write ,oxx),
|
||||
OPCODE(traced_unify_l_x_var2 ,oxx),
|
||||
OPCODE(traced_unify_l_x_var2_write,oxx),
|
||||
OPCODE(traced_unify_y_var ,oy),
|
||||
OPCODE(traced_unify_y_var_write ,oy),
|
||||
OPCODE(traced_unify_l_y_var ,oy),
|
||||
OPCODE(traced_unify_l_y_var_write ,oy),
|
||||
OPCODE(traced_unify_x_val ,ox),
|
||||
OPCODE(traced_unify_x_val_write ,ox),
|
||||
OPCODE(traced_unify_l_x_val ,ox),
|
||||
OPCODE(traced_unify_l_x_val_write ,ox),
|
||||
OPCODE(traced_unify_y_val ,oy),
|
||||
OPCODE(traced_unify_y_val_write ,oy),
|
||||
OPCODE(traced_unify_l_y_val ,oy),
|
||||
OPCODE(traced_unify_l_y_val_write ,oy),
|
||||
OPCODE(traced_unify_x_loc ,ox),
|
||||
OPCODE(traced_unify_x_loc_write ,ox),
|
||||
OPCODE(traced_unify_l_x_loc ,ox),
|
||||
OPCODE(traced_unify_l_x_loc_write ,ox),
|
||||
OPCODE(traced_unify_y_loc ,oy),
|
||||
OPCODE(traced_unify_y_loc_write ,oy),
|
||||
OPCODE(traced_unify_l_y_loc ,oy),
|
||||
OPCODE(traced_unify_l_y_loc_write ,oy),
|
||||
OPCODE(traced_unify_void ,o),
|
||||
OPCODE(traced_unify_void_write ,o),
|
||||
OPCODE(traced_unify_l_void ,o),
|
||||
OPCODE(traced_unify_l_void_write ,o),
|
||||
OPCODE(traced_unify_n_voids ,os),
|
||||
OPCODE(traced_unify_n_voids_write ,os),
|
||||
OPCODE(traced_unify_l_n_voids ,os),
|
||||
OPCODE(traced_unify_l_n_voids_write,os),
|
||||
OPCODE(traced_unify_atom ,oc),
|
||||
OPCODE(traced_unify_atom_write ,oc),
|
||||
OPCODE(traced_unify_l_atom ,oc),
|
||||
OPCODE(traced_unify_l_atom_write ,oc),
|
||||
OPCODE(traced_unify_n_atoms ,osc),
|
||||
OPCODE(traced_unify_n_atoms_write ,osc),
|
||||
OPCODE(traced_unify_float ,od),
|
||||
OPCODE(traced_unify_float_write ,od),
|
||||
OPCODE(traced_unify_l_float ,od),
|
||||
OPCODE(traced_unify_l_float_write ,od),
|
||||
OPCODE(traced_unify_longint ,oi),
|
||||
OPCODE(traced_unify_longint_write ,oi),
|
||||
OPCODE(traced_unify_l_longint ,oi),
|
||||
OPCODE(traced_unify_l_longint_write,oi),
|
||||
OPCODE(traced_unify_bigint ,oN),
|
||||
OPCODE(traced_unify_l_bigint ,oN),
|
||||
OPCODE(traced_unify_dbterm ,oD),
|
||||
OPCODE(traced_unify_l_dbterm ,oD),
|
||||
OPCODE(traced_unify_list ,o),
|
||||
OPCODE(traced_unify_list_write ,o),
|
||||
OPCODE(traced_unify_l_list ,o),
|
||||
OPCODE(traced_unify_l_list_write ,o),
|
||||
OPCODE(traced_unify_struct ,ofa),
|
||||
OPCODE(traced_unify_struct_write ,ofa),
|
||||
OPCODE(traced_unify_l_struc ,ofa),
|
||||
OPCODE(traced_unify_l_struc_write ,ofa),
|
||||
OPCODE(traced_put_x_var ,xx),
|
||||
OPCODE(traced_put_y_var ,yx),
|
||||
OPCODE(traced_put_x_val ,xx),
|
||||
OPCODE(traced_put_xx_val ,xxxx),
|
||||
OPCODE(traced_put_y_val ,yx),
|
||||
OPCODE(traced_put_y_vals ,yyxx),
|
||||
OPCODE(traced_put_unsafe ,yx),
|
||||
OPCODE(traced_put_atom ,xc),
|
||||
OPCODE(traced_put_dbterm ,xD),
|
||||
OPCODE(traced_put_bigint ,xN),
|
||||
OPCODE(traced_put_float ,xd),
|
||||
OPCODE(traced_put_longint ,xi),
|
||||
OPCODE(traced_put_list ,x),
|
||||
OPCODE(traced_put_struct ,xfa),
|
||||
OPCODE(traced_write_x_var ,x),
|
||||
OPCODE(traced_write_void ,e),
|
||||
OPCODE(traced_write_n_voids ,s),
|
||||
OPCODE(traced_write_y_var ,y),
|
||||
OPCODE(traced_write_x_val ,x),
|
||||
OPCODE(traced_write_x_loc ,x),
|
||||
OPCODE(traced_write_y_val ,y),
|
||||
OPCODE(traced_write_y_loc ,y),
|
||||
OPCODE(traced_write_atom ,c),
|
||||
OPCODE(traced_write_bigint ,N),
|
||||
OPCODE(traced_write_dbterm ,D),
|
||||
OPCODE(traced_write_float ,d),
|
||||
OPCODE(traced_write_longint ,i),
|
||||
OPCODE(traced_write_n_atoms ,sc),
|
||||
OPCODE(traced_write_list ,e),
|
||||
OPCODE(traced_write_l_list ,e),
|
||||
OPCODE(traced_write_struct ,fa),
|
||||
OPCODE(traced_write_l_struc ,fa),
|
||||
OPCODE(traced_save_pair_x ,ox),
|
||||
OPCODE(traced_save_pair_x_write ,ox),
|
||||
OPCODE(traced_save_pair_y ,oy),
|
||||
OPCODE(traced_save_pair_y_write ,oy),
|
||||
OPCODE(traced_save_appl_x ,ox),
|
||||
OPCODE(traced_save_appl_x_write ,ox),
|
||||
OPCODE(traced_save_appl_y ,oy),
|
||||
OPCODE(traced_save_appl_y_write ,oy),
|
||||
OPCODE(traced_jump ,l),
|
||||
OPCODE(traced_move_back ,l),
|
||||
OPCODE(traced_skip ,l),
|
||||
OPCODE(traced_either ,Osblp),
|
||||
OPCODE(traced_or_else ,Osblp),
|
||||
OPCODE(traced_pop_n ,s),
|
||||
OPCODE(traced_pop ,e),
|
||||
OPCODE(traced_call_cpred ,Osbpp),
|
||||
OPCODE(traced_execute_cpred ,pp),
|
||||
OPCODE(traced_call_usercpred ,Osbpp),
|
||||
OPCODE(traced_call_c_wfail ,slp),
|
||||
OPCODE(traced_try_c ,OtapFs),
|
||||
OPCODE(traced_retry_c ,OtapFs),
|
||||
OPCODE(traced_cut_c ,OtapFs),
|
||||
OPCODE(traced_try_userc ,OtapFs),
|
||||
OPCODE(traced_retry_userc ,OtapFs),
|
||||
OPCODE(traced_cut_userc ,OtapFs),
|
||||
OPCODE(traced_lock_pred ,e),
|
||||
OPCODE(traced_index_pred ,e),
|
||||
OPCODE(traced_thread_local ,e),
|
||||
OPCODE(traced_expand_index ,e),
|
||||
OPCODE(traced_expand_clauses ,sssllp),
|
||||
OPCODE(traced_undef_p ,e),
|
||||
OPCODE(traced_spy_pred ,e),
|
||||
OPCODE(traced_try_clause ,Otapl),
|
||||
OPCODE(traced_try_clause2 ,l),
|
||||
OPCODE(traced_try_clause3 ,l),
|
||||
OPCODE(traced_try_clause4 ,l),
|
||||
OPCODE(traced_retry ,Otapl),
|
||||
OPCODE(traced_retry2 ,l),
|
||||
OPCODE(traced_retry3 ,l),
|
||||
OPCODE(traced_retry4 ,l),
|
||||
OPCODE(traced_trust ,Otapl),
|
||||
OPCODE(traced_try_in ,l),
|
||||
OPCODE(traced_enter_lu_pred ,Illss),
|
||||
OPCODE(traced_try_logical ,OtaLl),
|
||||
OPCODE(traced_retry_logical ,OtaLl),
|
||||
OPCODE(traced_trust_logical ,OtILl),
|
||||
OPCODE(traced_user_switch ,lp),
|
||||
OPCODE(traced_switch_on_type ,llll),
|
||||
OPCODE(traced_switch_list_nl ,ollll),
|
||||
OPCODE(traced_switch_on_arg_type ,xllll),
|
||||
OPCODE(traced_switch_on_sub_arg_type,sllll),
|
||||
OPCODE(traced_jump_if_var ,l),
|
||||
OPCODE(traced_jump_if_nonvar ,xll),
|
||||
OPCODE(traced_if_not_then ,clll),
|
||||
OPCODE(traced_switch_on_func ,sssl),
|
||||
OPCODE(traced_switch_on_cons ,sssl),
|
||||
OPCODE(traced_go_on_func ,sssl),
|
||||
OPCODE(traced_go_on_cons ,sssl),
|
||||
OPCODE(traced_if_func ,sssl),
|
||||
OPCODE(traced_if_cons ,sssl),
|
||||
OPCODE(traced_index_dbref ,e),
|
||||
OPCODE(traced_index_blob ,e),
|
||||
OPCODE(traced_index_long ,e),
|
||||
OPCODE(traced_jit_handler ,J),
|
||||
OPCODE(traced_p_atom_x ,xl),
|
||||
OPCODE(traced_p_atom_y ,yl),
|
||||
OPCODE(traced_p_atomic_x ,xl),
|
||||
OPCODE(traced_p_atomic_y ,yl),
|
||||
OPCODE(traced_p_integer_x ,xl),
|
||||
OPCODE(traced_p_integer_y ,yl),
|
||||
OPCODE(traced_p_nonvar_x ,xl),
|
||||
OPCODE(traced_p_nonvar_y ,yl),
|
||||
OPCODE(traced_p_number_x ,xl),
|
||||
OPCODE(traced_p_number_y ,yl),
|
||||
OPCODE(traced_p_var_x ,xl),
|
||||
OPCODE(traced_p_var_y ,yl),
|
||||
OPCODE(traced_p_db_ref_x ,xl),
|
||||
OPCODE(traced_p_db_ref_y ,yl),
|
||||
OPCODE(traced_p_primitive_x ,xl),
|
||||
OPCODE(traced_p_primitive_y ,yl),
|
||||
OPCODE(traced_p_compound_x ,xl),
|
||||
OPCODE(traced_p_compound_y ,yl),
|
||||
OPCODE(traced_p_float_x ,xl),
|
||||
OPCODE(traced_p_float_y ,yl),
|
||||
OPCODE(traced_p_plus_vv ,xxx),
|
||||
OPCODE(traced_p_plus_vc ,xxn),
|
||||
OPCODE(traced_p_plus_y_vv ,yxx),
|
||||
OPCODE(traced_p_plus_y_vc ,yxn),
|
||||
OPCODE(traced_p_minus_vv ,xxx),
|
||||
OPCODE(traced_p_minus_cv ,xxn),
|
||||
OPCODE(traced_p_minus_y_vv ,yxx),
|
||||
OPCODE(traced_p_minus_y_cv ,yxn),
|
||||
OPCODE(traced_p_times_vv ,xxx),
|
||||
OPCODE(traced_p_times_vc ,xxn),
|
||||
OPCODE(traced_p_times_y_vv ,yxx),
|
||||
OPCODE(traced_p_times_y_vc ,yxn),
|
||||
OPCODE(traced_p_div_vv ,xxx),
|
||||
OPCODE(traced_p_div_vc ,xxn),
|
||||
OPCODE(traced_p_div_cv ,xxn),
|
||||
OPCODE(traced_p_div_y_vv ,yxx),
|
||||
OPCODE(traced_p_div_y_vc ,yxn),
|
||||
OPCODE(traced_p_div_y_cv ,yxn),
|
||||
OPCODE(traced_p_and_vv ,xxx),
|
||||
OPCODE(traced_p_and_vc ,xxn),
|
||||
OPCODE(traced_p_and_y_vv ,yxx),
|
||||
OPCODE(traced_p_and_y_vc ,yxn),
|
||||
OPCODE(traced_p_or_vv ,xxx),
|
||||
OPCODE(traced_p_or_vc ,xxn),
|
||||
OPCODE(traced_p_or_y_vv ,yxx),
|
||||
OPCODE(traced_p_or_y_vc ,yxn),
|
||||
OPCODE(traced_p_sll_vv ,xxx),
|
||||
OPCODE(traced_p_sll_vc ,xxn),
|
||||
OPCODE(traced_p_sll_cv ,xxn),
|
||||
OPCODE(traced_p_sll_y_vv ,yxx),
|
||||
OPCODE(traced_p_sll_y_vc ,yxn),
|
||||
OPCODE(traced_p_sll_y_cv ,yxn),
|
||||
OPCODE(traced_p_slr_vv ,xxx),
|
||||
OPCODE(traced_p_slr_vc ,xxn),
|
||||
OPCODE(traced_p_slr_cv ,xxn),
|
||||
OPCODE(traced_p_slr_y_vv ,yxx),
|
||||
OPCODE(traced_p_slr_y_vc ,yxn),
|
||||
OPCODE(traced_p_slr_y_cv ,yxn),
|
||||
OPCODE(traced_call_bfunc_xx ,plxxs),
|
||||
OPCODE(traced_call_bfunc_yx ,plxys),
|
||||
OPCODE(traced_call_bfunc_xy ,plxys),
|
||||
OPCODE(traced_call_bfunc_yy ,plyys),
|
||||
OPCODE(traced_p_equal ,e),
|
||||
OPCODE(traced_p_dif ,l),
|
||||
OPCODE(traced_p_eq ,l),
|
||||
OPCODE(traced_p_arg_vv ,xxx),
|
||||
OPCODE(traced_p_arg_cv ,xxn),
|
||||
OPCODE(traced_p_arg_y_vv ,yxx),
|
||||
OPCODE(traced_p_arg_y_cv ,yxn),
|
||||
OPCODE(traced_p_func2s_vv ,xxx),
|
||||
OPCODE(traced_p_func2s_cv ,xxc),
|
||||
OPCODE(traced_p_func2s_vc ,xxn),
|
||||
OPCODE(traced_p_func2s_y_vv ,yxx),
|
||||
OPCODE(traced_p_func2s_y_cv ,yxn),
|
||||
OPCODE(traced_p_func2s_y_vc ,yxn),
|
||||
OPCODE(traced_p_func2f_xx ,xxx),
|
||||
OPCODE(traced_p_func2f_xy ,xxy),
|
||||
OPCODE(traced_p_func2f_yx ,yxx),
|
||||
OPCODE(traced_p_func2f_yy ,yyx),
|
||||
OPCODE(traced_p_functor ,e),
|
||||
OPCODE(traced_p_execute_tail ,Osbmp),
|
||||
OPCODE(traced_p_execute2 ,Osbpp),
|
||||
OPCODE(traced_p_execute ,Osbmp),
|
||||
#ifdef YAPOR
|
||||
OPCODE(traced_getwork_first_time ,e),
|
||||
OPCODE(traced_getwork ,Otapl),
|
||||
OPCODE(traced_getwork_seq ,Otapl),
|
||||
OPCODE(traced_sync ,Otapl),
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
OPCODE(traced_clause_with_cut ,e),
|
||||
OPCODE(traced_table_load_answer ,Otapl),
|
||||
OPCODE(traced_table_try_answer ,Otapl),
|
||||
OPCODE(traced_table_try_single ,Otapl),
|
||||
OPCODE(traced_table_try_me ,Otapl),
|
||||
OPCODE(traced_table_try ,Otapl),
|
||||
OPCODE(traced_table_retry_me ,Otapl),
|
||||
OPCODE(traced_table_retry ,Otapl),
|
||||
OPCODE(traced_table_trust_me ,Otapl),
|
||||
OPCODE(traced_table_trust ,Otapl),
|
||||
OPCODE(traced_table_new_answer ,s),
|
||||
OPCODE(traced_table_answer_resolution,Otapl),
|
||||
OPCODE(traced_table_completion ,Otapl),
|
||||
OPCODE(traced_table_answer_resolution_completion,Otapl),
|
||||
OPCODE(traced_trie_do_var ,e),
|
||||
OPCODE(traced_trie_trust_var ,e),
|
||||
OPCODE(traced_trie_try_var ,e),
|
||||
OPCODE(traced_trie_retry_var ,e),
|
||||
OPCODE(traced_trie_do_var_in_pair ,e),
|
||||
OPCODE(traced_trie_trust_var_in_pair,e),
|
||||
OPCODE(traced_trie_try_var_in_pair,e),
|
||||
OPCODE(traced_trie_retry_var_in_pair,e),
|
||||
OPCODE(traced_trie_do_val ,e),
|
||||
OPCODE(traced_trie_trust_val ,e),
|
||||
OPCODE(traced_trie_try_val ,e),
|
||||
OPCODE(traced_trie_retry_val ,e),
|
||||
OPCODE(traced_trie_do_val_in_pair ,e),
|
||||
OPCODE(traced_trie_trust_val_in_pair,e),
|
||||
OPCODE(traced_trie_try_val_in_pair,e),
|
||||
OPCODE(traced_trie_retry_val_in_pair,e),
|
||||
OPCODE(traced_trie_do_atom ,e),
|
||||
OPCODE(traced_trie_trust_atom ,e),
|
||||
OPCODE(traced_trie_try_atom ,e),
|
||||
OPCODE(traced_trie_retry_atom ,e),
|
||||
OPCODE(traced_trie_do_atom_in_pair,e),
|
||||
OPCODE(traced_trie_trust_atom_in_pair,e),
|
||||
OPCODE(traced_trie_try_atom_in_pair,e),
|
||||
OPCODE(traced_trie_retry_atom_in_pair,e),
|
||||
OPCODE(traced_trie_do_null ,e),
|
||||
OPCODE(traced_trie_trust_null ,e),
|
||||
OPCODE(traced_trie_try_null ,e),
|
||||
OPCODE(traced_trie_retry_null ,e),
|
||||
OPCODE(traced_trie_do_null_in_pair,e),
|
||||
OPCODE(traced_trie_trust_null_in_pair,e),
|
||||
OPCODE(traced_trie_try_null_in_pair,e),
|
||||
OPCODE(traced_trie_retry_null_in_pair,e),
|
||||
OPCODE(traced_trie_do_pair ,e),
|
||||
OPCODE(traced_trie_trust_pair ,e),
|
||||
OPCODE(traced_trie_try_pair ,e),
|
||||
OPCODE(traced_trie_retry_pair ,e),
|
||||
OPCODE(traced_trie_do_appl ,e),
|
||||
OPCODE(traced_trie_trust_appl ,e),
|
||||
OPCODE(traced_trie_try_appl ,e),
|
||||
OPCODE(traced_trie_retry_appl ,e),
|
||||
OPCODE(traced_trie_do_appl_in_pair,e),
|
||||
OPCODE(traced_trie_trust_appl_in_pair,e),
|
||||
OPCODE(traced_trie_try_appl_in_pair,e),
|
||||
OPCODE(traced_trie_retry_appl_in_pair,e),
|
||||
OPCODE(traced_trie_do_extension ,e),
|
||||
OPCODE(traced_trie_trust_extension,e),
|
||||
OPCODE(traced_trie_try_extension ,e),
|
||||
OPCODE(traced_trie_retry_extension,e),
|
||||
OPCODE(traced_trie_do_double ,e),
|
||||
OPCODE(traced_trie_trust_double ,e),
|
||||
OPCODE(traced_trie_try_double ,e),
|
||||
OPCODE(traced_trie_retry_double ,e),
|
||||
OPCODE(traced_trie_do_longint ,e),
|
||||
OPCODE(traced_trie_trust_longint ,e),
|
||||
OPCODE(traced_trie_try_longint ,e),
|
||||
OPCODE(traced_trie_retry_longint ,e),
|
||||
OPCODE(traced_trie_do_bigint ,e),
|
||||
OPCODE(traced_trie_trust_bigint ,e),
|
||||
OPCODE(traced_trie_try_bigint ,e),
|
||||
OPCODE(traced_trie_retry_bigint ,e),
|
||||
OPCODE(traced_trie_do_gterm ,e),
|
||||
OPCODE(traced_trie_trust_gterm ,e),
|
||||
OPCODE(traced_trie_try_gterm ,e),
|
||||
OPCODE(traced_trie_retry_gterm ,e),
|
||||
#endif
|
||||
#endif
|
||||
/* this instruction is hardwired */
|
||||
/* or_last must be the last instruction. */
|
||||
#ifdef YAP_JIT
|
||||
#ifdef YAPOR
|
||||
OPCODE(traced_or_last ,sblp),
|
||||
#else
|
||||
OPCODE(traced_or_last ,p),
|
||||
#endif
|
||||
#endif
|
||||
#ifdef YAPOR
|
||||
OPCODE(or_last ,sblp),
|
||||
#else
|
||||
|
35
H/absmi.h
35
H/absmi.h
@ -32,6 +32,11 @@ static char SccsId[] = "%W% %G%";
|
||||
#define Yapc_Compile(P) 0
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define register
|
||||
#endif
|
||||
|
||||
|
||||
/***************************************************************
|
||||
* Macros for register manipulation *
|
||||
***************************************************************/
|
||||
@ -416,7 +421,13 @@ restore_absmi_regs(REGSTORE * old_regs)
|
||||
|
||||
******************************************************************/
|
||||
|
||||
#if USE_THREADED_CODE
|
||||
#if __YAP_TRACED
|
||||
|
||||
#define DO_PREFETCH(TYPE)
|
||||
|
||||
#define DO_PREFETCH_W(TYPE)
|
||||
|
||||
#elif USE_THREADED_CODE
|
||||
|
||||
#ifndef _NATIVE
|
||||
|
||||
@ -626,7 +637,17 @@ restore_absmi_regs(REGSTORE * old_regs)
|
||||
|
||||
******************************************************************/
|
||||
|
||||
#if USE_THREADED_CODE
|
||||
#if __YAP_TRACED
|
||||
|
||||
#define JMP(Lab) { opcode = Yap_op_from_opcode( goto *Lab ); goto op_switch; }
|
||||
|
||||
#define JMPNext(Lab) { opcode = Yap_op_from_opcode( PREG->opc ) + ExpEnv.config_struc.current_displacement; goto op_switch; }
|
||||
|
||||
#define JMPNextW(Lab) { opcode = Yap_op_from_opcode( PREG->opcw ) + ExpEnv.config_struc.current_displacement; goto op_switch; }
|
||||
|
||||
|
||||
|
||||
#elif USE_THREADED_CODE
|
||||
|
||||
#ifndef _NATIVE
|
||||
|
||||
@ -2206,10 +2227,15 @@ extern char fin[1024];
|
||||
#ifndef _NATIVE
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include "JIT_Compiler.hpp"
|
||||
|
||||
extern struct JIT_Compiler *J;
|
||||
|
||||
void* (*Yap_JitCall)(JIT_Compiler* jc, yamop* p);
|
||||
void (* Yap_llvmShutdown)(void ) ;
|
||||
Int (* Yap_traced_absmi)(void ) ;
|
||||
extern JIT_Compiler *J;
|
||||
#endif
|
||||
|
||||
extern NativeContext *NativeArea;
|
||||
extern IntermediatecodeContext *IntermediatecodeArea;
|
||||
@ -2259,4 +2285,3 @@ yamop* headoftrace;
|
||||
#endif
|
||||
|
||||
#endif // ABSMI_H
|
||||
|
||||
|
@ -489,6 +489,9 @@ typedef struct jit_handl_context {
|
||||
CELL torecomp;
|
||||
}jitman;
|
||||
} JitHandlContext;
|
||||
|
||||
void **Yap_ABSMI_ControlLabels;
|
||||
|
||||
#endif /* YAP_JIT */
|
||||
|
||||
|
||||
|
@ -1533,12 +1533,6 @@
|
||||
cl = NEXTOP(cl,Otapl);
|
||||
break;
|
||||
#endif
|
||||
#ifdef YAP_JIT
|
||||
#ifdef YAPOR
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
clause->Tag = (CELL)NULL;
|
||||
return;
|
||||
|
@ -814,12 +814,6 @@
|
||||
cl = NEXTOP(cl,Otapl);
|
||||
break;
|
||||
#endif
|
||||
#ifdef YAP_JIT
|
||||
#ifdef YAPOR
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
clause->Tag = (CELL)NULL;
|
||||
return;
|
||||
|
897
H/rclause.h
897
H/rclause.h
@ -935,905 +935,8 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS)
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#ifdef YAP_JIT
|
||||
/* instructions type D */
|
||||
case _traced_write_dbterm:
|
||||
pc->y_u.D.D = DBGroundTermAdjust(pc->y_u.D.D);
|
||||
pc = NEXTOP(pc,D);
|
||||
break;
|
||||
/* instructions type Illss */
|
||||
case _traced_enter_lu_pred:
|
||||
pc->y_u.Illss.I = PtoLUIndexAdjust(pc->y_u.Illss.I);
|
||||
pc->y_u.Illss.l1 = PtoOpAdjust(pc->y_u.Illss.l1);
|
||||
pc->y_u.Illss.l2 = PtoOpAdjust(pc->y_u.Illss.l2);
|
||||
pc->y_u.Illss.s = ConstantAdjust(pc->y_u.Illss.s);
|
||||
pc->y_u.Illss.e = ConstantAdjust(pc->y_u.Illss.e);
|
||||
opc = NEXTOP(pc,Illss);
|
||||
pc = pc->y_u.Illss.l1;
|
||||
break;
|
||||
/* instructions type J */
|
||||
case _traced_jit_handler:
|
||||
/* instructions type L */
|
||||
case _traced_alloc_for_logical_pred:
|
||||
pc->y_u.L.ClBase = PtoLUClauseAdjust(pc->y_u.L.ClBase);
|
||||
pc = NEXTOP(pc,L);
|
||||
break;
|
||||
/* instructions type N */
|
||||
case _traced_write_bigint:
|
||||
pc->y_u.N.b = BlobTermInCodeAdjust(pc->y_u.N.b);
|
||||
pc = NEXTOP(pc,N);
|
||||
break;
|
||||
/* instructions type Osblp */
|
||||
case _traced_either:
|
||||
case _traced_or_else:
|
||||
OrArgAdjust(pc->y_u.Osblp.or_arg);
|
||||
pc->y_u.Osblp.s = ConstantAdjust(pc->y_u.Osblp.s);
|
||||
pc->y_u.Osblp.bmap = CellPtoHeapAdjust(pc->y_u.Osblp.bmap);
|
||||
pc->y_u.Osblp.l = PtoOpAdjust(pc->y_u.Osblp.l);
|
||||
pc->y_u.Osblp.p0 = PtoPredAdjust(pc->y_u.Osblp.p0);
|
||||
pc = NEXTOP(pc,Osblp);
|
||||
break;
|
||||
/* instructions type Osbmp */
|
||||
case _traced_p_execute:
|
||||
case _traced_p_execute_tail:
|
||||
OrArgAdjust(pc->y_u.Osbmp.or_arg);
|
||||
pc->y_u.Osbmp.s = ConstantAdjust(pc->y_u.Osbmp.s);
|
||||
pc->y_u.Osbmp.bmap = CellPtoHeapAdjust(pc->y_u.Osbmp.bmap);
|
||||
pc->y_u.Osbmp.mod = ModuleAdjust(pc->y_u.Osbmp.mod);
|
||||
pc->y_u.Osbmp.p0 = PtoPredAdjust(pc->y_u.Osbmp.p0);
|
||||
pc = NEXTOP(pc,Osbmp);
|
||||
break;
|
||||
/* instructions type Osbpa */
|
||||
case _traced_ensure_space:
|
||||
OrArgAdjust(pc->y_u.Osbpa.or_arg);
|
||||
pc->y_u.Osbpa.s = ConstantAdjust(pc->y_u.Osbpa.s);
|
||||
pc->y_u.Osbpa.bmap = CellPtoHeapAdjust(pc->y_u.Osbpa.bmap);
|
||||
pc->y_u.Osbpa.p = PtoPredAdjust(pc->y_u.Osbpa.p);
|
||||
pc->y_u.Osbpa.i = ArityAdjust(pc->y_u.Osbpa.i);
|
||||
pc = NEXTOP(pc,Osbpa);
|
||||
break;
|
||||
/* instructions type Osbpp */
|
||||
case _traced_call:
|
||||
case _traced_call_cpred:
|
||||
case _traced_call_usercpred:
|
||||
case _traced_fcall:
|
||||
case _traced_p_execute2:
|
||||
OrArgAdjust(pc->y_u.Osbpp.or_arg);
|
||||
pc->y_u.Osbpp.s = ConstantAdjust(pc->y_u.Osbpp.s);
|
||||
pc->y_u.Osbpp.bmap = CellPtoHeapAdjust(pc->y_u.Osbpp.bmap);
|
||||
pc->y_u.Osbpp.p = PtoPredAdjust(pc->y_u.Osbpp.p);
|
||||
pc->y_u.Osbpp.p0 = PtoPredAdjust(pc->y_u.Osbpp.p0);
|
||||
pc = NEXTOP(pc,Osbpp);
|
||||
break;
|
||||
/* instructions type OtILl */
|
||||
case _traced_count_trust_logical:
|
||||
case _traced_profiled_trust_logical:
|
||||
case _traced_trust_logical:
|
||||
OrArgAdjust(pc->y_u.OtILl.or_arg);
|
||||
TabEntryAdjust(pc->y_u.OtILl.te);
|
||||
pc->y_u.OtILl.block = PtoLUIndexAdjust(pc->y_u.OtILl.block);
|
||||
pc->y_u.OtILl.d = PtoLUClauseAdjust(pc->y_u.OtILl.d);
|
||||
pc->y_u.OtILl.n = PtoOpAdjust(pc->y_u.OtILl.n);
|
||||
pc = opc;
|
||||
break;
|
||||
/* instructions type OtaLl */
|
||||
case _traced_count_retry_logical:
|
||||
case _traced_profiled_retry_logical:
|
||||
case _traced_retry_logical:
|
||||
case _traced_try_logical:
|
||||
OrArgAdjust(pc->y_u.OtaLl.or_arg);
|
||||
TabEntryAdjust(pc->y_u.OtaLl.te);
|
||||
pc->y_u.OtaLl.s = ArityAdjust(pc->y_u.OtaLl.s);
|
||||
pc->y_u.OtaLl.d = PtoLUClauseAdjust(pc->y_u.OtaLl.d);
|
||||
pc->y_u.OtaLl.n = PtoOpAdjust(pc->y_u.OtaLl.n);
|
||||
pc = pc->y_u.OtaLl.n;
|
||||
break;
|
||||
/* instructions type OtapFs */
|
||||
case _traced_cut_c:
|
||||
case _traced_cut_userc:
|
||||
case _traced_retry_c:
|
||||
case _traced_retry_userc:
|
||||
case _traced_try_c:
|
||||
case _traced_try_userc:
|
||||
OrArgAdjust(pc->y_u.OtapFs.or_arg);
|
||||
TabEntryAdjust(pc->y_u.OtapFs.te);
|
||||
pc->y_u.OtapFs.s = ArityAdjust(pc->y_u.OtapFs.s);
|
||||
pc->y_u.OtapFs.p = PtoPredAdjust(pc->y_u.OtapFs.p);
|
||||
pc->y_u.OtapFs.f = ExternalFunctionAdjust(pc->y_u.OtapFs.f);
|
||||
pc->y_u.OtapFs.extra = ConstantAdjust(pc->y_u.OtapFs.extra);
|
||||
pc = NEXTOP(pc,OtapFs);
|
||||
break;
|
||||
/* instructions type Otapl */
|
||||
case _traced_count_retry_and_mark:
|
||||
case _traced_count_retry_me:
|
||||
case _traced_count_trust_me:
|
||||
case _traced_profiled_retry_and_mark:
|
||||
case _traced_profiled_retry_me:
|
||||
case _traced_profiled_trust_me:
|
||||
case _traced_retry:
|
||||
case _traced_retry_and_mark:
|
||||
case _traced_retry_me:
|
||||
case _traced_spy_or_trymark:
|
||||
case _traced_trust:
|
||||
case _traced_trust_me:
|
||||
case _traced_try_and_mark:
|
||||
case _traced_try_clause:
|
||||
case _traced_try_me:
|
||||
OrArgAdjust(pc->y_u.Otapl.or_arg);
|
||||
TabEntryAdjust(pc->y_u.Otapl.te);
|
||||
pc->y_u.Otapl.s = ArityAdjust(pc->y_u.Otapl.s);
|
||||
pc->y_u.Otapl.p = PtoPredAdjust(pc->y_u.Otapl.p);
|
||||
pc->y_u.Otapl.d = PtoOpAdjust(pc->y_u.Otapl.d);
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type c */
|
||||
case _traced_write_atom:
|
||||
pc->y_u.c.c = ConstantTermAdjust(pc->y_u.c.c);
|
||||
pc = NEXTOP(pc,c);
|
||||
break;
|
||||
/* instructions type cc */
|
||||
case _traced_get_2atoms:
|
||||
pc->y_u.cc.c1 = ConstantTermAdjust(pc->y_u.cc.c1);
|
||||
pc->y_u.cc.c2 = ConstantTermAdjust(pc->y_u.cc.c2);
|
||||
pc = NEXTOP(pc,cc);
|
||||
break;
|
||||
/* instructions type ccc */
|
||||
case _traced_get_3atoms:
|
||||
pc->y_u.ccc.c1 = ConstantTermAdjust(pc->y_u.ccc.c1);
|
||||
pc->y_u.ccc.c2 = ConstantTermAdjust(pc->y_u.ccc.c2);
|
||||
pc->y_u.ccc.c3 = ConstantTermAdjust(pc->y_u.ccc.c3);
|
||||
pc = NEXTOP(pc,ccc);
|
||||
break;
|
||||
/* instructions type cccc */
|
||||
case _traced_get_4atoms:
|
||||
pc->y_u.cccc.c1 = ConstantTermAdjust(pc->y_u.cccc.c1);
|
||||
pc->y_u.cccc.c2 = ConstantTermAdjust(pc->y_u.cccc.c2);
|
||||
pc->y_u.cccc.c3 = ConstantTermAdjust(pc->y_u.cccc.c3);
|
||||
pc->y_u.cccc.c4 = ConstantTermAdjust(pc->y_u.cccc.c4);
|
||||
pc = NEXTOP(pc,cccc);
|
||||
break;
|
||||
/* instructions type ccccc */
|
||||
case _traced_get_5atoms:
|
||||
pc->y_u.ccccc.c1 = ConstantTermAdjust(pc->y_u.ccccc.c1);
|
||||
pc->y_u.ccccc.c2 = ConstantTermAdjust(pc->y_u.ccccc.c2);
|
||||
pc->y_u.ccccc.c3 = ConstantTermAdjust(pc->y_u.ccccc.c3);
|
||||
pc->y_u.ccccc.c4 = ConstantTermAdjust(pc->y_u.ccccc.c4);
|
||||
pc->y_u.ccccc.c5 = ConstantTermAdjust(pc->y_u.ccccc.c5);
|
||||
pc = NEXTOP(pc,ccccc);
|
||||
break;
|
||||
/* instructions type cccccc */
|
||||
case _traced_get_6atoms:
|
||||
pc->y_u.cccccc.c1 = ConstantTermAdjust(pc->y_u.cccccc.c1);
|
||||
pc->y_u.cccccc.c2 = ConstantTermAdjust(pc->y_u.cccccc.c2);
|
||||
pc->y_u.cccccc.c3 = ConstantTermAdjust(pc->y_u.cccccc.c3);
|
||||
pc->y_u.cccccc.c4 = ConstantTermAdjust(pc->y_u.cccccc.c4);
|
||||
pc->y_u.cccccc.c5 = ConstantTermAdjust(pc->y_u.cccccc.c5);
|
||||
pc->y_u.cccccc.c6 = ConstantTermAdjust(pc->y_u.cccccc.c6);
|
||||
pc = NEXTOP(pc,cccccc);
|
||||
break;
|
||||
/* instructions type clll */
|
||||
case _traced_if_not_then:
|
||||
pc->y_u.clll.c = ConstantTermAdjust(pc->y_u.clll.c);
|
||||
pc->y_u.clll.l1 = PtoOpAdjust(pc->y_u.clll.l1);
|
||||
pc->y_u.clll.l2 = PtoOpAdjust(pc->y_u.clll.l2);
|
||||
pc->y_u.clll.l3 = PtoOpAdjust(pc->y_u.clll.l3);
|
||||
pc = NEXTOP(pc,clll);
|
||||
break;
|
||||
/* instructions type d */
|
||||
case _traced_write_float:
|
||||
DoubleInCodeAdjust(pc->y_u.d.d);
|
||||
pc = NEXTOP(pc,d);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_Nstop:
|
||||
case _traced_allocate:
|
||||
case _traced_copy_idb_term:
|
||||
case _traced_expand_index:
|
||||
case _traced_index_blob:
|
||||
case _traced_index_dbref:
|
||||
case _traced_index_long:
|
||||
case _traced_index_pred:
|
||||
case _traced_lock_pred:
|
||||
case _traced_op_fail:
|
||||
case _traced_p_equal:
|
||||
case _traced_p_functor:
|
||||
case _traced_pop:
|
||||
case _traced_retry_eam:
|
||||
case _traced_spy_pred:
|
||||
case _traced_thread_local:
|
||||
case _traced_trust_fail:
|
||||
case _traced_undef_p:
|
||||
case _traced_unify_idb_term:
|
||||
case _traced_unlock_lu:
|
||||
case _traced_write_l_list:
|
||||
case _traced_write_list:
|
||||
case _traced_write_void:
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
/* instructions type fa */
|
||||
case _traced_write_l_struc:
|
||||
case _traced_write_struct:
|
||||
pc->y_u.fa.f = FuncAdjust(pc->y_u.fa.f);
|
||||
pc->y_u.fa.a = ArityAdjust(pc->y_u.fa.a);
|
||||
pc = NEXTOP(pc,fa);
|
||||
break;
|
||||
/* instructions type i */
|
||||
case _traced_write_longint:
|
||||
IntegerInCodeAdjust(pc->y_u.i.i);
|
||||
pc = NEXTOP(pc,i);
|
||||
break;
|
||||
/* instructions type l */
|
||||
case _traced_Ystop:
|
||||
case _traced_jump:
|
||||
case _traced_jump_if_var:
|
||||
case _traced_move_back:
|
||||
case _traced_p_dif:
|
||||
case _traced_p_eq:
|
||||
case _traced_retry2:
|
||||
case _traced_retry3:
|
||||
case _traced_retry4:
|
||||
case _traced_skip:
|
||||
case _traced_try_clause2:
|
||||
case _traced_try_clause3:
|
||||
case _traced_try_clause4:
|
||||
case _traced_try_in:
|
||||
pc->y_u.l.l = PtoOpAdjust(pc->y_u.l.l);
|
||||
if (op == _Ystop) return;
|
||||
pc = NEXTOP(pc,l);
|
||||
break;
|
||||
/* instructions type llll */
|
||||
case _traced_switch_on_type:
|
||||
pc->y_u.llll.l1 = PtoOpAdjust(pc->y_u.llll.l1);
|
||||
pc->y_u.llll.l2 = PtoOpAdjust(pc->y_u.llll.l2);
|
||||
pc->y_u.llll.l3 = PtoOpAdjust(pc->y_u.llll.l3);
|
||||
pc->y_u.llll.l4 = PtoOpAdjust(pc->y_u.llll.l4);
|
||||
pc = NEXTOP(pc,llll);
|
||||
break;
|
||||
/* instructions type lp */
|
||||
case _traced_user_switch:
|
||||
pc->y_u.lp.l = PtoOpAdjust(pc->y_u.lp.l);
|
||||
pc->y_u.lp.p = PtoPredAdjust(pc->y_u.lp.p);
|
||||
pc = NEXTOP(pc,lp);
|
||||
break;
|
||||
/* instructions type o */
|
||||
case _traced_unify_l_list:
|
||||
case _traced_unify_l_list_write:
|
||||
case _traced_unify_l_void:
|
||||
case _traced_unify_l_void_write:
|
||||
case _traced_unify_list:
|
||||
case _traced_unify_list_write:
|
||||
case _traced_unify_void:
|
||||
case _traced_unify_void_write:
|
||||
pc->y_u.o.opcw = OpcodeAdjust(pc->y_u.o.opcw);
|
||||
pc = NEXTOP(pc,o);
|
||||
break;
|
||||
/* instructions type oD */
|
||||
case _traced_unify_dbterm:
|
||||
case _traced_unify_l_dbterm:
|
||||
pc->y_u.oD.opcw = OpcodeAdjust(pc->y_u.oD.opcw);
|
||||
pc->y_u.oD.D = DBGroundTermAdjust(pc->y_u.oD.D);
|
||||
pc = NEXTOP(pc,oD);
|
||||
break;
|
||||
/* instructions type oN */
|
||||
case _traced_unify_bigint:
|
||||
case _traced_unify_l_bigint:
|
||||
pc->y_u.oN.opcw = OpcodeAdjust(pc->y_u.oN.opcw);
|
||||
pc->y_u.oN.b = BlobTermInCodeAdjust(pc->y_u.oN.b);
|
||||
pc = NEXTOP(pc,oN);
|
||||
break;
|
||||
/* instructions type oc */
|
||||
case _traced_unify_atom:
|
||||
case _traced_unify_atom_write:
|
||||
case _traced_unify_l_atom:
|
||||
case _traced_unify_l_atom_write:
|
||||
pc->y_u.oc.opcw = OpcodeAdjust(pc->y_u.oc.opcw);
|
||||
pc->y_u.oc.c = ConstantTermAdjust(pc->y_u.oc.c);
|
||||
pc = NEXTOP(pc,oc);
|
||||
break;
|
||||
/* instructions type od */
|
||||
case _traced_unify_float:
|
||||
case _traced_unify_float_write:
|
||||
case _traced_unify_l_float:
|
||||
case _traced_unify_l_float_write:
|
||||
pc->y_u.od.opcw = OpcodeAdjust(pc->y_u.od.opcw);
|
||||
DoubleInCodeAdjust(pc->y_u.od.d);
|
||||
pc = NEXTOP(pc,od);
|
||||
break;
|
||||
/* instructions type ofa */
|
||||
case _traced_unify_l_struc:
|
||||
case _traced_unify_l_struc_write:
|
||||
case _traced_unify_struct:
|
||||
case _traced_unify_struct_write:
|
||||
pc->y_u.ofa.opcw = OpcodeAdjust(pc->y_u.ofa.opcw);
|
||||
pc->y_u.ofa.f = FuncAdjust(pc->y_u.ofa.f);
|
||||
pc->y_u.ofa.a = ArityAdjust(pc->y_u.ofa.a);
|
||||
pc = NEXTOP(pc,ofa);
|
||||
break;
|
||||
/* instructions type oi */
|
||||
case _traced_unify_l_longint:
|
||||
case _traced_unify_l_longint_write:
|
||||
case _traced_unify_longint:
|
||||
case _traced_unify_longint_write:
|
||||
pc->y_u.oi.opcw = OpcodeAdjust(pc->y_u.oi.opcw);
|
||||
IntegerInCodeAdjust(pc->y_u.oi.i);
|
||||
pc = NEXTOP(pc,oi);
|
||||
break;
|
||||
/* instructions type ollll */
|
||||
case _traced_switch_list_nl:
|
||||
pc->y_u.ollll.pop = OpcodeAdjust(pc->y_u.ollll.pop);
|
||||
pc->y_u.ollll.l1 = PtoOpAdjust(pc->y_u.ollll.l1);
|
||||
pc->y_u.ollll.l2 = PtoOpAdjust(pc->y_u.ollll.l2);
|
||||
pc->y_u.ollll.l3 = PtoOpAdjust(pc->y_u.ollll.l3);
|
||||
pc->y_u.ollll.l4 = PtoOpAdjust(pc->y_u.ollll.l4);
|
||||
pc = NEXTOP(pc,ollll);
|
||||
break;
|
||||
/* instructions type os */
|
||||
case _traced_run_eam:
|
||||
case _traced_unify_l_n_voids:
|
||||
case _traced_unify_l_n_voids_write:
|
||||
case _traced_unify_n_voids:
|
||||
case _traced_unify_n_voids_write:
|
||||
pc->y_u.os.opcw = OpcodeAdjust(pc->y_u.os.opcw);
|
||||
pc->y_u.os.s = ConstantAdjust(pc->y_u.os.s);
|
||||
pc = NEXTOP(pc,os);
|
||||
break;
|
||||
/* instructions type osc */
|
||||
case _traced_unify_n_atoms:
|
||||
case _traced_unify_n_atoms_write:
|
||||
pc->y_u.osc.opcw = OpcodeAdjust(pc->y_u.osc.opcw);
|
||||
pc->y_u.osc.s = ConstantAdjust(pc->y_u.osc.s);
|
||||
pc->y_u.osc.c = ConstantTermAdjust(pc->y_u.osc.c);
|
||||
pc = NEXTOP(pc,osc);
|
||||
break;
|
||||
/* instructions type ox */
|
||||
case _traced_save_appl_x:
|
||||
case _traced_save_appl_x_write:
|
||||
case _traced_save_pair_x:
|
||||
case _traced_save_pair_x_write:
|
||||
case _traced_unify_l_x_loc:
|
||||
case _traced_unify_l_x_loc_write:
|
||||
case _traced_unify_l_x_val:
|
||||
case _traced_unify_l_x_val_write:
|
||||
case _traced_unify_l_x_var:
|
||||
case _traced_unify_l_x_var_write:
|
||||
case _traced_unify_x_loc:
|
||||
case _traced_unify_x_loc_write:
|
||||
case _traced_unify_x_val:
|
||||
case _traced_unify_x_val_write:
|
||||
case _traced_unify_x_var:
|
||||
case _traced_unify_x_var_write:
|
||||
pc->y_u.ox.opcw = OpcodeAdjust(pc->y_u.ox.opcw);
|
||||
pc->y_u.ox.x = XAdjust(pc->y_u.ox.x);
|
||||
pc = NEXTOP(pc,ox);
|
||||
break;
|
||||
/* instructions type oxx */
|
||||
case _traced_unify_l_x_var2:
|
||||
case _traced_unify_l_x_var2_write:
|
||||
case _traced_unify_x_var2:
|
||||
case _traced_unify_x_var2_write:
|
||||
pc->y_u.oxx.opcw = OpcodeAdjust(pc->y_u.oxx.opcw);
|
||||
pc->y_u.oxx.xl = XAdjust(pc->y_u.oxx.xl);
|
||||
pc->y_u.oxx.xr = XAdjust(pc->y_u.oxx.xr);
|
||||
pc = NEXTOP(pc,oxx);
|
||||
break;
|
||||
/* instructions type oy */
|
||||
case _traced_save_appl_y:
|
||||
case _traced_save_appl_y_write:
|
||||
case _traced_save_pair_y:
|
||||
case _traced_save_pair_y_write:
|
||||
case _traced_unify_l_y_loc:
|
||||
case _traced_unify_l_y_loc_write:
|
||||
case _traced_unify_l_y_val:
|
||||
case _traced_unify_l_y_val_write:
|
||||
case _traced_unify_l_y_var:
|
||||
case _traced_unify_l_y_var_write:
|
||||
case _traced_unify_y_loc:
|
||||
case _traced_unify_y_loc_write:
|
||||
case _traced_unify_y_val:
|
||||
case _traced_unify_y_val_write:
|
||||
case _traced_unify_y_var:
|
||||
case _traced_unify_y_var_write:
|
||||
pc->y_u.oy.opcw = OpcodeAdjust(pc->y_u.oy.opcw);
|
||||
pc->y_u.oy.y = YAdjust(pc->y_u.oy.y);
|
||||
pc = NEXTOP(pc,oy);
|
||||
break;
|
||||
/* instructions type p */
|
||||
case _traced_count_call:
|
||||
case _traced_count_retry:
|
||||
case _traced_deallocate:
|
||||
case _traced_enter_profiling:
|
||||
case _traced_lock_lu:
|
||||
case _traced_procceed:
|
||||
case _traced_retry_profiled:
|
||||
pc->y_u.p.p = PtoPredAdjust(pc->y_u.p.p);
|
||||
pc = NEXTOP(pc,p);
|
||||
break;
|
||||
/* instructions type plxxs */
|
||||
case _traced_call_bfunc_xx:
|
||||
pc->y_u.plxxs.p = PtoPredAdjust(pc->y_u.plxxs.p);
|
||||
pc->y_u.plxxs.f = PtoOpAdjust(pc->y_u.plxxs.f);
|
||||
pc->y_u.plxxs.x1 = XAdjust(pc->y_u.plxxs.x1);
|
||||
pc->y_u.plxxs.x2 = XAdjust(pc->y_u.plxxs.x2);
|
||||
pc->y_u.plxxs.flags = ConstantAdjust(pc->y_u.plxxs.flags);
|
||||
pc = NEXTOP(pc,plxxs);
|
||||
break;
|
||||
/* instructions type plxys */
|
||||
case _traced_call_bfunc_xy:
|
||||
case _traced_call_bfunc_yx:
|
||||
pc->y_u.plxys.p = PtoPredAdjust(pc->y_u.plxys.p);
|
||||
pc->y_u.plxys.f = PtoOpAdjust(pc->y_u.plxys.f);
|
||||
pc->y_u.plxys.x = XAdjust(pc->y_u.plxys.x);
|
||||
pc->y_u.plxys.y = YAdjust(pc->y_u.plxys.y);
|
||||
pc->y_u.plxys.flags = ConstantAdjust(pc->y_u.plxys.flags);
|
||||
pc = NEXTOP(pc,plxys);
|
||||
break;
|
||||
/* instructions type plyys */
|
||||
case _traced_call_bfunc_yy:
|
||||
pc->y_u.plyys.p = PtoPredAdjust(pc->y_u.plyys.p);
|
||||
pc->y_u.plyys.f = PtoOpAdjust(pc->y_u.plyys.f);
|
||||
pc->y_u.plyys.y1 = YAdjust(pc->y_u.plyys.y1);
|
||||
pc->y_u.plyys.y2 = YAdjust(pc->y_u.plyys.y2);
|
||||
pc->y_u.plyys.flags = ConstantAdjust(pc->y_u.plyys.flags);
|
||||
pc = NEXTOP(pc,plyys);
|
||||
break;
|
||||
/* instructions type pp */
|
||||
case _traced_dexecute:
|
||||
case _traced_execute:
|
||||
case _traced_execute_cpred:
|
||||
pc->y_u.pp.p = PtoPredAdjust(pc->y_u.pp.p);
|
||||
pc->y_u.pp.p0 = PtoPredAdjust(pc->y_u.pp.p0);
|
||||
pc = NEXTOP(pc,pp);
|
||||
break;
|
||||
/* instructions type s */
|
||||
case _traced_cut:
|
||||
case _traced_cut_e:
|
||||
case _traced_cut_t:
|
||||
case _traced_pop_n:
|
||||
case _traced_write_n_voids:
|
||||
pc->y_u.s.s = ConstantAdjust(pc->y_u.s.s);
|
||||
pc = NEXTOP(pc,s);
|
||||
break;
|
||||
/* instructions type sc */
|
||||
case _traced_write_n_atoms:
|
||||
pc->y_u.sc.s = ConstantAdjust(pc->y_u.sc.s);
|
||||
pc->y_u.sc.c = ConstantTermAdjust(pc->y_u.sc.c);
|
||||
pc = NEXTOP(pc,sc);
|
||||
break;
|
||||
/* instructions type sllll */
|
||||
case _traced_switch_on_sub_arg_type:
|
||||
pc->y_u.sllll.s = ConstantAdjust(pc->y_u.sllll.s);
|
||||
pc->y_u.sllll.l1 = PtoOpAdjust(pc->y_u.sllll.l1);
|
||||
pc->y_u.sllll.l2 = PtoOpAdjust(pc->y_u.sllll.l2);
|
||||
pc->y_u.sllll.l3 = PtoOpAdjust(pc->y_u.sllll.l3);
|
||||
pc->y_u.sllll.l4 = PtoOpAdjust(pc->y_u.sllll.l4);
|
||||
pc = NEXTOP(pc,sllll);
|
||||
break;
|
||||
/* instructions type slp */
|
||||
case _traced_call_c_wfail:
|
||||
pc->y_u.slp.s = ConstantAdjust(pc->y_u.slp.s);
|
||||
pc->y_u.slp.l = PtoOpAdjust(pc->y_u.slp.l);
|
||||
pc->y_u.slp.p = PtoPredAdjust(pc->y_u.slp.p);
|
||||
pc = NEXTOP(pc,slp);
|
||||
break;
|
||||
/* instructions type sssl */
|
||||
case _traced_go_on_cons:
|
||||
case _traced_go_on_func:
|
||||
case _traced_if_cons:
|
||||
case _traced_if_func:
|
||||
case _traced_switch_on_cons:
|
||||
case _traced_switch_on_func:
|
||||
pc->y_u.sssl.s = ConstantAdjust(pc->y_u.sssl.s);
|
||||
pc->y_u.sssl.e = ConstantAdjust(pc->y_u.sssl.e);
|
||||
pc->y_u.sssl.w = ConstantAdjust(pc->y_u.sssl.w);
|
||||
pc->y_u.sssl.l = PtoOpAdjust(pc->y_u.sssl.l);
|
||||
AdjustSwitchTable(op, pc->y_u.sssl.l, pc->y_u.sssl.s);
|
||||
pc = NEXTOP(pc,sssl);
|
||||
break;
|
||||
/* instructions type sssllp */
|
||||
case _traced_expand_clauses:
|
||||
pc->y_u.sssllp.s1 = ConstantAdjust(pc->y_u.sssllp.s1);
|
||||
pc->y_u.sssllp.s2 = ConstantAdjust(pc->y_u.sssllp.s2);
|
||||
pc->y_u.sssllp.s3 = ConstantAdjust(pc->y_u.sssllp.s3);
|
||||
pc->y_u.sssllp.sprev = PtoOpAdjust(pc->y_u.sssllp.sprev);
|
||||
pc->y_u.sssllp.snext = PtoOpAdjust(pc->y_u.sssllp.snext);
|
||||
pc->y_u.sssllp.p = PtoPredAdjust(pc->y_u.sssllp.p);
|
||||
pc = NEXTOP(pc,sssllp);
|
||||
break;
|
||||
/* instructions type x */
|
||||
case _traced_get_list:
|
||||
case _traced_put_list:
|
||||
case _traced_save_b_x:
|
||||
case _traced_write_x_loc:
|
||||
case _traced_write_x_val:
|
||||
case _traced_write_x_var:
|
||||
pc->y_u.x.x = XAdjust(pc->y_u.x.x);
|
||||
pc = NEXTOP(pc,x);
|
||||
break;
|
||||
/* instructions type xD */
|
||||
case _traced_get_dbterm:
|
||||
case _traced_put_dbterm:
|
||||
pc->y_u.xD.x = XAdjust(pc->y_u.xD.x);
|
||||
pc->y_u.xD.D = DBGroundTermAdjust(pc->y_u.xD.D);
|
||||
pc = NEXTOP(pc,xD);
|
||||
break;
|
||||
/* instructions type xN */
|
||||
case _traced_get_bigint:
|
||||
case _traced_put_bigint:
|
||||
pc->y_u.xN.x = XAdjust(pc->y_u.xN.x);
|
||||
pc->y_u.xN.b = BlobTermInCodeAdjust(pc->y_u.xN.b);
|
||||
pc = NEXTOP(pc,xN);
|
||||
break;
|
||||
/* instructions type xc */
|
||||
case _traced_get_atom:
|
||||
case _traced_put_atom:
|
||||
pc->y_u.xc.x = XAdjust(pc->y_u.xc.x);
|
||||
pc->y_u.xc.c = ConstantTermAdjust(pc->y_u.xc.c);
|
||||
pc = NEXTOP(pc,xc);
|
||||
break;
|
||||
/* instructions type xd */
|
||||
case _traced_get_float:
|
||||
case _traced_put_float:
|
||||
pc->y_u.xd.x = XAdjust(pc->y_u.xd.x);
|
||||
DoubleInCodeAdjust(pc->y_u.xd.d);
|
||||
pc = NEXTOP(pc,xd);
|
||||
break;
|
||||
/* instructions type xfa */
|
||||
case _traced_get_struct:
|
||||
case _traced_put_struct:
|
||||
pc->y_u.xfa.x = XAdjust(pc->y_u.xfa.x);
|
||||
pc->y_u.xfa.f = FuncAdjust(pc->y_u.xfa.f);
|
||||
pc->y_u.xfa.a = ArityAdjust(pc->y_u.xfa.a);
|
||||
pc = NEXTOP(pc,xfa);
|
||||
break;
|
||||
/* instructions type xi */
|
||||
case _traced_get_longint:
|
||||
case _traced_put_longint:
|
||||
pc->y_u.xi.x = XAdjust(pc->y_u.xi.x);
|
||||
IntegerInCodeAdjust(pc->y_u.xi.i);
|
||||
pc = NEXTOP(pc,xi);
|
||||
break;
|
||||
/* instructions type xl */
|
||||
case _traced_p_atom_x:
|
||||
case _traced_p_atomic_x:
|
||||
case _traced_p_compound_x:
|
||||
case _traced_p_db_ref_x:
|
||||
case _traced_p_float_x:
|
||||
case _traced_p_integer_x:
|
||||
case _traced_p_nonvar_x:
|
||||
case _traced_p_number_x:
|
||||
case _traced_p_primitive_x:
|
||||
case _traced_p_var_x:
|
||||
pc->y_u.xl.x = XAdjust(pc->y_u.xl.x);
|
||||
pc->y_u.xl.F = PtoOpAdjust(pc->y_u.xl.F);
|
||||
pc = NEXTOP(pc,xl);
|
||||
break;
|
||||
/* instructions type xll */
|
||||
case _traced_jump_if_nonvar:
|
||||
pc->y_u.xll.x = XAdjust(pc->y_u.xll.x);
|
||||
pc->y_u.xll.l1 = PtoOpAdjust(pc->y_u.xll.l1);
|
||||
pc->y_u.xll.l2 = PtoOpAdjust(pc->y_u.xll.l2);
|
||||
pc = NEXTOP(pc,xll);
|
||||
break;
|
||||
/* instructions type xllll */
|
||||
case _traced_switch_on_arg_type:
|
||||
pc->y_u.xllll.x = XAdjust(pc->y_u.xllll.x);
|
||||
pc->y_u.xllll.l1 = PtoOpAdjust(pc->y_u.xllll.l1);
|
||||
pc->y_u.xllll.l2 = PtoOpAdjust(pc->y_u.xllll.l2);
|
||||
pc->y_u.xllll.l3 = PtoOpAdjust(pc->y_u.xllll.l3);
|
||||
pc->y_u.xllll.l4 = PtoOpAdjust(pc->y_u.xllll.l4);
|
||||
pc = NEXTOP(pc,xllll);
|
||||
break;
|
||||
/* instructions type xps */
|
||||
case _traced_commit_b_x:
|
||||
pc->y_u.xps.x = XAdjust(pc->y_u.xps.x);
|
||||
pc->y_u.xps.p0 = PtoPredAdjust(pc->y_u.xps.p0);
|
||||
pc->y_u.xps.s = ConstantAdjust(pc->y_u.xps.s);
|
||||
pc = NEXTOP(pc,xps);
|
||||
break;
|
||||
/* instructions type xx */
|
||||
case _traced_get_x_val:
|
||||
case _traced_get_x_var:
|
||||
case _traced_gl_void_valx:
|
||||
case _traced_gl_void_varx:
|
||||
case _traced_glist_valx:
|
||||
case _traced_put_x_val:
|
||||
case _traced_put_x_var:
|
||||
pc->y_u.xx.xl = XAdjust(pc->y_u.xx.xl);
|
||||
pc->y_u.xx.xr = XAdjust(pc->y_u.xx.xr);
|
||||
pc = NEXTOP(pc,xx);
|
||||
break;
|
||||
/* instructions type xxc */
|
||||
case _traced_p_func2s_cv:
|
||||
pc->y_u.xxc.x = XAdjust(pc->y_u.xxc.x);
|
||||
pc->y_u.xxc.xi = XAdjust(pc->y_u.xxc.xi);
|
||||
pc->y_u.xxc.c = ConstantTermAdjust(pc->y_u.xxc.c);
|
||||
pc = NEXTOP(pc,xxc);
|
||||
break;
|
||||
/* instructions type xxn */
|
||||
case _traced_p_and_vc:
|
||||
case _traced_p_arg_cv:
|
||||
case _traced_p_div_cv:
|
||||
case _traced_p_div_vc:
|
||||
case _traced_p_func2s_vc:
|
||||
case _traced_p_minus_cv:
|
||||
case _traced_p_or_vc:
|
||||
case _traced_p_plus_vc:
|
||||
case _traced_p_sll_cv:
|
||||
case _traced_p_sll_vc:
|
||||
case _traced_p_slr_cv:
|
||||
case _traced_p_slr_vc:
|
||||
case _traced_p_times_vc:
|
||||
pc->y_u.xxn.x = XAdjust(pc->y_u.xxn.x);
|
||||
pc->y_u.xxn.xi = XAdjust(pc->y_u.xxn.xi);
|
||||
pc->y_u.xxn.c = IntegerAdjust(pc->y_u.xxn.c);
|
||||
pc = NEXTOP(pc,xxn);
|
||||
break;
|
||||
/* instructions type xxx */
|
||||
case _traced_p_and_vv:
|
||||
case _traced_p_arg_vv:
|
||||
case _traced_p_div_vv:
|
||||
case _traced_p_func2f_xx:
|
||||
case _traced_p_func2s_vv:
|
||||
case _traced_p_minus_vv:
|
||||
case _traced_p_or_vv:
|
||||
case _traced_p_plus_vv:
|
||||
case _traced_p_sll_vv:
|
||||
case _traced_p_slr_vv:
|
||||
case _traced_p_times_vv:
|
||||
pc->y_u.xxx.x = XAdjust(pc->y_u.xxx.x);
|
||||
pc->y_u.xxx.x1 = XAdjust(pc->y_u.xxx.x1);
|
||||
pc->y_u.xxx.x2 = XAdjust(pc->y_u.xxx.x2);
|
||||
pc = NEXTOP(pc,xxx);
|
||||
break;
|
||||
/* instructions type xxxx */
|
||||
case _traced_put_xx_val:
|
||||
pc->y_u.xxxx.xl1 = XAdjust(pc->y_u.xxxx.xl1);
|
||||
pc->y_u.xxxx.xl2 = XAdjust(pc->y_u.xxxx.xl2);
|
||||
pc->y_u.xxxx.xr1 = XAdjust(pc->y_u.xxxx.xr1);
|
||||
pc->y_u.xxxx.xr2 = XAdjust(pc->y_u.xxxx.xr2);
|
||||
pc = NEXTOP(pc,xxxx);
|
||||
break;
|
||||
/* instructions type xxy */
|
||||
case _traced_p_func2f_xy:
|
||||
pc->y_u.xxy.x = XAdjust(pc->y_u.xxy.x);
|
||||
pc->y_u.xxy.x1 = XAdjust(pc->y_u.xxy.x1);
|
||||
pc->y_u.xxy.y2 = YAdjust(pc->y_u.xxy.y2);
|
||||
pc = NEXTOP(pc,xxy);
|
||||
break;
|
||||
/* instructions type y */
|
||||
case _traced_save_b_y:
|
||||
case _traced_write_y_loc:
|
||||
case _traced_write_y_val:
|
||||
case _traced_write_y_var:
|
||||
pc->y_u.y.y = YAdjust(pc->y_u.y.y);
|
||||
pc = NEXTOP(pc,y);
|
||||
break;
|
||||
/* instructions type yl */
|
||||
case _traced_p_atom_y:
|
||||
case _traced_p_atomic_y:
|
||||
case _traced_p_compound_y:
|
||||
case _traced_p_db_ref_y:
|
||||
case _traced_p_float_y:
|
||||
case _traced_p_integer_y:
|
||||
case _traced_p_nonvar_y:
|
||||
case _traced_p_number_y:
|
||||
case _traced_p_primitive_y:
|
||||
case _traced_p_var_y:
|
||||
pc->y_u.yl.y = YAdjust(pc->y_u.yl.y);
|
||||
pc->y_u.yl.F = PtoOpAdjust(pc->y_u.yl.F);
|
||||
pc = NEXTOP(pc,yl);
|
||||
break;
|
||||
/* instructions type yps */
|
||||
case _traced_commit_b_y:
|
||||
pc->y_u.yps.y = YAdjust(pc->y_u.yps.y);
|
||||
pc->y_u.yps.p0 = PtoPredAdjust(pc->y_u.yps.p0);
|
||||
pc->y_u.yps.s = ConstantAdjust(pc->y_u.yps.s);
|
||||
pc = NEXTOP(pc,yps);
|
||||
break;
|
||||
/* instructions type yx */
|
||||
case _traced_get_y_val:
|
||||
case _traced_get_y_var:
|
||||
case _traced_gl_void_valy:
|
||||
case _traced_gl_void_vary:
|
||||
case _traced_glist_valy:
|
||||
case _traced_put_unsafe:
|
||||
case _traced_put_y_val:
|
||||
case _traced_put_y_var:
|
||||
pc->y_u.yx.y = YAdjust(pc->y_u.yx.y);
|
||||
pc->y_u.yx.x = XAdjust(pc->y_u.yx.x);
|
||||
pc = NEXTOP(pc,yx);
|
||||
break;
|
||||
/* instructions type yxn */
|
||||
case _traced_p_and_y_vc:
|
||||
case _traced_p_arg_y_cv:
|
||||
case _traced_p_div_y_cv:
|
||||
case _traced_p_div_y_vc:
|
||||
case _traced_p_func2s_y_cv:
|
||||
case _traced_p_func2s_y_vc:
|
||||
case _traced_p_minus_y_cv:
|
||||
case _traced_p_or_y_vc:
|
||||
case _traced_p_plus_y_vc:
|
||||
case _traced_p_sll_y_cv:
|
||||
case _traced_p_sll_y_vc:
|
||||
case _traced_p_slr_y_cv:
|
||||
case _traced_p_slr_y_vc:
|
||||
case _traced_p_times_y_vc:
|
||||
pc->y_u.yxn.y = YAdjust(pc->y_u.yxn.y);
|
||||
pc->y_u.yxn.xi = XAdjust(pc->y_u.yxn.xi);
|
||||
pc->y_u.yxn.c = IntegerAdjust(pc->y_u.yxn.c);
|
||||
pc = NEXTOP(pc,yxn);
|
||||
break;
|
||||
/* instructions type yxx */
|
||||
case _traced_p_and_y_vv:
|
||||
case _traced_p_arg_y_vv:
|
||||
case _traced_p_div_y_vv:
|
||||
case _traced_p_func2f_yx:
|
||||
case _traced_p_func2s_y_vv:
|
||||
case _traced_p_minus_y_vv:
|
||||
case _traced_p_or_y_vv:
|
||||
case _traced_p_plus_y_vv:
|
||||
case _traced_p_sll_y_vv:
|
||||
case _traced_p_slr_y_vv:
|
||||
case _traced_p_times_y_vv:
|
||||
pc->y_u.yxx.y = YAdjust(pc->y_u.yxx.y);
|
||||
pc->y_u.yxx.x1 = XAdjust(pc->y_u.yxx.x1);
|
||||
pc->y_u.yxx.x2 = XAdjust(pc->y_u.yxx.x2);
|
||||
pc = NEXTOP(pc,yxx);
|
||||
break;
|
||||
/* instructions type yyx */
|
||||
case _traced_p_func2f_yy:
|
||||
pc->y_u.yyx.y1 = YAdjust(pc->y_u.yyx.y1);
|
||||
pc->y_u.yyx.y2 = YAdjust(pc->y_u.yyx.y2);
|
||||
pc->y_u.yyx.x = XAdjust(pc->y_u.yyx.x);
|
||||
pc = NEXTOP(pc,yyx);
|
||||
break;
|
||||
/* instructions type yyxx */
|
||||
case _traced_get_yy_var:
|
||||
case _traced_put_y_vals:
|
||||
pc->y_u.yyxx.y1 = YAdjust(pc->y_u.yyxx.y1);
|
||||
pc->y_u.yyxx.y2 = YAdjust(pc->y_u.yyxx.y2);
|
||||
pc->y_u.yyxx.x1 = XAdjust(pc->y_u.yyxx.x1);
|
||||
pc->y_u.yyxx.x2 = XAdjust(pc->y_u.yyxx.x2);
|
||||
pc = NEXTOP(pc,yyxx);
|
||||
break;
|
||||
#ifdef YAPOR
|
||||
/* instructions type Otapl */
|
||||
case _traced_getwork:
|
||||
case _traced_getwork_seq:
|
||||
case _traced_sync:
|
||||
OrArgAdjust(pc->y_u.Otapl.or_arg);
|
||||
TabEntryAdjust(pc->y_u.Otapl.te);
|
||||
pc->y_u.Otapl.s = ArityAdjust(pc->y_u.Otapl.s);
|
||||
pc->y_u.Otapl.p = PtoPredAdjust(pc->y_u.Otapl.p);
|
||||
pc->y_u.Otapl.d = PtoOpAdjust(pc->y_u.Otapl.d);
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_getwork_first_time:
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
/* instructions type Otapl */
|
||||
case _traced_table_answer_resolution:
|
||||
case _traced_table_answer_resolution_completion:
|
||||
case _traced_table_completion:
|
||||
case _traced_table_load_answer:
|
||||
case _traced_table_retry:
|
||||
case _traced_table_retry_me:
|
||||
case _traced_table_trust:
|
||||
case _traced_table_trust_me:
|
||||
case _traced_table_try:
|
||||
case _traced_table_try_answer:
|
||||
case _traced_table_try_me:
|
||||
case _traced_table_try_single:
|
||||
OrArgAdjust(pc->y_u.Otapl.or_arg);
|
||||
TabEntryAdjust(pc->y_u.Otapl.te);
|
||||
pc->y_u.Otapl.s = ArityAdjust(pc->y_u.Otapl.s);
|
||||
pc->y_u.Otapl.p = PtoPredAdjust(pc->y_u.Otapl.p);
|
||||
pc->y_u.Otapl.d = PtoOpAdjust(pc->y_u.Otapl.d);
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_clause_with_cut:
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
/* instructions type s */
|
||||
case _traced_table_new_answer:
|
||||
pc->y_u.s.s = ConstantAdjust(pc->y_u.s.s);
|
||||
pc = NEXTOP(pc,s);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_trie_do_appl:
|
||||
case _traced_trie_do_appl_in_pair:
|
||||
case _traced_trie_do_atom:
|
||||
case _traced_trie_do_atom_in_pair:
|
||||
case _traced_trie_do_bigint:
|
||||
case _traced_trie_do_double:
|
||||
case _traced_trie_do_extension:
|
||||
case _traced_trie_do_gterm:
|
||||
case _traced_trie_do_longint:
|
||||
case _traced_trie_do_null:
|
||||
case _traced_trie_do_null_in_pair:
|
||||
case _traced_trie_do_pair:
|
||||
case _traced_trie_do_val:
|
||||
case _traced_trie_do_val_in_pair:
|
||||
case _traced_trie_do_var:
|
||||
case _traced_trie_do_var_in_pair:
|
||||
case _traced_trie_retry_appl:
|
||||
case _traced_trie_retry_appl_in_pair:
|
||||
case _traced_trie_retry_atom:
|
||||
case _traced_trie_retry_atom_in_pair:
|
||||
case _traced_trie_retry_bigint:
|
||||
case _traced_trie_retry_double:
|
||||
case _traced_trie_retry_extension:
|
||||
case _traced_trie_retry_gterm:
|
||||
case _traced_trie_retry_longint:
|
||||
case _traced_trie_retry_null:
|
||||
case _traced_trie_retry_null_in_pair:
|
||||
case _traced_trie_retry_pair:
|
||||
case _traced_trie_retry_val:
|
||||
case _traced_trie_retry_val_in_pair:
|
||||
case _traced_trie_retry_var:
|
||||
case _traced_trie_retry_var_in_pair:
|
||||
case _traced_trie_trust_appl:
|
||||
case _traced_trie_trust_appl_in_pair:
|
||||
case _traced_trie_trust_atom:
|
||||
case _traced_trie_trust_atom_in_pair:
|
||||
case _traced_trie_trust_bigint:
|
||||
case _traced_trie_trust_double:
|
||||
case _traced_trie_trust_extension:
|
||||
case _traced_trie_trust_gterm:
|
||||
case _traced_trie_trust_longint:
|
||||
case _traced_trie_trust_null:
|
||||
case _traced_trie_trust_null_in_pair:
|
||||
case _traced_trie_trust_pair:
|
||||
case _traced_trie_trust_val:
|
||||
case _traced_trie_trust_val_in_pair:
|
||||
case _traced_trie_trust_var:
|
||||
case _traced_trie_trust_var_in_pair:
|
||||
case _traced_trie_try_appl:
|
||||
case _traced_trie_try_appl_in_pair:
|
||||
case _traced_trie_try_atom:
|
||||
case _traced_trie_try_atom_in_pair:
|
||||
case _traced_trie_try_bigint:
|
||||
case _traced_trie_try_double:
|
||||
case _traced_trie_try_extension:
|
||||
case _traced_trie_try_gterm:
|
||||
case _traced_trie_try_longint:
|
||||
case _traced_trie_try_null:
|
||||
case _traced_trie_try_null_in_pair:
|
||||
case _traced_trie_try_pair:
|
||||
case _traced_trie_try_val:
|
||||
case _traced_trie_try_val_in_pair:
|
||||
case _traced_trie_try_var:
|
||||
case _traced_trie_try_var_in_pair:
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
/* this instruction is hardwired */
|
||||
#ifdef YAP_JIT
|
||||
case _traced_or_last:
|
||||
#ifdef YAPOR
|
||||
OrArgAdjust(pc->y_u.Osblp.or_arg);
|
||||
pc->y_u.Osblp.s = ConstantAdjust(pc->y_u.Osblp.s);
|
||||
pc->y_u.Osblp.bmap = CellPtoHeapAdjust(pc->y_u.Osblp.bmap);
|
||||
pc->y_u.Osblp.l = PtoOpAdjust(pc->y_u.Osblp.l);
|
||||
pc->y_u.Osblp.p0 = PtoPredAdjust(pc->y_u.Osblp.p0);
|
||||
pc = NEXTOP(pc,Osblp);
|
||||
break;
|
||||
#else
|
||||
pc->y_u.p.p = PtoPredAdjust(pc->y_u.p.p);
|
||||
pc = NEXTOP(pc,p);
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case _or_last:
|
||||
#ifdef YAPOR
|
||||
OrArgAdjust(pc->y_u.Osblp.or_arg);
|
||||
|
910
H/saveclause.h
910
H/saveclause.h
@ -960,916 +960,6 @@
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#ifdef YAP_JIT
|
||||
/* instructions type D */
|
||||
case _traced_write_dbterm:
|
||||
CHECK(save_DBGroundTerm(stream, pc->y_u.D.D));
|
||||
pc = NEXTOP(pc,D);
|
||||
break;
|
||||
/* instructions type Illss */
|
||||
case _traced_enter_lu_pred:
|
||||
CHECK(save_PtoLUIndex(stream, pc->y_u.Illss.I));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.Illss.l1));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.Illss.l2));
|
||||
CHECK(save_Constant(stream, pc->y_u.Illss.s));
|
||||
CHECK(save_Constant(stream, pc->y_u.Illss.e));
|
||||
pc = NEXTOP(pc,Illss);
|
||||
break;
|
||||
/* instructions type J */
|
||||
case _traced_jit_handler:
|
||||
/* instructions type L */
|
||||
case _traced_alloc_for_logical_pred:
|
||||
CHECK(save_PtoLUClause(stream, pc->y_u.L.ClBase));
|
||||
pc = NEXTOP(pc,L);
|
||||
break;
|
||||
/* instructions type N */
|
||||
case _traced_write_bigint:
|
||||
CHECK(save_BlobTermInCode(stream, pc->y_u.N.b));
|
||||
pc = NEXTOP(pc,N);
|
||||
break;
|
||||
/* instructions type Osblp */
|
||||
case _traced_either:
|
||||
case _traced_or_else:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.Osblp.or_arg));
|
||||
#endif
|
||||
CHECK(save_Constant(stream, pc->y_u.Osblp.s));
|
||||
CHECK(save_CellPtoHeap(stream, pc->y_u.Osblp.bmap));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.Osblp.l));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.Osblp.p0));
|
||||
pc = NEXTOP(pc,Osblp);
|
||||
break;
|
||||
/* instructions type Osbmp */
|
||||
case _traced_p_execute:
|
||||
case _traced_p_execute_tail:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.Osbmp.or_arg));
|
||||
#endif
|
||||
CHECK(save_Constant(stream, pc->y_u.Osbmp.s));
|
||||
CHECK(save_CellPtoHeap(stream, pc->y_u.Osbmp.bmap));
|
||||
CHECK(save_Module(stream, pc->y_u.Osbmp.mod));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.Osbmp.p0));
|
||||
pc = NEXTOP(pc,Osbmp);
|
||||
break;
|
||||
/* instructions type Osbpa */
|
||||
case _traced_ensure_space:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.Osbpa.or_arg));
|
||||
#endif
|
||||
CHECK(save_Constant(stream, pc->y_u.Osbpa.s));
|
||||
CHECK(save_CellPtoHeap(stream, pc->y_u.Osbpa.bmap));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.Osbpa.p));
|
||||
CHECK(save_Arity(stream, pc->y_u.Osbpa.i));
|
||||
pc = NEXTOP(pc,Osbpa);
|
||||
break;
|
||||
/* instructions type Osbpp */
|
||||
case _traced_call:
|
||||
case _traced_call_cpred:
|
||||
case _traced_call_usercpred:
|
||||
case _traced_fcall:
|
||||
case _traced_p_execute2:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.Osbpp.or_arg));
|
||||
#endif
|
||||
CHECK(save_Constant(stream, pc->y_u.Osbpp.s));
|
||||
CHECK(save_CellPtoHeap(stream, pc->y_u.Osbpp.bmap));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.Osbpp.p));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.Osbpp.p0));
|
||||
pc = NEXTOP(pc,Osbpp);
|
||||
break;
|
||||
/* instructions type OtILl */
|
||||
case _traced_count_trust_logical:
|
||||
case _traced_profiled_trust_logical:
|
||||
case _traced_trust_logical:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.OtILl.or_arg));
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
CHECK(save_TabEntry(stream, pc->y_u.OtILl.te));
|
||||
#endif
|
||||
CHECK(save_PtoLUIndex(stream, pc->y_u.OtILl.block));
|
||||
CHECK(save_PtoLUClause(stream, pc->y_u.OtILl.d));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.OtILl.n));
|
||||
pc = NEXTOP(pc,OtILl);
|
||||
break;
|
||||
/* instructions type OtaLl */
|
||||
case _traced_count_retry_logical:
|
||||
case _traced_profiled_retry_logical:
|
||||
case _traced_retry_logical:
|
||||
case _traced_try_logical:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.OtaLl.or_arg));
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
CHECK(save_TabEntry(stream, pc->y_u.OtaLl.te));
|
||||
#endif
|
||||
CHECK(save_Arity(stream, pc->y_u.OtaLl.s));
|
||||
CHECK(save_PtoLUClause(stream, pc->y_u.OtaLl.d));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.OtaLl.n));
|
||||
pc = NEXTOP(pc,OtaLl);
|
||||
break;
|
||||
/* instructions type OtapFs */
|
||||
case _traced_cut_c:
|
||||
case _traced_cut_userc:
|
||||
case _traced_retry_c:
|
||||
case _traced_retry_userc:
|
||||
case _traced_try_c:
|
||||
case _traced_try_userc:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.OtapFs.or_arg));
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
CHECK(save_TabEntry(stream, pc->y_u.OtapFs.te));
|
||||
#endif
|
||||
CHECK(save_Arity(stream, pc->y_u.OtapFs.s));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.OtapFs.p));
|
||||
CHECK(save_ExternalFunction(stream, pc->y_u.OtapFs.f));
|
||||
CHECK(save_Constant(stream, pc->y_u.OtapFs.extra));
|
||||
pc = NEXTOP(pc,OtapFs);
|
||||
break;
|
||||
/* instructions type Otapl */
|
||||
case _traced_count_retry_and_mark:
|
||||
case _traced_count_retry_me:
|
||||
case _traced_count_trust_me:
|
||||
case _traced_profiled_retry_and_mark:
|
||||
case _traced_profiled_retry_me:
|
||||
case _traced_profiled_trust_me:
|
||||
case _traced_retry:
|
||||
case _traced_retry_and_mark:
|
||||
case _traced_retry_me:
|
||||
case _traced_spy_or_trymark:
|
||||
case _traced_trust:
|
||||
case _traced_trust_me:
|
||||
case _traced_try_and_mark:
|
||||
case _traced_try_clause:
|
||||
case _traced_try_me:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.Otapl.or_arg));
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
CHECK(save_TabEntry(stream, pc->y_u.Otapl.te));
|
||||
#endif
|
||||
CHECK(save_Arity(stream, pc->y_u.Otapl.s));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.Otapl.p));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.Otapl.d));
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type c */
|
||||
case _traced_write_atom:
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.c.c));
|
||||
pc = NEXTOP(pc,c);
|
||||
break;
|
||||
/* instructions type cc */
|
||||
case _traced_get_2atoms:
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cc.c1));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cc.c2));
|
||||
pc = NEXTOP(pc,cc);
|
||||
break;
|
||||
/* instructions type ccc */
|
||||
case _traced_get_3atoms:
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.ccc.c1));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.ccc.c2));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.ccc.c3));
|
||||
pc = NEXTOP(pc,ccc);
|
||||
break;
|
||||
/* instructions type cccc */
|
||||
case _traced_get_4atoms:
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccc.c1));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccc.c2));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccc.c3));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccc.c4));
|
||||
pc = NEXTOP(pc,cccc);
|
||||
break;
|
||||
/* instructions type ccccc */
|
||||
case _traced_get_5atoms:
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c1));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c2));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c3));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c4));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.ccccc.c5));
|
||||
pc = NEXTOP(pc,ccccc);
|
||||
break;
|
||||
/* instructions type cccccc */
|
||||
case _traced_get_6atoms:
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c1));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c2));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c3));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c4));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c5));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.cccccc.c6));
|
||||
pc = NEXTOP(pc,cccccc);
|
||||
break;
|
||||
/* instructions type clll */
|
||||
case _traced_if_not_then:
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.clll.c));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.clll.l1));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.clll.l2));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.clll.l3));
|
||||
pc = NEXTOP(pc,clll);
|
||||
break;
|
||||
/* instructions type d */
|
||||
case _traced_write_float:
|
||||
CHECK(save_DoubleInCode(stream, pc->y_u.d.d));
|
||||
pc = NEXTOP(pc,d);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_Nstop:
|
||||
case _traced_allocate:
|
||||
case _traced_copy_idb_term:
|
||||
case _traced_expand_index:
|
||||
case _traced_index_blob:
|
||||
case _traced_index_dbref:
|
||||
case _traced_index_long:
|
||||
case _traced_index_pred:
|
||||
case _traced_lock_pred:
|
||||
case _traced_op_fail:
|
||||
case _traced_p_equal:
|
||||
case _traced_p_functor:
|
||||
case _traced_pop:
|
||||
case _traced_retry_eam:
|
||||
case _traced_spy_pred:
|
||||
case _traced_thread_local:
|
||||
case _traced_trust_fail:
|
||||
case _traced_undef_p:
|
||||
case _traced_unify_idb_term:
|
||||
case _traced_unlock_lu:
|
||||
case _traced_write_l_list:
|
||||
case _traced_write_list:
|
||||
case _traced_write_void:
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
/* instructions type fa */
|
||||
case _traced_write_l_struc:
|
||||
case _traced_write_struct:
|
||||
CHECK(save_Func(stream, pc->y_u.fa.f));
|
||||
CHECK(save_Arity(stream, pc->y_u.fa.a));
|
||||
pc = NEXTOP(pc,fa);
|
||||
break;
|
||||
/* instructions type i */
|
||||
case _traced_write_longint:
|
||||
CHECK(save_IntegerInCode(stream, pc->y_u.i.i));
|
||||
pc = NEXTOP(pc,i);
|
||||
break;
|
||||
/* instructions type l */
|
||||
case _traced_Ystop:
|
||||
case _traced_jump:
|
||||
case _traced_jump_if_var:
|
||||
case _traced_move_back:
|
||||
case _traced_p_dif:
|
||||
case _traced_p_eq:
|
||||
case _traced_retry2:
|
||||
case _traced_retry3:
|
||||
case _traced_retry4:
|
||||
case _traced_skip:
|
||||
case _traced_try_clause2:
|
||||
case _traced_try_clause3:
|
||||
case _traced_try_clause4:
|
||||
case _traced_try_in:
|
||||
CHECK(save_PtoOp(stream, pc->y_u.l.l));
|
||||
pc = NEXTOP(pc,l);
|
||||
break;
|
||||
/* instructions type llll */
|
||||
case _traced_switch_on_type:
|
||||
CHECK(save_PtoOp(stream, pc->y_u.llll.l1));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.llll.l2));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.llll.l3));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.llll.l4));
|
||||
pc = NEXTOP(pc,llll);
|
||||
break;
|
||||
/* instructions type lp */
|
||||
case _traced_user_switch:
|
||||
CHECK(save_PtoOp(stream, pc->y_u.lp.l));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.lp.p));
|
||||
pc = NEXTOP(pc,lp);
|
||||
break;
|
||||
/* instructions type o */
|
||||
case _traced_unify_l_list:
|
||||
case _traced_unify_l_list_write:
|
||||
case _traced_unify_l_void:
|
||||
case _traced_unify_l_void_write:
|
||||
case _traced_unify_list:
|
||||
case _traced_unify_list_write:
|
||||
case _traced_unify_void:
|
||||
case _traced_unify_void_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.o.opcw));
|
||||
pc = NEXTOP(pc,o);
|
||||
break;
|
||||
/* instructions type oD */
|
||||
case _traced_unify_dbterm:
|
||||
case _traced_unify_l_dbterm:
|
||||
CHECK(save_Opcode(stream, pc->y_u.oD.opcw));
|
||||
CHECK(save_DBGroundTerm(stream, pc->y_u.oD.D));
|
||||
pc = NEXTOP(pc,oD);
|
||||
break;
|
||||
/* instructions type oN */
|
||||
case _traced_unify_bigint:
|
||||
case _traced_unify_l_bigint:
|
||||
CHECK(save_Opcode(stream, pc->y_u.oN.opcw));
|
||||
CHECK(save_BlobTermInCode(stream, pc->y_u.oN.b));
|
||||
pc = NEXTOP(pc,oN);
|
||||
break;
|
||||
/* instructions type oc */
|
||||
case _traced_unify_atom:
|
||||
case _traced_unify_atom_write:
|
||||
case _traced_unify_l_atom:
|
||||
case _traced_unify_l_atom_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.oc.opcw));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.oc.c));
|
||||
pc = NEXTOP(pc,oc);
|
||||
break;
|
||||
/* instructions type od */
|
||||
case _traced_unify_float:
|
||||
case _traced_unify_float_write:
|
||||
case _traced_unify_l_float:
|
||||
case _traced_unify_l_float_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.od.opcw));
|
||||
CHECK(save_DoubleInCode(stream, pc->y_u.od.d));
|
||||
pc = NEXTOP(pc,od);
|
||||
break;
|
||||
/* instructions type ofa */
|
||||
case _traced_unify_l_struc:
|
||||
case _traced_unify_l_struc_write:
|
||||
case _traced_unify_struct:
|
||||
case _traced_unify_struct_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.ofa.opcw));
|
||||
CHECK(save_Func(stream, pc->y_u.ofa.f));
|
||||
CHECK(save_Arity(stream, pc->y_u.ofa.a));
|
||||
pc = NEXTOP(pc,ofa);
|
||||
break;
|
||||
/* instructions type oi */
|
||||
case _traced_unify_l_longint:
|
||||
case _traced_unify_l_longint_write:
|
||||
case _traced_unify_longint:
|
||||
case _traced_unify_longint_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.oi.opcw));
|
||||
CHECK(save_IntegerInCode(stream, pc->y_u.oi.i));
|
||||
pc = NEXTOP(pc,oi);
|
||||
break;
|
||||
/* instructions type ollll */
|
||||
case _traced_switch_list_nl:
|
||||
CHECK(save_Opcode(stream, pc->y_u.ollll.pop));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.ollll.l1));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.ollll.l2));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.ollll.l3));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.ollll.l4));
|
||||
pc = NEXTOP(pc,ollll);
|
||||
break;
|
||||
/* instructions type os */
|
||||
case _traced_run_eam:
|
||||
case _traced_unify_l_n_voids:
|
||||
case _traced_unify_l_n_voids_write:
|
||||
case _traced_unify_n_voids:
|
||||
case _traced_unify_n_voids_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.os.opcw));
|
||||
CHECK(save_Constant(stream, pc->y_u.os.s));
|
||||
pc = NEXTOP(pc,os);
|
||||
break;
|
||||
/* instructions type osc */
|
||||
case _traced_unify_n_atoms:
|
||||
case _traced_unify_n_atoms_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.osc.opcw));
|
||||
CHECK(save_Constant(stream, pc->y_u.osc.s));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.osc.c));
|
||||
pc = NEXTOP(pc,osc);
|
||||
break;
|
||||
/* instructions type ox */
|
||||
case _traced_save_appl_x:
|
||||
case _traced_save_appl_x_write:
|
||||
case _traced_save_pair_x:
|
||||
case _traced_save_pair_x_write:
|
||||
case _traced_unify_l_x_loc:
|
||||
case _traced_unify_l_x_loc_write:
|
||||
case _traced_unify_l_x_val:
|
||||
case _traced_unify_l_x_val_write:
|
||||
case _traced_unify_l_x_var:
|
||||
case _traced_unify_l_x_var_write:
|
||||
case _traced_unify_x_loc:
|
||||
case _traced_unify_x_loc_write:
|
||||
case _traced_unify_x_val:
|
||||
case _traced_unify_x_val_write:
|
||||
case _traced_unify_x_var:
|
||||
case _traced_unify_x_var_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.ox.opcw));
|
||||
CHECK(save_X(stream, pc->y_u.ox.x));
|
||||
pc = NEXTOP(pc,ox);
|
||||
break;
|
||||
/* instructions type oxx */
|
||||
case _traced_unify_l_x_var2:
|
||||
case _traced_unify_l_x_var2_write:
|
||||
case _traced_unify_x_var2:
|
||||
case _traced_unify_x_var2_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.oxx.opcw));
|
||||
CHECK(save_X(stream, pc->y_u.oxx.xl));
|
||||
CHECK(save_X(stream, pc->y_u.oxx.xr));
|
||||
pc = NEXTOP(pc,oxx);
|
||||
break;
|
||||
/* instructions type oy */
|
||||
case _traced_save_appl_y:
|
||||
case _traced_save_appl_y_write:
|
||||
case _traced_save_pair_y:
|
||||
case _traced_save_pair_y_write:
|
||||
case _traced_unify_l_y_loc:
|
||||
case _traced_unify_l_y_loc_write:
|
||||
case _traced_unify_l_y_val:
|
||||
case _traced_unify_l_y_val_write:
|
||||
case _traced_unify_l_y_var:
|
||||
case _traced_unify_l_y_var_write:
|
||||
case _traced_unify_y_loc:
|
||||
case _traced_unify_y_loc_write:
|
||||
case _traced_unify_y_val:
|
||||
case _traced_unify_y_val_write:
|
||||
case _traced_unify_y_var:
|
||||
case _traced_unify_y_var_write:
|
||||
CHECK(save_Opcode(stream, pc->y_u.oy.opcw));
|
||||
CHECK(save_Y(stream, pc->y_u.oy.y));
|
||||
pc = NEXTOP(pc,oy);
|
||||
break;
|
||||
/* instructions type p */
|
||||
case _traced_count_call:
|
||||
case _traced_count_retry:
|
||||
case _traced_deallocate:
|
||||
case _traced_enter_profiling:
|
||||
case _traced_lock_lu:
|
||||
case _traced_procceed:
|
||||
case _traced_retry_profiled:
|
||||
CHECK(save_PtoPred(stream, pc->y_u.p.p));
|
||||
pc = NEXTOP(pc,p);
|
||||
break;
|
||||
/* instructions type plxxs */
|
||||
case _traced_call_bfunc_xx:
|
||||
CHECK(save_PtoPred(stream, pc->y_u.plxxs.p));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.plxxs.f));
|
||||
CHECK(save_X(stream, pc->y_u.plxxs.x1));
|
||||
CHECK(save_X(stream, pc->y_u.plxxs.x2));
|
||||
CHECK(save_Constant(stream, pc->y_u.plxxs.flags));
|
||||
pc = NEXTOP(pc,plxxs);
|
||||
break;
|
||||
/* instructions type plxys */
|
||||
case _traced_call_bfunc_xy:
|
||||
case _traced_call_bfunc_yx:
|
||||
CHECK(save_PtoPred(stream, pc->y_u.plxys.p));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.plxys.f));
|
||||
CHECK(save_X(stream, pc->y_u.plxys.x));
|
||||
CHECK(save_Y(stream, pc->y_u.plxys.y));
|
||||
CHECK(save_Constant(stream, pc->y_u.plxys.flags));
|
||||
pc = NEXTOP(pc,plxys);
|
||||
break;
|
||||
/* instructions type plyys */
|
||||
case _traced_call_bfunc_yy:
|
||||
CHECK(save_PtoPred(stream, pc->y_u.plyys.p));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.plyys.f));
|
||||
CHECK(save_Y(stream, pc->y_u.plyys.y1));
|
||||
CHECK(save_Y(stream, pc->y_u.plyys.y2));
|
||||
CHECK(save_Constant(stream, pc->y_u.plyys.flags));
|
||||
pc = NEXTOP(pc,plyys);
|
||||
break;
|
||||
/* instructions type pp */
|
||||
case _traced_dexecute:
|
||||
case _traced_execute:
|
||||
case _traced_execute_cpred:
|
||||
CHECK(save_PtoPred(stream, pc->y_u.pp.p));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.pp.p0));
|
||||
pc = NEXTOP(pc,pp);
|
||||
break;
|
||||
/* instructions type s */
|
||||
case _traced_cut:
|
||||
case _traced_cut_e:
|
||||
case _traced_cut_t:
|
||||
case _traced_pop_n:
|
||||
case _traced_write_n_voids:
|
||||
CHECK(save_Constant(stream, pc->y_u.s.s));
|
||||
pc = NEXTOP(pc,s);
|
||||
break;
|
||||
/* instructions type sc */
|
||||
case _traced_write_n_atoms:
|
||||
CHECK(save_Constant(stream, pc->y_u.sc.s));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.sc.c));
|
||||
pc = NEXTOP(pc,sc);
|
||||
break;
|
||||
/* instructions type sllll */
|
||||
case _traced_switch_on_sub_arg_type:
|
||||
CHECK(save_Constant(stream, pc->y_u.sllll.s));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.sllll.l1));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.sllll.l2));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.sllll.l3));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.sllll.l4));
|
||||
pc = NEXTOP(pc,sllll);
|
||||
break;
|
||||
/* instructions type slp */
|
||||
case _traced_call_c_wfail:
|
||||
CHECK(save_Constant(stream, pc->y_u.slp.s));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.slp.l));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.slp.p));
|
||||
pc = NEXTOP(pc,slp);
|
||||
break;
|
||||
/* instructions type sssl */
|
||||
case _traced_go_on_cons:
|
||||
case _traced_go_on_func:
|
||||
case _traced_if_cons:
|
||||
case _traced_if_func:
|
||||
case _traced_switch_on_cons:
|
||||
case _traced_switch_on_func:
|
||||
CHECK(save_Constant(stream, pc->y_u.sssl.s));
|
||||
CHECK(save_Constant(stream, pc->y_u.sssl.e));
|
||||
CHECK(save_Constant(stream, pc->y_u.sssl.w));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.sssl.l));
|
||||
pc = NEXTOP(pc,sssl);
|
||||
break;
|
||||
/* instructions type sssllp */
|
||||
case _traced_expand_clauses:
|
||||
CHECK(save_Constant(stream, pc->y_u.sssllp.s1));
|
||||
CHECK(save_Constant(stream, pc->y_u.sssllp.s2));
|
||||
CHECK(save_Constant(stream, pc->y_u.sssllp.s3));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.sssllp.sprev));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.sssllp.snext));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.sssllp.p));
|
||||
pc = NEXTOP(pc,sssllp);
|
||||
break;
|
||||
/* instructions type x */
|
||||
case _traced_get_list:
|
||||
case _traced_put_list:
|
||||
case _traced_save_b_x:
|
||||
case _traced_write_x_loc:
|
||||
case _traced_write_x_val:
|
||||
case _traced_write_x_var:
|
||||
CHECK(save_X(stream, pc->y_u.x.x));
|
||||
pc = NEXTOP(pc,x);
|
||||
break;
|
||||
/* instructions type xD */
|
||||
case _traced_get_dbterm:
|
||||
case _traced_put_dbterm:
|
||||
CHECK(save_X(stream, pc->y_u.xD.x));
|
||||
CHECK(save_DBGroundTerm(stream, pc->y_u.xD.D));
|
||||
pc = NEXTOP(pc,xD);
|
||||
break;
|
||||
/* instructions type xN */
|
||||
case _traced_get_bigint:
|
||||
case _traced_put_bigint:
|
||||
CHECK(save_X(stream, pc->y_u.xN.x));
|
||||
CHECK(save_BlobTermInCode(stream, pc->y_u.xN.b));
|
||||
pc = NEXTOP(pc,xN);
|
||||
break;
|
||||
/* instructions type xc */
|
||||
case _traced_get_atom:
|
||||
case _traced_put_atom:
|
||||
CHECK(save_X(stream, pc->y_u.xc.x));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.xc.c));
|
||||
pc = NEXTOP(pc,xc);
|
||||
break;
|
||||
/* instructions type xd */
|
||||
case _traced_get_float:
|
||||
case _traced_put_float:
|
||||
CHECK(save_X(stream, pc->y_u.xd.x));
|
||||
CHECK(save_DoubleInCode(stream, pc->y_u.xd.d));
|
||||
pc = NEXTOP(pc,xd);
|
||||
break;
|
||||
/* instructions type xfa */
|
||||
case _traced_get_struct:
|
||||
case _traced_put_struct:
|
||||
CHECK(save_X(stream, pc->y_u.xfa.x));
|
||||
CHECK(save_Func(stream, pc->y_u.xfa.f));
|
||||
CHECK(save_Arity(stream, pc->y_u.xfa.a));
|
||||
pc = NEXTOP(pc,xfa);
|
||||
break;
|
||||
/* instructions type xi */
|
||||
case _traced_get_longint:
|
||||
case _traced_put_longint:
|
||||
CHECK(save_X(stream, pc->y_u.xi.x));
|
||||
CHECK(save_IntegerInCode(stream, pc->y_u.xi.i));
|
||||
pc = NEXTOP(pc,xi);
|
||||
break;
|
||||
/* instructions type xl */
|
||||
case _traced_p_atom_x:
|
||||
case _traced_p_atomic_x:
|
||||
case _traced_p_compound_x:
|
||||
case _traced_p_db_ref_x:
|
||||
case _traced_p_float_x:
|
||||
case _traced_p_integer_x:
|
||||
case _traced_p_nonvar_x:
|
||||
case _traced_p_number_x:
|
||||
case _traced_p_primitive_x:
|
||||
case _traced_p_var_x:
|
||||
CHECK(save_X(stream, pc->y_u.xl.x));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.xl.F));
|
||||
pc = NEXTOP(pc,xl);
|
||||
break;
|
||||
/* instructions type xll */
|
||||
case _traced_jump_if_nonvar:
|
||||
CHECK(save_X(stream, pc->y_u.xll.x));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.xll.l1));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.xll.l2));
|
||||
pc = NEXTOP(pc,xll);
|
||||
break;
|
||||
/* instructions type xllll */
|
||||
case _traced_switch_on_arg_type:
|
||||
CHECK(save_X(stream, pc->y_u.xllll.x));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.xllll.l1));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.xllll.l2));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.xllll.l3));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.xllll.l4));
|
||||
pc = NEXTOP(pc,xllll);
|
||||
break;
|
||||
/* instructions type xps */
|
||||
case _traced_commit_b_x:
|
||||
CHECK(save_X(stream, pc->y_u.xps.x));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.xps.p0));
|
||||
CHECK(save_Constant(stream, pc->y_u.xps.s));
|
||||
pc = NEXTOP(pc,xps);
|
||||
break;
|
||||
/* instructions type xx */
|
||||
case _traced_get_x_val:
|
||||
case _traced_get_x_var:
|
||||
case _traced_gl_void_valx:
|
||||
case _traced_gl_void_varx:
|
||||
case _traced_glist_valx:
|
||||
case _traced_put_x_val:
|
||||
case _traced_put_x_var:
|
||||
CHECK(save_X(stream, pc->y_u.xx.xl));
|
||||
CHECK(save_X(stream, pc->y_u.xx.xr));
|
||||
pc = NEXTOP(pc,xx);
|
||||
break;
|
||||
/* instructions type xxc */
|
||||
case _traced_p_func2s_cv:
|
||||
CHECK(save_X(stream, pc->y_u.xxc.x));
|
||||
CHECK(save_X(stream, pc->y_u.xxc.xi));
|
||||
CHECK(save_ConstantTerm(stream, pc->y_u.xxc.c));
|
||||
pc = NEXTOP(pc,xxc);
|
||||
break;
|
||||
/* instructions type xxn */
|
||||
case _traced_p_and_vc:
|
||||
case _traced_p_arg_cv:
|
||||
case _traced_p_div_cv:
|
||||
case _traced_p_div_vc:
|
||||
case _traced_p_func2s_vc:
|
||||
case _traced_p_minus_cv:
|
||||
case _traced_p_or_vc:
|
||||
case _traced_p_plus_vc:
|
||||
case _traced_p_sll_cv:
|
||||
case _traced_p_sll_vc:
|
||||
case _traced_p_slr_cv:
|
||||
case _traced_p_slr_vc:
|
||||
case _traced_p_times_vc:
|
||||
CHECK(save_X(stream, pc->y_u.xxn.x));
|
||||
CHECK(save_X(stream, pc->y_u.xxn.xi));
|
||||
CHECK(save_Integer(stream, pc->y_u.xxn.c));
|
||||
pc = NEXTOP(pc,xxn);
|
||||
break;
|
||||
/* instructions type xxx */
|
||||
case _traced_p_and_vv:
|
||||
case _traced_p_arg_vv:
|
||||
case _traced_p_div_vv:
|
||||
case _traced_p_func2f_xx:
|
||||
case _traced_p_func2s_vv:
|
||||
case _traced_p_minus_vv:
|
||||
case _traced_p_or_vv:
|
||||
case _traced_p_plus_vv:
|
||||
case _traced_p_sll_vv:
|
||||
case _traced_p_slr_vv:
|
||||
case _traced_p_times_vv:
|
||||
CHECK(save_X(stream, pc->y_u.xxx.x));
|
||||
CHECK(save_X(stream, pc->y_u.xxx.x1));
|
||||
CHECK(save_X(stream, pc->y_u.xxx.x2));
|
||||
pc = NEXTOP(pc,xxx);
|
||||
break;
|
||||
/* instructions type xxxx */
|
||||
case _traced_put_xx_val:
|
||||
CHECK(save_X(stream, pc->y_u.xxxx.xl1));
|
||||
CHECK(save_X(stream, pc->y_u.xxxx.xl2));
|
||||
CHECK(save_X(stream, pc->y_u.xxxx.xr1));
|
||||
CHECK(save_X(stream, pc->y_u.xxxx.xr2));
|
||||
pc = NEXTOP(pc,xxxx);
|
||||
break;
|
||||
/* instructions type xxy */
|
||||
case _traced_p_func2f_xy:
|
||||
CHECK(save_X(stream, pc->y_u.xxy.x));
|
||||
CHECK(save_X(stream, pc->y_u.xxy.x1));
|
||||
CHECK(save_Y(stream, pc->y_u.xxy.y2));
|
||||
pc = NEXTOP(pc,xxy);
|
||||
break;
|
||||
/* instructions type y */
|
||||
case _traced_save_b_y:
|
||||
case _traced_write_y_loc:
|
||||
case _traced_write_y_val:
|
||||
case _traced_write_y_var:
|
||||
CHECK(save_Y(stream, pc->y_u.y.y));
|
||||
pc = NEXTOP(pc,y);
|
||||
break;
|
||||
/* instructions type yl */
|
||||
case _traced_p_atom_y:
|
||||
case _traced_p_atomic_y:
|
||||
case _traced_p_compound_y:
|
||||
case _traced_p_db_ref_y:
|
||||
case _traced_p_float_y:
|
||||
case _traced_p_integer_y:
|
||||
case _traced_p_nonvar_y:
|
||||
case _traced_p_number_y:
|
||||
case _traced_p_primitive_y:
|
||||
case _traced_p_var_y:
|
||||
CHECK(save_Y(stream, pc->y_u.yl.y));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.yl.F));
|
||||
pc = NEXTOP(pc,yl);
|
||||
break;
|
||||
/* instructions type yps */
|
||||
case _traced_commit_b_y:
|
||||
CHECK(save_Y(stream, pc->y_u.yps.y));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.yps.p0));
|
||||
CHECK(save_Constant(stream, pc->y_u.yps.s));
|
||||
pc = NEXTOP(pc,yps);
|
||||
break;
|
||||
/* instructions type yx */
|
||||
case _traced_get_y_val:
|
||||
case _traced_get_y_var:
|
||||
case _traced_gl_void_valy:
|
||||
case _traced_gl_void_vary:
|
||||
case _traced_glist_valy:
|
||||
case _traced_put_unsafe:
|
||||
case _traced_put_y_val:
|
||||
case _traced_put_y_var:
|
||||
CHECK(save_Y(stream, pc->y_u.yx.y));
|
||||
CHECK(save_X(stream, pc->y_u.yx.x));
|
||||
pc = NEXTOP(pc,yx);
|
||||
break;
|
||||
/* instructions type yxn */
|
||||
case _traced_p_and_y_vc:
|
||||
case _traced_p_arg_y_cv:
|
||||
case _traced_p_div_y_cv:
|
||||
case _traced_p_div_y_vc:
|
||||
case _traced_p_func2s_y_cv:
|
||||
case _traced_p_func2s_y_vc:
|
||||
case _traced_p_minus_y_cv:
|
||||
case _traced_p_or_y_vc:
|
||||
case _traced_p_plus_y_vc:
|
||||
case _traced_p_sll_y_cv:
|
||||
case _traced_p_sll_y_vc:
|
||||
case _traced_p_slr_y_cv:
|
||||
case _traced_p_slr_y_vc:
|
||||
case _traced_p_times_y_vc:
|
||||
CHECK(save_Y(stream, pc->y_u.yxn.y));
|
||||
CHECK(save_X(stream, pc->y_u.yxn.xi));
|
||||
CHECK(save_Integer(stream, pc->y_u.yxn.c));
|
||||
pc = NEXTOP(pc,yxn);
|
||||
break;
|
||||
/* instructions type yxx */
|
||||
case _traced_p_and_y_vv:
|
||||
case _traced_p_arg_y_vv:
|
||||
case _traced_p_div_y_vv:
|
||||
case _traced_p_func2f_yx:
|
||||
case _traced_p_func2s_y_vv:
|
||||
case _traced_p_minus_y_vv:
|
||||
case _traced_p_or_y_vv:
|
||||
case _traced_p_plus_y_vv:
|
||||
case _traced_p_sll_y_vv:
|
||||
case _traced_p_slr_y_vv:
|
||||
case _traced_p_times_y_vv:
|
||||
CHECK(save_Y(stream, pc->y_u.yxx.y));
|
||||
CHECK(save_X(stream, pc->y_u.yxx.x1));
|
||||
CHECK(save_X(stream, pc->y_u.yxx.x2));
|
||||
pc = NEXTOP(pc,yxx);
|
||||
break;
|
||||
/* instructions type yyx */
|
||||
case _traced_p_func2f_yy:
|
||||
CHECK(save_Y(stream, pc->y_u.yyx.y1));
|
||||
CHECK(save_Y(stream, pc->y_u.yyx.y2));
|
||||
CHECK(save_X(stream, pc->y_u.yyx.x));
|
||||
pc = NEXTOP(pc,yyx);
|
||||
break;
|
||||
/* instructions type yyxx */
|
||||
case _traced_get_yy_var:
|
||||
case _traced_put_y_vals:
|
||||
CHECK(save_Y(stream, pc->y_u.yyxx.y1));
|
||||
CHECK(save_Y(stream, pc->y_u.yyxx.y2));
|
||||
CHECK(save_X(stream, pc->y_u.yyxx.x1));
|
||||
CHECK(save_X(stream, pc->y_u.yyxx.x2));
|
||||
pc = NEXTOP(pc,yyxx);
|
||||
break;
|
||||
#ifdef YAPOR
|
||||
/* instructions type Otapl */
|
||||
case _traced_getwork:
|
||||
case _traced_getwork_seq:
|
||||
case _traced_sync:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.Otapl.or_arg));
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
CHECK(save_TabEntry(stream, pc->y_u.Otapl.te));
|
||||
#endif
|
||||
CHECK(save_Arity(stream, pc->y_u.Otapl.s));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.Otapl.p));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.Otapl.d));
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_getwork_first_time:
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
/* instructions type Otapl */
|
||||
case _traced_table_answer_resolution:
|
||||
case _traced_table_answer_resolution_completion:
|
||||
case _traced_table_completion:
|
||||
case _traced_table_load_answer:
|
||||
case _traced_table_retry:
|
||||
case _traced_table_retry_me:
|
||||
case _traced_table_trust:
|
||||
case _traced_table_trust_me:
|
||||
case _traced_table_try:
|
||||
case _traced_table_try_answer:
|
||||
case _traced_table_try_me:
|
||||
case _traced_table_try_single:
|
||||
#ifdef YAPOR
|
||||
CHECK(save_OrArg(stream, pc->y_u.Otapl.or_arg));
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
CHECK(save_TabEntry(stream, pc->y_u.Otapl.te));
|
||||
#endif
|
||||
CHECK(save_Arity(stream, pc->y_u.Otapl.s));
|
||||
CHECK(save_PtoPred(stream, pc->y_u.Otapl.p));
|
||||
CHECK(save_PtoOp(stream, pc->y_u.Otapl.d));
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_clause_with_cut:
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
/* instructions type s */
|
||||
case _traced_table_new_answer:
|
||||
CHECK(save_Constant(stream, pc->y_u.s.s));
|
||||
pc = NEXTOP(pc,s);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_trie_do_appl:
|
||||
case _traced_trie_do_appl_in_pair:
|
||||
case _traced_trie_do_atom:
|
||||
case _traced_trie_do_atom_in_pair:
|
||||
case _traced_trie_do_bigint:
|
||||
case _traced_trie_do_double:
|
||||
case _traced_trie_do_extension:
|
||||
case _traced_trie_do_gterm:
|
||||
case _traced_trie_do_longint:
|
||||
case _traced_trie_do_null:
|
||||
case _traced_trie_do_null_in_pair:
|
||||
case _traced_trie_do_pair:
|
||||
case _traced_trie_do_val:
|
||||
case _traced_trie_do_val_in_pair:
|
||||
case _traced_trie_do_var:
|
||||
case _traced_trie_do_var_in_pair:
|
||||
case _traced_trie_retry_appl:
|
||||
case _traced_trie_retry_appl_in_pair:
|
||||
case _traced_trie_retry_atom:
|
||||
case _traced_trie_retry_atom_in_pair:
|
||||
case _traced_trie_retry_bigint:
|
||||
case _traced_trie_retry_double:
|
||||
case _traced_trie_retry_extension:
|
||||
case _traced_trie_retry_gterm:
|
||||
case _traced_trie_retry_longint:
|
||||
case _traced_trie_retry_null:
|
||||
case _traced_trie_retry_null_in_pair:
|
||||
case _traced_trie_retry_pair:
|
||||
case _traced_trie_retry_val:
|
||||
case _traced_trie_retry_val_in_pair:
|
||||
case _traced_trie_retry_var:
|
||||
case _traced_trie_retry_var_in_pair:
|
||||
case _traced_trie_trust_appl:
|
||||
case _traced_trie_trust_appl_in_pair:
|
||||
case _traced_trie_trust_atom:
|
||||
case _traced_trie_trust_atom_in_pair:
|
||||
case _traced_trie_trust_bigint:
|
||||
case _traced_trie_trust_double:
|
||||
case _traced_trie_trust_extension:
|
||||
case _traced_trie_trust_gterm:
|
||||
case _traced_trie_trust_longint:
|
||||
case _traced_trie_trust_null:
|
||||
case _traced_trie_trust_null_in_pair:
|
||||
case _traced_trie_trust_pair:
|
||||
case _traced_trie_trust_val:
|
||||
case _traced_trie_trust_val_in_pair:
|
||||
case _traced_trie_trust_var:
|
||||
case _traced_trie_trust_var_in_pair:
|
||||
case _traced_trie_try_appl:
|
||||
case _traced_trie_try_appl_in_pair:
|
||||
case _traced_trie_try_atom:
|
||||
case _traced_trie_try_atom_in_pair:
|
||||
case _traced_trie_try_bigint:
|
||||
case _traced_trie_try_double:
|
||||
case _traced_trie_try_extension:
|
||||
case _traced_trie_try_gterm:
|
||||
case _traced_trie_try_longint:
|
||||
case _traced_trie_try_null:
|
||||
case _traced_trie_try_null_in_pair:
|
||||
case _traced_trie_try_pair:
|
||||
case _traced_trie_try_val:
|
||||
case _traced_trie_try_val_in_pair:
|
||||
case _traced_trie_try_var:
|
||||
case _traced_trie_try_var_in_pair:
|
||||
if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1;
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
672
H/walkclause.h
672
H/walkclause.h
@ -726,680 +726,8 @@
|
||||
case _trie_try_var_in_pair:
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#ifdef YAP_JIT
|
||||
/* instructions type D */
|
||||
case _traced_write_dbterm:
|
||||
pc = NEXTOP(pc,D);
|
||||
break;
|
||||
/* instructions type Illss */
|
||||
case _traced_enter_lu_pred:
|
||||
return walk_got_lu_block(pc->y_u.Illss.I, startp, endp);
|
||||
/* instructions type J */
|
||||
case _traced_jit_handler:
|
||||
pc = NEXTOP(pc,J);
|
||||
break;
|
||||
/* instructions type L */
|
||||
case _traced_alloc_for_logical_pred:
|
||||
return walk_got_lu_clause(pc->y_u.L.ClBase, startp, endp);
|
||||
/* instructions type N */
|
||||
case _traced_write_bigint:
|
||||
pc = NEXTOP(pc,N);
|
||||
break;
|
||||
/* instructions type Osblp */
|
||||
case _traced_either:
|
||||
case _traced_or_else:
|
||||
clause_code = TRUE;
|
||||
pp = pc->y_u.Osblp.p0;
|
||||
pc = NEXTOP(pc,Osblp);
|
||||
break;
|
||||
/* instructions type Osbmp */
|
||||
case _traced_p_execute:
|
||||
case _traced_p_execute_tail:
|
||||
pc = NEXTOP(pc,Osbmp);
|
||||
break;
|
||||
/* instructions type Osbpa */
|
||||
case _traced_ensure_space:
|
||||
pc = NEXTOP(pc,Osbpa);
|
||||
break;
|
||||
/* instructions type Osbpp */
|
||||
case _traced_call:
|
||||
case _traced_call_cpred:
|
||||
case _traced_call_usercpred:
|
||||
case _traced_fcall:
|
||||
case _traced_p_execute2:
|
||||
clause_code = TRUE;
|
||||
pp = pc->y_u.Osbpp.p0;
|
||||
pc = NEXTOP(pc,Osbpp);
|
||||
break;
|
||||
/* instructions type OtILl */
|
||||
case _traced_count_trust_logical:
|
||||
case _traced_profiled_trust_logical:
|
||||
case _traced_trust_logical:
|
||||
return walk_got_lu_block(pc->y_u.OtILl.block, startp, endp);
|
||||
/* instructions type OtaLl */
|
||||
case _traced_count_retry_logical:
|
||||
case _traced_profiled_retry_logical:
|
||||
case _traced_retry_logical:
|
||||
case _traced_try_logical:
|
||||
pc = pc->y_u.OtaLl.n;
|
||||
break;
|
||||
/* instructions type OtapFs */
|
||||
case _traced_cut_c:
|
||||
case _traced_cut_userc:
|
||||
case _traced_retry_c:
|
||||
case _traced_retry_userc:
|
||||
case _traced_try_c:
|
||||
case _traced_try_userc:
|
||||
clause_code = TRUE;
|
||||
pp = pc->y_u.OtapFs.p;
|
||||
pc = NEXTOP(pc,OtapFs);
|
||||
break;
|
||||
/* instructions type Otapl */
|
||||
case _traced_count_retry_and_mark:
|
||||
case _traced_count_retry_me:
|
||||
case _traced_count_trust_me:
|
||||
case _traced_profiled_retry_and_mark:
|
||||
case _traced_profiled_retry_me:
|
||||
case _traced_profiled_trust_me:
|
||||
case _traced_retry:
|
||||
case _traced_retry_and_mark:
|
||||
case _traced_retry_me:
|
||||
case _traced_spy_or_trymark:
|
||||
case _traced_trust:
|
||||
case _traced_trust_me:
|
||||
case _traced_try_and_mark:
|
||||
case _traced_try_clause:
|
||||
case _traced_try_me:
|
||||
clause_code = FALSE;
|
||||
pp = pc->y_u.Otapl.p;
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type c */
|
||||
case _traced_write_atom:
|
||||
pc = NEXTOP(pc,c);
|
||||
break;
|
||||
/* instructions type cc */
|
||||
case _traced_get_2atoms:
|
||||
pc = NEXTOP(pc,cc);
|
||||
break;
|
||||
/* instructions type ccc */
|
||||
case _traced_get_3atoms:
|
||||
pc = NEXTOP(pc,ccc);
|
||||
break;
|
||||
/* instructions type cccc */
|
||||
case _traced_get_4atoms:
|
||||
pc = NEXTOP(pc,cccc);
|
||||
break;
|
||||
/* instructions type ccccc */
|
||||
case _traced_get_5atoms:
|
||||
pc = NEXTOP(pc,ccccc);
|
||||
break;
|
||||
/* instructions type cccccc */
|
||||
case _traced_get_6atoms:
|
||||
pc = NEXTOP(pc,cccccc);
|
||||
break;
|
||||
/* instructions type clll */
|
||||
case _traced_if_not_then:
|
||||
pc = NEXTOP(pc,clll);
|
||||
break;
|
||||
/* instructions type d */
|
||||
case _traced_write_float:
|
||||
pc = NEXTOP(pc,d);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_Nstop:
|
||||
case _traced_allocate:
|
||||
case _traced_copy_idb_term:
|
||||
case _traced_expand_index:
|
||||
case _traced_index_blob:
|
||||
case _traced_index_dbref:
|
||||
case _traced_index_long:
|
||||
case _traced_index_pred:
|
||||
case _traced_lock_pred:
|
||||
case _traced_op_fail:
|
||||
case _traced_p_equal:
|
||||
case _traced_p_functor:
|
||||
case _traced_pop:
|
||||
case _traced_retry_eam:
|
||||
case _traced_spy_pred:
|
||||
case _traced_thread_local:
|
||||
case _traced_trust_fail:
|
||||
case _traced_undef_p:
|
||||
case _traced_unify_idb_term:
|
||||
case _traced_unlock_lu:
|
||||
case _traced_write_l_list:
|
||||
case _traced_write_list:
|
||||
case _traced_write_void:
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
/* instructions type fa */
|
||||
case _traced_write_l_struc:
|
||||
case _traced_write_struct:
|
||||
pc = NEXTOP(pc,fa);
|
||||
break;
|
||||
/* instructions type i */
|
||||
case _traced_write_longint:
|
||||
pc = NEXTOP(pc,i);
|
||||
break;
|
||||
/* instructions type l */
|
||||
case _traced_Ystop:
|
||||
case _traced_jump:
|
||||
case _traced_jump_if_var:
|
||||
case _traced_move_back:
|
||||
case _traced_p_dif:
|
||||
case _traced_p_eq:
|
||||
case _traced_retry2:
|
||||
case _traced_retry3:
|
||||
case _traced_retry4:
|
||||
case _traced_skip:
|
||||
case _traced_try_clause2:
|
||||
case _traced_try_clause3:
|
||||
case _traced_try_clause4:
|
||||
case _traced_try_in:
|
||||
pc = NEXTOP(pc,l);
|
||||
break;
|
||||
/* instructions type llll */
|
||||
case _traced_switch_on_type:
|
||||
pc = NEXTOP(pc,llll);
|
||||
break;
|
||||
/* instructions type lp */
|
||||
case _traced_user_switch:
|
||||
pc = NEXTOP(pc,lp);
|
||||
break;
|
||||
/* instructions type o */
|
||||
case _traced_unify_l_list:
|
||||
case _traced_unify_l_list_write:
|
||||
case _traced_unify_l_void:
|
||||
case _traced_unify_l_void_write:
|
||||
case _traced_unify_list:
|
||||
case _traced_unify_list_write:
|
||||
case _traced_unify_void:
|
||||
case _traced_unify_void_write:
|
||||
pc = NEXTOP(pc,o);
|
||||
break;
|
||||
/* instructions type oD */
|
||||
case _traced_unify_dbterm:
|
||||
case _traced_unify_l_dbterm:
|
||||
pc = NEXTOP(pc,oD);
|
||||
break;
|
||||
/* instructions type oN */
|
||||
case _traced_unify_bigint:
|
||||
case _traced_unify_l_bigint:
|
||||
pc = NEXTOP(pc,oN);
|
||||
break;
|
||||
/* instructions type oc */
|
||||
case _traced_unify_atom:
|
||||
case _traced_unify_atom_write:
|
||||
case _traced_unify_l_atom:
|
||||
case _traced_unify_l_atom_write:
|
||||
pc = NEXTOP(pc,oc);
|
||||
break;
|
||||
/* instructions type od */
|
||||
case _traced_unify_float:
|
||||
case _traced_unify_float_write:
|
||||
case _traced_unify_l_float:
|
||||
case _traced_unify_l_float_write:
|
||||
pc = NEXTOP(pc,od);
|
||||
break;
|
||||
/* instructions type ofa */
|
||||
case _traced_unify_l_struc:
|
||||
case _traced_unify_l_struc_write:
|
||||
case _traced_unify_struct:
|
||||
case _traced_unify_struct_write:
|
||||
pc = NEXTOP(pc,ofa);
|
||||
break;
|
||||
/* instructions type oi */
|
||||
case _traced_unify_l_longint:
|
||||
case _traced_unify_l_longint_write:
|
||||
case _traced_unify_longint:
|
||||
case _traced_unify_longint_write:
|
||||
pc = NEXTOP(pc,oi);
|
||||
break;
|
||||
/* instructions type ollll */
|
||||
case _traced_switch_list_nl:
|
||||
pc = NEXTOP(pc,ollll);
|
||||
break;
|
||||
/* instructions type os */
|
||||
case _traced_run_eam:
|
||||
case _traced_unify_l_n_voids:
|
||||
case _traced_unify_l_n_voids_write:
|
||||
case _traced_unify_n_voids:
|
||||
case _traced_unify_n_voids_write:
|
||||
pc = NEXTOP(pc,os);
|
||||
break;
|
||||
/* instructions type osc */
|
||||
case _traced_unify_n_atoms:
|
||||
case _traced_unify_n_atoms_write:
|
||||
pc = NEXTOP(pc,osc);
|
||||
break;
|
||||
/* instructions type ox */
|
||||
case _traced_save_appl_x:
|
||||
case _traced_save_appl_x_write:
|
||||
case _traced_save_pair_x:
|
||||
case _traced_save_pair_x_write:
|
||||
case _traced_unify_l_x_loc:
|
||||
case _traced_unify_l_x_loc_write:
|
||||
case _traced_unify_l_x_val:
|
||||
case _traced_unify_l_x_val_write:
|
||||
case _traced_unify_l_x_var:
|
||||
case _traced_unify_l_x_var_write:
|
||||
case _traced_unify_x_loc:
|
||||
case _traced_unify_x_loc_write:
|
||||
case _traced_unify_x_val:
|
||||
case _traced_unify_x_val_write:
|
||||
case _traced_unify_x_var:
|
||||
case _traced_unify_x_var_write:
|
||||
pc = NEXTOP(pc,ox);
|
||||
break;
|
||||
/* instructions type oxx */
|
||||
case _traced_unify_l_x_var2:
|
||||
case _traced_unify_l_x_var2_write:
|
||||
case _traced_unify_x_var2:
|
||||
case _traced_unify_x_var2_write:
|
||||
pc = NEXTOP(pc,oxx);
|
||||
break;
|
||||
/* instructions type oy */
|
||||
case _traced_save_appl_y:
|
||||
case _traced_save_appl_y_write:
|
||||
case _traced_save_pair_y:
|
||||
case _traced_save_pair_y_write:
|
||||
case _traced_unify_l_y_loc:
|
||||
case _traced_unify_l_y_loc_write:
|
||||
case _traced_unify_l_y_val:
|
||||
case _traced_unify_l_y_val_write:
|
||||
case _traced_unify_l_y_var:
|
||||
case _traced_unify_l_y_var_write:
|
||||
case _traced_unify_y_loc:
|
||||
case _traced_unify_y_loc_write:
|
||||
case _traced_unify_y_val:
|
||||
case _traced_unify_y_val_write:
|
||||
case _traced_unify_y_var:
|
||||
case _traced_unify_y_var_write:
|
||||
pc = NEXTOP(pc,oy);
|
||||
break;
|
||||
/* instructions type p */
|
||||
case _traced_count_call:
|
||||
case _traced_count_retry:
|
||||
case _traced_deallocate:
|
||||
case _traced_enter_profiling:
|
||||
case _traced_lock_lu:
|
||||
case _traced_procceed:
|
||||
case _traced_retry_profiled:
|
||||
pc = NEXTOP(pc,p);
|
||||
break;
|
||||
/* instructions type plxxs */
|
||||
case _traced_call_bfunc_xx:
|
||||
pc = NEXTOP(pc,plxxs);
|
||||
break;
|
||||
/* instructions type plxys */
|
||||
case _traced_call_bfunc_xy:
|
||||
case _traced_call_bfunc_yx:
|
||||
pc = NEXTOP(pc,plxys);
|
||||
break;
|
||||
/* instructions type plyys */
|
||||
case _traced_call_bfunc_yy:
|
||||
pc = NEXTOP(pc,plyys);
|
||||
break;
|
||||
/* instructions type pp */
|
||||
case _traced_dexecute:
|
||||
case _traced_execute:
|
||||
case _traced_execute_cpred:
|
||||
clause_code = TRUE;
|
||||
pp = pc->y_u.pp.p0;
|
||||
pc = NEXTOP(pc,pp);
|
||||
break;
|
||||
/* instructions type s */
|
||||
case _traced_cut:
|
||||
case _traced_cut_e:
|
||||
case _traced_cut_t:
|
||||
case _traced_pop_n:
|
||||
case _traced_write_n_voids:
|
||||
pc = NEXTOP(pc,s);
|
||||
break;
|
||||
/* instructions type sc */
|
||||
case _traced_write_n_atoms:
|
||||
pc = NEXTOP(pc,sc);
|
||||
break;
|
||||
/* instructions type sllll */
|
||||
case _traced_switch_on_sub_arg_type:
|
||||
pc = NEXTOP(pc,sllll);
|
||||
break;
|
||||
/* instructions type slp */
|
||||
case _traced_call_c_wfail:
|
||||
pc = NEXTOP(pc,slp);
|
||||
break;
|
||||
/* instructions type sssl */
|
||||
case _traced_go_on_cons:
|
||||
case _traced_go_on_func:
|
||||
case _traced_if_cons:
|
||||
case _traced_if_func:
|
||||
case _traced_switch_on_cons:
|
||||
case _traced_switch_on_func:
|
||||
pc = NEXTOP(pc,sssl);
|
||||
break;
|
||||
/* instructions type sssllp */
|
||||
case _traced_expand_clauses:
|
||||
return found_expand_index(pc, startp, endp, codeptr PASS_REGS);
|
||||
pc = NEXTOP(pc,sssllp);
|
||||
break;
|
||||
/* instructions type x */
|
||||
case _traced_get_list:
|
||||
case _traced_put_list:
|
||||
case _traced_save_b_x:
|
||||
case _traced_write_x_loc:
|
||||
case _traced_write_x_val:
|
||||
case _traced_write_x_var:
|
||||
pc = NEXTOP(pc,x);
|
||||
break;
|
||||
/* instructions type xD */
|
||||
case _traced_get_dbterm:
|
||||
case _traced_put_dbterm:
|
||||
pc = NEXTOP(pc,xD);
|
||||
break;
|
||||
/* instructions type xN */
|
||||
case _traced_get_bigint:
|
||||
case _traced_put_bigint:
|
||||
pc = NEXTOP(pc,xN);
|
||||
break;
|
||||
/* instructions type xc */
|
||||
case _traced_get_atom:
|
||||
case _traced_put_atom:
|
||||
pc = NEXTOP(pc,xc);
|
||||
break;
|
||||
/* instructions type xd */
|
||||
case _traced_get_float:
|
||||
case _traced_put_float:
|
||||
pc = NEXTOP(pc,xd);
|
||||
break;
|
||||
/* instructions type xfa */
|
||||
case _traced_get_struct:
|
||||
case _traced_put_struct:
|
||||
pc = NEXTOP(pc,xfa);
|
||||
break;
|
||||
/* instructions type xi */
|
||||
case _traced_get_longint:
|
||||
case _traced_put_longint:
|
||||
pc = NEXTOP(pc,xi);
|
||||
break;
|
||||
/* instructions type xl */
|
||||
case _traced_p_atom_x:
|
||||
case _traced_p_atomic_x:
|
||||
case _traced_p_compound_x:
|
||||
case _traced_p_db_ref_x:
|
||||
case _traced_p_float_x:
|
||||
case _traced_p_integer_x:
|
||||
case _traced_p_nonvar_x:
|
||||
case _traced_p_number_x:
|
||||
case _traced_p_primitive_x:
|
||||
case _traced_p_var_x:
|
||||
pc = NEXTOP(pc,xl);
|
||||
break;
|
||||
/* instructions type xll */
|
||||
case _traced_jump_if_nonvar:
|
||||
pc = NEXTOP(pc,xll);
|
||||
break;
|
||||
/* instructions type xllll */
|
||||
case _traced_switch_on_arg_type:
|
||||
pc = NEXTOP(pc,xllll);
|
||||
break;
|
||||
/* instructions type xps */
|
||||
case _traced_commit_b_x:
|
||||
pc = NEXTOP(pc,xps);
|
||||
break;
|
||||
/* instructions type xx */
|
||||
case _traced_get_x_val:
|
||||
case _traced_get_x_var:
|
||||
case _traced_gl_void_valx:
|
||||
case _traced_gl_void_varx:
|
||||
case _traced_glist_valx:
|
||||
case _traced_put_x_val:
|
||||
case _traced_put_x_var:
|
||||
pc = NEXTOP(pc,xx);
|
||||
break;
|
||||
/* instructions type xxc */
|
||||
case _traced_p_func2s_cv:
|
||||
pc = NEXTOP(pc,xxc);
|
||||
break;
|
||||
/* instructions type xxn */
|
||||
case _traced_p_and_vc:
|
||||
case _traced_p_arg_cv:
|
||||
case _traced_p_div_cv:
|
||||
case _traced_p_div_vc:
|
||||
case _traced_p_func2s_vc:
|
||||
case _traced_p_minus_cv:
|
||||
case _traced_p_or_vc:
|
||||
case _traced_p_plus_vc:
|
||||
case _traced_p_sll_cv:
|
||||
case _traced_p_sll_vc:
|
||||
case _traced_p_slr_cv:
|
||||
case _traced_p_slr_vc:
|
||||
case _traced_p_times_vc:
|
||||
pc = NEXTOP(pc,xxn);
|
||||
break;
|
||||
/* instructions type xxx */
|
||||
case _traced_p_and_vv:
|
||||
case _traced_p_arg_vv:
|
||||
case _traced_p_div_vv:
|
||||
case _traced_p_func2f_xx:
|
||||
case _traced_p_func2s_vv:
|
||||
case _traced_p_minus_vv:
|
||||
case _traced_p_or_vv:
|
||||
case _traced_p_plus_vv:
|
||||
case _traced_p_sll_vv:
|
||||
case _traced_p_slr_vv:
|
||||
case _traced_p_times_vv:
|
||||
pc = NEXTOP(pc,xxx);
|
||||
break;
|
||||
/* instructions type xxxx */
|
||||
case _traced_put_xx_val:
|
||||
pc = NEXTOP(pc,xxxx);
|
||||
break;
|
||||
/* instructions type xxy */
|
||||
case _traced_p_func2f_xy:
|
||||
pc = NEXTOP(pc,xxy);
|
||||
break;
|
||||
/* instructions type y */
|
||||
case _traced_save_b_y:
|
||||
case _traced_write_y_loc:
|
||||
case _traced_write_y_val:
|
||||
case _traced_write_y_var:
|
||||
pc = NEXTOP(pc,y);
|
||||
break;
|
||||
/* instructions type yl */
|
||||
case _traced_p_atom_y:
|
||||
case _traced_p_atomic_y:
|
||||
case _traced_p_compound_y:
|
||||
case _traced_p_db_ref_y:
|
||||
case _traced_p_float_y:
|
||||
case _traced_p_integer_y:
|
||||
case _traced_p_nonvar_y:
|
||||
case _traced_p_number_y:
|
||||
case _traced_p_primitive_y:
|
||||
case _traced_p_var_y:
|
||||
pc = NEXTOP(pc,yl);
|
||||
break;
|
||||
/* instructions type yps */
|
||||
case _traced_commit_b_y:
|
||||
pc = NEXTOP(pc,yps);
|
||||
break;
|
||||
/* instructions type yx */
|
||||
case _traced_get_y_val:
|
||||
case _traced_get_y_var:
|
||||
case _traced_gl_void_valy:
|
||||
case _traced_gl_void_vary:
|
||||
case _traced_glist_valy:
|
||||
case _traced_put_unsafe:
|
||||
case _traced_put_y_val:
|
||||
case _traced_put_y_var:
|
||||
pc = NEXTOP(pc,yx);
|
||||
break;
|
||||
/* instructions type yxn */
|
||||
case _traced_p_and_y_vc:
|
||||
case _traced_p_arg_y_cv:
|
||||
case _traced_p_div_y_cv:
|
||||
case _traced_p_div_y_vc:
|
||||
case _traced_p_func2s_y_cv:
|
||||
case _traced_p_func2s_y_vc:
|
||||
case _traced_p_minus_y_cv:
|
||||
case _traced_p_or_y_vc:
|
||||
case _traced_p_plus_y_vc:
|
||||
case _traced_p_sll_y_cv:
|
||||
case _traced_p_sll_y_vc:
|
||||
case _traced_p_slr_y_cv:
|
||||
case _traced_p_slr_y_vc:
|
||||
case _traced_p_times_y_vc:
|
||||
pc = NEXTOP(pc,yxn);
|
||||
break;
|
||||
/* instructions type yxx */
|
||||
case _traced_p_and_y_vv:
|
||||
case _traced_p_arg_y_vv:
|
||||
case _traced_p_div_y_vv:
|
||||
case _traced_p_func2f_yx:
|
||||
case _traced_p_func2s_y_vv:
|
||||
case _traced_p_minus_y_vv:
|
||||
case _traced_p_or_y_vv:
|
||||
case _traced_p_plus_y_vv:
|
||||
case _traced_p_sll_y_vv:
|
||||
case _traced_p_slr_y_vv:
|
||||
case _traced_p_times_y_vv:
|
||||
pc = NEXTOP(pc,yxx);
|
||||
break;
|
||||
/* instructions type yyx */
|
||||
case _traced_p_func2f_yy:
|
||||
pc = NEXTOP(pc,yyx);
|
||||
break;
|
||||
/* instructions type yyxx */
|
||||
case _traced_get_yy_var:
|
||||
case _traced_put_y_vals:
|
||||
pc = NEXTOP(pc,yyxx);
|
||||
break;
|
||||
#ifdef YAPOR
|
||||
/* instructions type Otapl */
|
||||
case _traced_getwork:
|
||||
case _traced_getwork_seq:
|
||||
case _traced_sync:
|
||||
clause_code = FALSE;
|
||||
pp = pc->y_u.Otapl.p;
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_getwork_first_time:
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
/* instructions type Otapl */
|
||||
case _traced_table_answer_resolution:
|
||||
case _traced_table_answer_resolution_completion:
|
||||
case _traced_table_completion:
|
||||
case _traced_table_load_answer:
|
||||
case _traced_table_retry:
|
||||
case _traced_table_retry_me:
|
||||
case _traced_table_trust:
|
||||
case _traced_table_trust_me:
|
||||
case _traced_table_try:
|
||||
case _traced_table_try_answer:
|
||||
case _traced_table_try_me:
|
||||
case _traced_table_try_single:
|
||||
clause_code = FALSE;
|
||||
pp = pc->y_u.Otapl.p;
|
||||
pc = NEXTOP(pc,Otapl);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_clause_with_cut:
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
/* instructions type s */
|
||||
case _traced_table_new_answer:
|
||||
pc = NEXTOP(pc,s);
|
||||
break;
|
||||
/* instructions type e */
|
||||
case _traced_trie_do_appl:
|
||||
case _traced_trie_do_appl_in_pair:
|
||||
case _traced_trie_do_atom:
|
||||
case _traced_trie_do_atom_in_pair:
|
||||
case _traced_trie_do_bigint:
|
||||
case _traced_trie_do_double:
|
||||
case _traced_trie_do_extension:
|
||||
case _traced_trie_do_gterm:
|
||||
case _traced_trie_do_longint:
|
||||
case _traced_trie_do_null:
|
||||
case _traced_trie_do_null_in_pair:
|
||||
case _traced_trie_do_pair:
|
||||
case _traced_trie_do_val:
|
||||
case _traced_trie_do_val_in_pair:
|
||||
case _traced_trie_do_var:
|
||||
case _traced_trie_do_var_in_pair:
|
||||
case _traced_trie_retry_appl:
|
||||
case _traced_trie_retry_appl_in_pair:
|
||||
case _traced_trie_retry_atom:
|
||||
case _traced_trie_retry_atom_in_pair:
|
||||
case _traced_trie_retry_bigint:
|
||||
case _traced_trie_retry_double:
|
||||
case _traced_trie_retry_extension:
|
||||
case _traced_trie_retry_gterm:
|
||||
case _traced_trie_retry_longint:
|
||||
case _traced_trie_retry_null:
|
||||
case _traced_trie_retry_null_in_pair:
|
||||
case _traced_trie_retry_pair:
|
||||
case _traced_trie_retry_val:
|
||||
case _traced_trie_retry_val_in_pair:
|
||||
case _traced_trie_retry_var:
|
||||
case _traced_trie_retry_var_in_pair:
|
||||
case _traced_trie_trust_appl:
|
||||
case _traced_trie_trust_appl_in_pair:
|
||||
case _traced_trie_trust_atom:
|
||||
case _traced_trie_trust_atom_in_pair:
|
||||
case _traced_trie_trust_bigint:
|
||||
case _traced_trie_trust_double:
|
||||
case _traced_trie_trust_extension:
|
||||
case _traced_trie_trust_gterm:
|
||||
case _traced_trie_trust_longint:
|
||||
case _traced_trie_trust_null:
|
||||
case _traced_trie_trust_null_in_pair:
|
||||
case _traced_trie_trust_pair:
|
||||
case _traced_trie_trust_val:
|
||||
case _traced_trie_trust_val_in_pair:
|
||||
case _traced_trie_trust_var:
|
||||
case _traced_trie_trust_var_in_pair:
|
||||
case _traced_trie_try_appl:
|
||||
case _traced_trie_try_appl_in_pair:
|
||||
case _traced_trie_try_atom:
|
||||
case _traced_trie_try_atom_in_pair:
|
||||
case _traced_trie_try_bigint:
|
||||
case _traced_trie_try_double:
|
||||
case _traced_trie_try_extension:
|
||||
case _traced_trie_try_gterm:
|
||||
case _traced_trie_try_longint:
|
||||
case _traced_trie_try_null:
|
||||
case _traced_trie_try_null_in_pair:
|
||||
case _traced_trie_try_pair:
|
||||
case _traced_trie_try_val:
|
||||
case _traced_trie_try_val_in_pair:
|
||||
case _traced_trie_try_var:
|
||||
case _traced_trie_try_var_in_pair:
|
||||
pc = NEXTOP(pc,e);
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
/* this instruction is hardwired */
|
||||
#ifdef YAP_JIT
|
||||
case _traced_or_last:
|
||||
#ifdef YAPOR
|
||||
pp = pc->y_u.Osblp.p0;
|
||||
if (pp->PredFlags & MegaClausePredFlag)
|
||||
return found_mega_clause(pp, startp, endp);
|
||||
clause_code = TRUE;
|
||||
pc = NEXTOP(pc,Osblp);
|
||||
#else
|
||||
pp = pc->y_u.p.p;
|
||||
if (pp->PredFlags & MegaClausePredFlag)
|
||||
return found_mega_clause(pp, startp, endp);
|
||||
clause_code = TRUE;
|
||||
pc = NEXTOP(pc,p);
|
||||
#endif
|
||||
#endif
|
||||
case _or_last:
|
||||
#ifdef YAPOR
|
||||
pp = pc->y_u.Osblp.p0;
|
||||
|
@ -10,6 +10,7 @@ set(LIBJIT_SOURCES
|
||||
jit_statisticpreds.c
|
||||
jit_codegenpreds.c
|
||||
jit_debugpreds.c
|
||||
jit_traced.c
|
||||
jit_transformpreds.c
|
||||
JIT_Compiler.cpp
|
||||
JIT_Init.cpp
|
||||
@ -61,6 +62,6 @@ set_target_properties(libyapjit
|
||||
OUTPUT_NAME YapJIT
|
||||
)
|
||||
|
||||
target_link_libraries(libyapjit libYap ${LLVM_LIBRARIES} )
|
||||
target_link_libraries(libyapjit libYap ${LLVM_LIBRARIES} z)
|
||||
|
||||
set ( YAP_YAPJITLIB $<TARGET_FILE_NAME:libyapjit> )
|
||||
|
1203
JIT/HPP/IsGround.h
1203
JIT/HPP/IsGround.h
File diff suppressed because it is too large
Load Diff
@ -12,6 +12,9 @@
|
||||
#include <time.h>
|
||||
#include <dlfcn.h>
|
||||
#include "config.h"
|
||||
#if USE_GMP
|
||||
#include <gmpxx.h>
|
||||
#endif
|
||||
extern "C" {
|
||||
#include "absmi.h"
|
||||
}
|
||||
|
@ -89,26 +89,21 @@ class JIT_Compiler {
|
||||
/* method invoked by wrapper 'call_JIT_Compiler' */
|
||||
void* compile(yamop*);
|
||||
};
|
||||
#else
|
||||
|
||||
struct JIT_Compiler{}; // Doing this, I can call class 'JIT_Compiler' from C code
|
||||
extern "C" void* call_JIT_Compiler(JIT_Compiler* jc, yamop* p);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" void* call_JIT_Compiler(JIT_Compiler* jc, yamop* p) { return jc->compile(p); }
|
||||
|
||||
extern "C" void shutdown_llvm() { llvm_shutdown(); }
|
||||
extern "C" void shutdown_llvm();
|
||||
|
||||
#else
|
||||
|
||||
INLINE_ONLY inline EXTERN void* call_JIT_Compiler(struct JIT_Compiler* jc, yamop* p);
|
||||
typedef struct jit_compiler JIT_Compiler;
|
||||
|
||||
extern void* (*Yap_JitCall)(struct JIT_Compiler* jc, yamop* p);
|
||||
EXTERN void* (*Yap_JitCall)(JIT_Compiler* jc, yamop* p);
|
||||
|
||||
INLINE_ONLY inline EXTERN void* call_JIT_Compiler(JIT_Compiler* jc, yamop* p);
|
||||
|
||||
INLINE_ONLY inline EXTERN void* call_JIT_Compiler(struct JIT_Compiler* jc, yamop* p) { return Yap_JitCall (jc,p); }
|
||||
INLINE_ONLY inline EXTERN void* call_JIT_Compiler(JIT_Compiler* jc, yamop* p) {
|
||||
return Yap_JitCall (jc,p); }
|
||||
|
||||
INLINE_ONLY inline EXTERN void shutdown_llvm(void ) ;
|
||||
|
||||
@ -116,6 +111,6 @@ EXTERN void (* Yap_llvmShutdown)(void ) ;
|
||||
|
||||
INLINE_ONLY inline EXTERN void shutdown_llvm(void ) { Yap_llvmShutdown (); }
|
||||
|
||||
#endif //#ifdef __cplusplus
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -30,8 +30,8 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
|
||||
const PassInfo *PassToPrint;
|
||||
std::string PassName;
|
||||
|
||||
CallGraphSCCPassPrinter(const PassInfo *PI) :
|
||||
CallGraphSCCPass(ID), PassToPrint(PI) {
|
||||
CallGraphSCCPassPrinter(const PassInfo *PassInfo) :
|
||||
CallGraphSCCPass(ID), PassToPrint(PassInfo) {
|
||||
std::string PassToPrintName = PassToPrint->getPassName();
|
||||
PassName = "CallGraphSCCPass Printer: " + PassToPrintName;
|
||||
}
|
||||
@ -64,8 +64,8 @@ struct ModulePassPrinter : public ModulePass {
|
||||
const PassInfo *PassToPrint;
|
||||
std::string PassName;
|
||||
|
||||
ModulePassPrinter(const PassInfo *PI)
|
||||
: ModulePass(ID), PassToPrint(PI) {
|
||||
ModulePassPrinter(const PassInfo *PassInfo)
|
||||
: ModulePass(ID), PassToPrint(PassInfo) {
|
||||
std::string PassToPrintName = PassToPrint->getPassName();
|
||||
PassName = "ModulePass Printer: " + PassToPrintName;
|
||||
}
|
||||
@ -93,8 +93,8 @@ struct FunctionPassPrinter : public FunctionPass {
|
||||
static char ID;
|
||||
std::string PassName;
|
||||
|
||||
FunctionPassPrinter(const PassInfo *PI)
|
||||
: FunctionPass(ID), PassToPrint(PI) {
|
||||
FunctionPassPrinter(const PassInfo *PassInfo)
|
||||
: FunctionPass(ID), PassToPrint(PassInfo) {
|
||||
std::string PassToPrintName = PassToPrint->getPassName();
|
||||
PassName = "FunctionPass Printer: " + PassToPrintName;
|
||||
}
|
||||
@ -124,8 +124,8 @@ struct LoopPassPrinter : public LoopPass {
|
||||
const PassInfo *PassToPrint;
|
||||
std::string PassName;
|
||||
|
||||
LoopPassPrinter(const PassInfo *PI) :
|
||||
LoopPass(ID), PassToPrint(PI) {
|
||||
LoopPassPrinter(const PassInfo *PassInfo) :
|
||||
LoopPass(ID), PassToPrint(PassInfo) {
|
||||
std::string PassToPrintName = PassToPrint->getPassName();
|
||||
PassName = "LoopPass Printer: " + PassToPrintName;
|
||||
}
|
||||
@ -155,8 +155,8 @@ struct RegionPassPrinter : public RegionPass {
|
||||
const PassInfo *PassToPrint;
|
||||
std::string PassName;
|
||||
|
||||
RegionPassPrinter(const PassInfo *PI) : RegionPass(ID),
|
||||
PassToPrint(PI) {
|
||||
RegionPassPrinter(const PassInfo *PassInfo) : RegionPass(ID),
|
||||
PassToPrint(PassInfo) {
|
||||
std::string PassToPrintName = PassToPrint->getPassName();
|
||||
PassName = "RegionPass Printer: " + PassToPrintName;
|
||||
}
|
||||
|
1192
JIT/HPP/lastop.h
1192
JIT/HPP/lastop.h
File diff suppressed because it is too large
Load Diff
1191
JIT/HPP/nextof.hpp
1191
JIT/HPP/nextof.hpp
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
58
JIT/JIT_Init.cpp
Normal file
58
JIT/JIT_Init.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
|
||||
#include "JIT_Compiler.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
|
||||
|
||||
extern "C" void Yap_InitJitAnalysisPreds(void);
|
||||
extern "C" void Yap_InitJitTransformPreds(void);
|
||||
extern "C" void Yap_InitJitCodegenPreds(void);
|
||||
extern "C" void Yap_InitJitConfigPreds(void);
|
||||
#if YAP_STAT_PREDS
|
||||
extern "C" void Yap_InitJitStatisticPreds(void);
|
||||
#endif
|
||||
#if YAP_DBG_PREDS
|
||||
extern "C" void Yap_InitJitDebugPreds(void);
|
||||
#endif
|
||||
|
||||
// global variables with intercae
|
||||
extern "C" void* (*Yap_JitCall)(JIT_Compiler* jc, yamop* p);
|
||||
extern "C" void (* Yap_llvmShutdown)( ) ;
|
||||
extern "C" Int (* Yap_traced_absmi)( ) ;
|
||||
|
||||
void init_jit();
|
||||
|
||||
extern "C" void* call_JIT_Compiler(JIT_Compiler* jc, yamop* p) {
|
||||
return jc->compile(p); }
|
||||
|
||||
extern "C" void shutdown_llvm() { llvm_shutdown(); }
|
||||
|
||||
extern "C" Int traced_absmi();
|
||||
|
||||
static void
|
||||
initJit(void)
|
||||
{
|
||||
Yap_InitJitAnalysisPreds();
|
||||
Yap_InitJitTransformPreds();
|
||||
Yap_InitJitCodegenPreds();
|
||||
Yap_InitJitConfigPreds();
|
||||
#if YAP_STAT_PREDS
|
||||
Yap_InitJitStatisticPreds();
|
||||
#endif
|
||||
#if YAP_DBG_PREDS
|
||||
Yap_InitJitDebugPreds();
|
||||
#endif
|
||||
Yap_JitCall = call_JIT_Compiler;
|
||||
Yap_llvmShutdown = llvm_shutdown;
|
||||
Yap_traced_absmi = traced_absmi;
|
||||
}
|
||||
|
||||
// export JIT as DLL
|
||||
void
|
||||
init_jit() {
|
||||
initJit();
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
38
JIT/JIT_interface.cpp
Normal file
38
JIT/JIT_interface.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
#if YAP_JIT
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-function-declaration"
|
||||
|
||||
typedef void *(*call_jitc_t)(struct JIT_Compiler*, yamop *);
|
||||
|
||||
void *call_JIT_Compiler(struct JIT_Compiler*, yamop *);
|
||||
|
||||
static void
|
||||
initJit(void)
|
||||
{
|
||||
extern void shutdown_llvm(void);
|
||||
extern call_jitc_t Yap_JITCall;
|
||||
|
||||
Yap_InitJitAnalysisPreds();
|
||||
Yap_InitJitTransformPreds();
|
||||
Yap_InitJitCodegenPreds();
|
||||
Yap_InitJitConfigPreds();
|
||||
#if YAP_STAT_PREDS
|
||||
Yap_InitJitStatisticPreds();
|
||||
#endif
|
||||
#if YAP_DBG_PREDS
|
||||
Yap_InitJitDebugPreds();
|
||||
#endif
|
||||
GLOBAL_JIT_finalizer = shutdown_llvm;
|
||||
Yap_JITCall = call_JIT_Compiler;
|
||||
Yap_llvmShutdown = llvm_shutdown;
|
||||
|
||||
}
|
||||
|
||||
// export JIT as DLL
|
||||
void
|
||||
init_jit(void) {
|
||||
initJit();
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
#endif /* YAP_JIT */
|
||||
|
267
JIT/jit_traced.c
Normal file
267
JIT/jit_traced.c
Normal file
@ -0,0 +1,267 @@
|
||||
/*************************************************************************
|
||||
* *
|
||||
* Yap Prolog *
|
||||
* *
|
||||
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
||||
* *
|
||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
||||
* *
|
||||
**************************************************************************
|
||||
* *
|
||||
* File: jit_traced.c *
|
||||
* comments: Portable abstract machine interpreter *
|
||||
* Last rev: $Date: 2008-08-13 01:16:26 $,$Author: vsc $ *
|
||||
* *
|
||||
*************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@file jit_traced.c
|
||||
|
||||
@defgroup JIT_Impl Just-In-Time Compiler Implementation
|
||||
@ingroup
|
||||
|
||||
We next discuss several issues on trying to make Prolog programs run
|
||||
fast in YAP. We assume two different programming styles:
|
||||
|
||||
+ Execution of <em>deterministic</em> programs ofte
|
||||
n
|
||||
boils down to a recursive loop of the form:
|
||||
|
||||
~~~~~
|
||||
loop(Env) :-
|
||||
do_something(Env,NewEnv),
|
||||
loop(NewEnv).
|
||||
~~~~~
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if YAP_JIT
|
||||
|
||||
#define YAP_TRACED 1
|
||||
#define IN_ABSMI_C 1
|
||||
#define HAS_CACHE_REGS 1
|
||||
|
||||
#include "absmi.h"
|
||||
#include "heapgc.h"
|
||||
|
||||
#include "cut_c.h"
|
||||
|
||||
Int traced_absmi(void);
|
||||
|
||||
#ifdef PUSH_X
|
||||
#else
|
||||
|
||||
/* keep X as a global variable */
|
||||
|
||||
Term Yap_XREGS[MaxTemps]; /* 29 */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// #include "print_preg.h"
|
||||
//#include "sprint_op.hpp"
|
||||
//#include "print_op.hpp"
|
||||
|
||||
static Term
|
||||
interrupt_pexecute( PredEntry *pen USES_REGS ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "IsGround.h"
|
||||
#include "yaam_macros.hpp"
|
||||
#include "fprintblock.h"
|
||||
|
||||
#if YAP_DBG_PREDS
|
||||
#include "debug_printers.h"
|
||||
#endif
|
||||
|
||||
// ref to JIT compiler
|
||||
JIT_Compiler *J;
|
||||
|
||||
|
||||
extern NativeContext *NativeArea;
|
||||
extern IntermediatecodeContext *IntermediatecodeArea;
|
||||
|
||||
extern CELL l;
|
||||
|
||||
CELL nnexec;
|
||||
|
||||
void shutdown_llvm(void);
|
||||
|
||||
short global;
|
||||
yamop* HEADPREG;
|
||||
CELL BLOCK;
|
||||
CELL BLOCKADDRESS;
|
||||
CELL FAILED;
|
||||
|
||||
#undef SHADOW_P
|
||||
#undef SHADOW_CP
|
||||
#undef SHADOW_HB
|
||||
#undef SHADOW_Y
|
||||
#undef SHADOW_S
|
||||
|
||||
#undef PREG
|
||||
#define PREG P
|
||||
|
||||
#undef CPREG
|
||||
#define CPREG CP
|
||||
|
||||
#undef SREG
|
||||
#define SREG S
|
||||
|
||||
#undef YREG
|
||||
#define YREG YENV
|
||||
|
||||
#undef setregs
|
||||
#define setregs()
|
||||
|
||||
#undef saveregs
|
||||
#define saveregs()
|
||||
|
||||
#include "arith2.h"
|
||||
|
||||
Int
|
||||
traced_absmi(void)
|
||||
{
|
||||
CACHE_REGS
|
||||
|
||||
static void *OpAddress[] =
|
||||
{
|
||||
#define OPCODE(OP,TYPE) && OP
|
||||
#include "YapOpcodes.h"
|
||||
#undef OPCODE
|
||||
};
|
||||
|
||||
/* The indexing register so that we will not destroy ARG1 without
|
||||
* reason */
|
||||
#define I_R (XREGS[0])
|
||||
|
||||
static void *control_labels[] = { &&fail, &&NoStackCut, &&NoStackCommitY, &&NoStackCutE, &&NoStackCutT, &&NoStackEither, &&NoStackExecute, &&NoStackCall, &&NoStackDExecute, &&NoStackDeallocate, &¬railleft, &&NoStackFail, &&NoStackCommitX };
|
||||
|
||||
#if YAP_STAT_PREDS
|
||||
struct timeval timstart, timend;
|
||||
struct rusage rustart, ruend;
|
||||
#endif
|
||||
curtrace = NULL;
|
||||
curpreg = NULL;
|
||||
globalcurblock = NULL;
|
||||
ineedredefinedest = 0;
|
||||
NativeArea = (NativeContext*)malloc(sizeof(NativeContext));
|
||||
NativeArea->area.p = NULL;
|
||||
NativeArea->area.ok = NULL;
|
||||
NativeArea->area.pc = NULL;
|
||||
#if YAP_STAT_PREDS
|
||||
NativeArea->area.nrecomp = NULL;
|
||||
NativeArea->area.compilation_time = NULL;
|
||||
NativeArea->area.native_size_bytes = NULL;
|
||||
NativeArea->area.trace_size_bytes = NULL;
|
||||
NativeArea->success = NULL;
|
||||
NativeArea->runs = NULL;
|
||||
NativeArea->t_runs = NULL;
|
||||
#endif
|
||||
NativeArea->n = 0;
|
||||
IntermediatecodeArea = (IntermediatecodeContext*)malloc(sizeof(IntermediatecodeContext));
|
||||
IntermediatecodeArea->area.t = NULL;
|
||||
IntermediatecodeArea->area.ok = NULL;
|
||||
IntermediatecodeArea->area.isactive = NULL;
|
||||
IntermediatecodeArea->area.lastblock = NULL;
|
||||
#if YAP_STAT_PREDS
|
||||
IntermediatecodeArea->area.profiling_time = NULL;
|
||||
#endif
|
||||
IntermediatecodeArea->n = 0;
|
||||
nnexec = 0;
|
||||
l = 0;
|
||||
|
||||
|
||||
|
||||
setregs();
|
||||
|
||||
CACHE_A1();
|
||||
|
||||
reset_absmi:
|
||||
|
||||
SP = SP0;
|
||||
|
||||
/* when we start we are not in write mode */
|
||||
|
||||
{
|
||||
op_numbers opcode = _Ystop;
|
||||
goto critical_lbl;
|
||||
|
||||
nextop_write:
|
||||
|
||||
opcode = Yap_op_from_opcode( PREG->y_u.o.opcw );
|
||||
goto op_switch;
|
||||
|
||||
nextop:
|
||||
|
||||
opcode = Yap_op_from_opcode( PREG->opc );
|
||||
|
||||
op_switch:
|
||||
|
||||
|
||||
switch (opcode) {
|
||||
|
||||
#if !OS_HANDLES_TR_OVERFLOW
|
||||
notrailleft:
|
||||
/* if we are within indexing code, the system may have to
|
||||
* update a S */
|
||||
{
|
||||
CELL cut_b;
|
||||
|
||||
#ifdef SHADOW_S
|
||||
S = SREG;
|
||||
#endif
|
||||
/* YREG was pointing to where we were going to build the
|
||||
* next choice-point. The stack shifter will need to know this
|
||||
* to move the local stack */
|
||||
SET_ASP(YREG, E_CB*sizeof(CELL));
|
||||
cut_b = LCL0-(CELL *)(ASP[E_CB]);
|
||||
saveregs();
|
||||
if(!Yap_growtrail (0, false)) {
|
||||
Yap_NilError(OUT_OF_TRAIL_ERROR,"YAP failed to reserve %ld bytes in growtrail",sizeof(CELL) * K16);
|
||||
setregs();
|
||||
FAIL();
|
||||
}
|
||||
setregs();
|
||||
#ifdef SHADOW_S
|
||||
SREG = S;
|
||||
#endif
|
||||
if (SREG == ASP) {
|
||||
SREG[E_CB] = (CELL)(LCL0-cut_b);
|
||||
}
|
||||
}
|
||||
goto reset_absmi;
|
||||
|
||||
#endif /* OS_HANDLES_TR_OVERFLOW */
|
||||
|
||||
// move instructions to separate file
|
||||
// so that they are easier to analyse.
|
||||
#if YAP_JIT
|
||||
#include "../C/traced_absmi_insts.h"
|
||||
#if YAPOR
|
||||
#include "../OPTYap/traced_or.insts.h"
|
||||
#endif
|
||||
#if TABLING
|
||||
#include "../OPTYap/traced_tab.insts.h"
|
||||
#include "../OPTYap/traced_tab.tries.insts.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
default:
|
||||
saveregs();
|
||||
Yap_Error(SYSTEM_ERROR, MkIntegerTerm(opcode), "trying to execute invalid YAAM instruction %d", opcode);
|
||||
setregs();
|
||||
FAIL();
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
#endif /* YAP_JIT */
|
||||
|
@ -79,9 +79,7 @@
|
||||
TOP_STACK -= size; \
|
||||
memcpy(TOP_STACK, aux_stack, size * sizeof(CELL *)); \
|
||||
aux_stack = TOP_STACK; \
|
||||
}
|
||||
|
||||
/* macros 'store_trie_node', 'restore_trie_node' and 'pop_trie_node' **
|
||||
}/* macros 'store_trie_node', 'restore_trie_node' and 'pop_trie_node' **
|
||||
** do not include 'set_cut' because trie instructions are cut safe */
|
||||
|
||||
#define store_trie_node(AP) \
|
||||
|
@ -15,14 +15,14 @@
|
||||
** Scheduler instructions **
|
||||
** -------------------------------- */
|
||||
|
||||
PBOp(traced_getwork_first_time,e)
|
||||
PBOp(getwork_first_time,e)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
|
||||
|
||||
PBOp(traced_getwork,Otapl)
|
||||
PBOp(getwork,Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
@ -30,12 +30,12 @@ PBOp(traced_getwork_first_time,e)
|
||||
|
||||
/* The idea is to check whether we are the last worker in the node.
|
||||
If we are, we can go ahead, otherwise we should call the scheduler. */
|
||||
PBOp(traced_getwork_seq,Otapl)
|
||||
PBOp(getwork_seq,Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
|
||||
PBOp(traced_sync,Otapl)
|
||||
PBOp(sync,Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
@ -11,13 +11,23 @@
|
||||
** **
|
||||
************************************************************************/
|
||||
|
||||
#define TOP_STACK YENV
|
||||
|
||||
#define HEAP_ARITY_ENTRY (0)
|
||||
#define VARS_ARITY_ENTRY (1 + heap_arity)
|
||||
#define SUBS_ARITY_ENTRY (1 + heap_arity + 1 + vars_arity)
|
||||
|
||||
/* macros 'HEAP_ENTRY', 'VARS_ENTRY' and 'SUBS_ENTRY' **
|
||||
** assume that INDEX starts at 1 (and not at 0 !!!) */
|
||||
#define HEAP_ENTRY(INDEX) (HEAP_ARITY_ENTRY + (INDEX))
|
||||
#define VARS_ENTRY(INDEX) (VARS_ARITY_ENTRY + 1 + vars_arity - (INDEX))
|
||||
#define SUBS_ENTRY(INDEX) (SUBS_ARITY_ENTRY + 1 + subs_arity - (INDEX))
|
||||
|
||||
/************************************************************************
|
||||
** clause_with_cut **
|
||||
************************************************************************/
|
||||
|
||||
Op(traced_clause_with_cut, e)
|
||||
Op(clause_with_cut, e)
|
||||
{ printf("Tabling not supported by JIT!!\n"); exit(1); }
|
||||
ENDOp();
|
||||
|
||||
@ -27,7 +37,7 @@ ENDOp();
|
||||
** table_load_answer **
|
||||
************************************************************************/
|
||||
|
||||
PBOp(traced_table_load_answer, Otapl)
|
||||
PBOp(table_load_answer, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
@ -37,7 +47,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_try_answer **
|
||||
************************************************************************/
|
||||
|
||||
PBOp(traced_table_try_answer, Otapl)
|
||||
PBOp(table_try_answer, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
@ -47,7 +57,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_try_single **
|
||||
************************************************************************/
|
||||
|
||||
PBOp(traced_table_try_single, Otapl)
|
||||
PBOp(table_try_single, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
@ -57,7 +67,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_try_me **
|
||||
************************************************************************/
|
||||
|
||||
PBOp(traced_table_try_me, Otapl)
|
||||
PBOp(table_try_me, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
@ -67,7 +77,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_try **
|
||||
************************************************************************/
|
||||
|
||||
PBOp(traced_table_try, Otapl)
|
||||
PBOp(table_try, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
|
||||
ENDPBOp();
|
||||
@ -78,7 +88,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_retry_me **
|
||||
************************************************************************/
|
||||
|
||||
Op(traced_table_retry_me, Otapl)
|
||||
Op(table_retry_me, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDOp();
|
||||
|
||||
@ -88,7 +98,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_retry **
|
||||
************************************************************************/
|
||||
|
||||
Op(traced_table_retry, Otapl)
|
||||
Op(table_retry, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDOp();
|
||||
|
||||
@ -98,7 +108,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_trust_me **
|
||||
************************************************************************/
|
||||
|
||||
Op(traced_table_trust_me, Otapl)
|
||||
Op(table_trust_me, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDOp();
|
||||
|
||||
@ -108,7 +118,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_trust **
|
||||
************************************************************************/
|
||||
|
||||
Op(traced_table_trust, Otapl)
|
||||
Op(table_trust, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDOp();
|
||||
|
||||
@ -118,7 +128,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_new_answer **
|
||||
************************************************************************/
|
||||
|
||||
PBOp(traced_table_new_answer, s)
|
||||
PBOp(table_new_answer, s)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
@ -128,7 +138,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_answer_resolution **
|
||||
************************************************************************/
|
||||
|
||||
BOp(traced_table_answer_resolution, Otapl)
|
||||
BOp(table_answer_resolution, Otapl)
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
ENDBOp();
|
||||
|
||||
@ -138,7 +148,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_completion **
|
||||
************************************************************************/
|
||||
|
||||
BOp(traced_table_completion, Otapl)
|
||||
BOp(table_completion, Otapl)
|
||||
ENDBOp();
|
||||
|
||||
|
||||
@ -147,7 +157,7 @@ PBOp(traced_table_load_answer, Otapl)
|
||||
** table_answer_resolution_completion **
|
||||
************************************************************************/
|
||||
|
||||
BOp(traced_table_answer_resolution_completion, Otapl)
|
||||
BOp(table_answer_resolution_completion, Otapl)
|
||||
#ifdef THREADS_CONSUMER_SHARING
|
||||
{ printf("Or-parallelism not supported by JIT!!\n"); exit(1); }
|
||||
#endif /* THREADS_CONSUMER_SHARING */
|
||||
|
@ -11,253 +11,645 @@
|
||||
** **
|
||||
************************************************************************/
|
||||
|
||||
/************************************************************************
|
||||
** Trie instructions: auxiliary stack organization **
|
||||
*************************************************************************
|
||||
-------------------
|
||||
| ha = heap_arity |
|
||||
------------------- --
|
||||
| heap ptr 1 | |
|
||||
------------------- |
|
||||
| ... | -- heap_arity (0 if in global trie)
|
||||
------------------- |
|
||||
| heap ptr ha | |
|
||||
------------------- --
|
||||
| va = vars_arity |
|
||||
------------------- --
|
||||
| var ptr va | |
|
||||
------------------- |
|
||||
| ... | -- vars_arity
|
||||
------------------- |
|
||||
| var ptr 1 | |
|
||||
------------------- --
|
||||
| sa = subs_arity |
|
||||
------------------- --
|
||||
| subs ptr sa | |
|
||||
------------------- |
|
||||
| ... | -- subs_arity
|
||||
------------------- |
|
||||
| subs ptr 1 | |
|
||||
------------------- --
|
||||
************************************************************************/
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** Trie instructions: macros **
|
||||
************************************************************************/
|
||||
|
||||
#define TOP_STACK YENV
|
||||
|
||||
#define HEAP_ARITY_ENTRY (0)
|
||||
#define VARS_ARITY_ENTRY (1 + heap_arity)
|
||||
#define SUBS_ARITY_ENTRY (1 + heap_arity + 1 + vars_arity)
|
||||
|
||||
/* macros 'HEAP_ENTRY', 'VARS_ENTRY' and 'SUBS_ENTRY' **
|
||||
** assume that INDEX starts at 1 (and not at 0 !!!) */
|
||||
#define HEAP_ENTRY(INDEX) (HEAP_ARITY_ENTRY + (INDEX))
|
||||
#define VARS_ENTRY(INDEX) (VARS_ARITY_ENTRY + 1 + vars_arity - (INDEX))
|
||||
#define SUBS_ENTRY(INDEX) (SUBS_ARITY_ENTRY + 1 + subs_arity - (INDEX))
|
||||
|
||||
#define next_trie_instruction(NODE) \
|
||||
PREG = (yamop *) TrNode_child(NODE); \
|
||||
PREFETCH_OP(PREG); \
|
||||
GONext()
|
||||
|
||||
#define next_instruction(CONDITION, NODE) \
|
||||
if (CONDITION) { \
|
||||
PREG = (yamop *) TrNode_child(NODE); \
|
||||
} else { /* procceed */ \
|
||||
PREG = (yamop *) CPREG; \
|
||||
TOP_STACK = ENV; \
|
||||
} \
|
||||
PREFETCH_OP(PREG); \
|
||||
GONext()
|
||||
|
||||
#define copy_aux_stack() \
|
||||
{ int size = 3 + heap_arity + subs_arity + vars_arity; \
|
||||
TOP_STACK -= size; \
|
||||
memcpy(TOP_STACK, aux_stack, size * sizeof(CELL *)); \
|
||||
aux_stack = TOP_STACK; \
|
||||
}/* macros 'store_trie_node', 'restore_trie_node' and 'pop_trie_node' **
|
||||
** do not include 'set_cut' because trie instructions are cut safe */
|
||||
|
||||
#define store_trie_node(AP) \
|
||||
{ register choiceptr cp; \
|
||||
TOP_STACK = (CELL *) (NORM_CP(TOP_STACK) - 1); \
|
||||
cp = NORM_CP(TOP_STACK); \
|
||||
HBREG = HR; \
|
||||
store_yaam_reg_cpdepth(cp); \
|
||||
cp->cp_tr = TR; \
|
||||
cp->cp_h = HR; \
|
||||
cp->cp_b = B; \
|
||||
cp->cp_cp = CPREG; \
|
||||
cp->cp_ap = (yamop *) AP; \
|
||||
cp->cp_env= ENV; \
|
||||
B = cp; \
|
||||
YAPOR_SET_LOAD(B); \
|
||||
SET_BB(B); \
|
||||
TABLING_ERROR_CHECKING_STACK; \
|
||||
} \
|
||||
copy_aux_stack()
|
||||
|
||||
#define restore_trie_node(AP) \
|
||||
HR = HBREG = PROTECT_FROZEN_H(B); \
|
||||
restore_yaam_reg_cpdepth(B); \
|
||||
CPREG = B->cp_cp; \
|
||||
ENV = B->cp_env; \
|
||||
YAPOR_update_alternative(PREG, (yamop *) AP) \
|
||||
B->cp_ap = (yamop *) AP; \
|
||||
TOP_STACK = (CELL *) PROTECT_FROZEN_B(B); \
|
||||
SET_BB(NORM_CP(TOP_STACK)); \
|
||||
copy_aux_stack()
|
||||
|
||||
#define really_pop_trie_node() \
|
||||
TOP_STACK = (CELL *) PROTECT_FROZEN_B((B + 1)); \
|
||||
HR = PROTECT_FROZEN_H(B); \
|
||||
pop_yaam_reg_cpdepth(B); \
|
||||
CPREG = B->cp_cp; \
|
||||
TABLING_close_alt(B); \
|
||||
ENV = B->cp_env; \
|
||||
B = B->cp_b; \
|
||||
HBREG = PROTECT_FROZEN_H(B); \
|
||||
SET_BB(PROTECT_FROZEN_B(B)); \
|
||||
if ((choiceptr) TOP_STACK == B_FZ) { \
|
||||
copy_aux_stack(); \
|
||||
}
|
||||
|
||||
#ifdef YAPOR
|
||||
#define pop_trie_node() \
|
||||
if (SCH_top_shared_cp(B)) { \
|
||||
restore_trie_node(NULL); \
|
||||
} else { \
|
||||
really_pop_trie_node(); \
|
||||
}
|
||||
#else
|
||||
#define pop_trie_node() \
|
||||
really_pop_trie_node()
|
||||
#endif /* YAPOR */
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** aux_stack_null_instr **
|
||||
************************************************************************/
|
||||
|
||||
#define aux_stack_null_instr() \
|
||||
next_trie_instruction(node)
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** aux_stack_extension_instr **
|
||||
************************************************************************/
|
||||
|
||||
#define aux_stack_extension_instr() \
|
||||
TOP_STACK = &aux_stack[-2]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity + 2; \
|
||||
TOP_STACK[HEAP_ENTRY(1)] = TrNode_entry(node); \
|
||||
TOP_STACK[HEAP_ENTRY(2)] = 0; /* extension mark */ \
|
||||
next_trie_instruction(node)
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** aux_stack_term_(in_pair_)instr **
|
||||
************************************************************************/
|
||||
|
||||
#define aux_stack_term_instr() \
|
||||
if (heap_arity) { \
|
||||
Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], t); \
|
||||
TOP_STACK = &aux_stack[1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity - 1; \
|
||||
next_instruction(heap_arity - 1 || subs_arity, node); \
|
||||
} else { \
|
||||
YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], t); \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
next_instruction(subs_arity - 1, node); \
|
||||
}
|
||||
|
||||
#define aux_stack_term_in_pair_instr() \
|
||||
if (heap_arity) { \
|
||||
Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
|
||||
} else { \
|
||||
YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
TOP_STACK = &aux_stack[-1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = 1; \
|
||||
} \
|
||||
Bind_Global(HR, TrNode_entry(node)); \
|
||||
TOP_STACK[HEAP_ENTRY(1)] = (CELL) (HR + 1); \
|
||||
HR += 2; \
|
||||
next_trie_instruction(node)
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** aux_stack_(new_)pair_instr **
|
||||
************************************************************************/
|
||||
|
||||
#define aux_stack_new_pair_instr() /* for term 'CompactPairInit' */ \
|
||||
if (heap_arity) { \
|
||||
Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
|
||||
TOP_STACK = &aux_stack[-1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity + 1; \
|
||||
} else { \
|
||||
YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
TOP_STACK = &aux_stack[-2]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = 2; \
|
||||
} \
|
||||
TOP_STACK[HEAP_ENTRY(1)] = (CELL) HR; \
|
||||
TOP_STACK[HEAP_ENTRY(2)] = (CELL) (HR + 1); \
|
||||
HR += 2; \
|
||||
next_trie_instruction(node)
|
||||
|
||||
#ifdef TRIE_COMPACT_PAIRS
|
||||
#define aux_stack_pair_instr() /* for term 'CompactPairEndList' */ \
|
||||
if (heap_arity) { \
|
||||
Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
|
||||
} else { \
|
||||
YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
TOP_STACK = &aux_stack[-1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = 1; \
|
||||
} \
|
||||
TOP_STACK[HEAP_ENTRY(1)] = (CELL) HR; \
|
||||
Bind_Global(HR + 1, TermNil); \
|
||||
HR += 2; \
|
||||
next_trie_instruction(node)
|
||||
#else
|
||||
#define aux_stack_pair_instr() \
|
||||
aux_stack_new_pair_instr()
|
||||
#endif /* TRIE_COMPACT_PAIRS */
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** aux_stack_appl_(in_pair_)instr **
|
||||
************************************************************************/
|
||||
|
||||
#define aux_stack_appl_instr() \
|
||||
if (heap_arity) { \
|
||||
Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsAppl(HR)); \
|
||||
TOP_STACK = &aux_stack[-func_arity + 1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity + func_arity - 1; \
|
||||
} else { \
|
||||
YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsAppl(HR)); \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
TOP_STACK = &aux_stack[-func_arity]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = func_arity; \
|
||||
} \
|
||||
*HR = (CELL) func; \
|
||||
{ int i; \
|
||||
for (i = 1; i <= func_arity; i++) \
|
||||
TOP_STACK[HEAP_ENTRY(i)] = (CELL) (HR + i); \
|
||||
} \
|
||||
HR += 1 + func_arity; \
|
||||
next_trie_instruction(node)
|
||||
|
||||
#define aux_stack_appl_in_pair_instr() \
|
||||
if (heap_arity) { \
|
||||
Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
|
||||
TOP_STACK = &aux_stack[-func_arity]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity + func_arity; \
|
||||
} else { \
|
||||
YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
TOP_STACK = &aux_stack[-func_arity - 1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = func_arity + 1; \
|
||||
} \
|
||||
TOP_STACK[HEAP_ENTRY(func_arity + 1)] = (CELL) (HR + 1); \
|
||||
Bind_Global(HR, AbsAppl(HR + 2)); \
|
||||
HR += 2; \
|
||||
*HR = (CELL) func; \
|
||||
{ int i; \
|
||||
for (i = 1; i <= func_arity; i++) \
|
||||
TOP_STACK[HEAP_ENTRY(i)] = (CELL) (HR + i); \
|
||||
} \
|
||||
HR += 1 + func_arity; \
|
||||
next_trie_instruction(node)
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** aux_stack_var_(in_pair_)instr **
|
||||
************************************************************************/
|
||||
|
||||
#define aux_stack_var_instr() \
|
||||
if (heap_arity) { \
|
||||
int i; \
|
||||
CELL var = aux_stack[HEAP_ENTRY(1)]; \
|
||||
RESET_VARIABLE(var); \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity - 1; \
|
||||
for (i = 2; i <= heap_arity; i++) \
|
||||
TOP_STACK[HEAP_ENTRY(i - 1)] = aux_stack[HEAP_ENTRY(i)]; \
|
||||
aux_stack[VARS_ARITY_ENTRY - 1] = vars_arity + 1; \
|
||||
aux_stack[VARS_ENTRY(vars_arity + 1)] = var; \
|
||||
next_instruction(heap_arity - 1 || subs_arity, node); \
|
||||
} else { \
|
||||
CELL var = aux_stack[SUBS_ENTRY(1)]; \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
TOP_STACK = &aux_stack[-1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = 0; \
|
||||
aux_stack[VARS_ARITY_ENTRY - 1] = vars_arity + 1; \
|
||||
aux_stack[VARS_ENTRY(vars_arity + 1)] = var; \
|
||||
next_instruction(subs_arity - 1, node); \
|
||||
}
|
||||
|
||||
#define aux_stack_var_in_pair_instr() \
|
||||
if (heap_arity) { \
|
||||
int i; \
|
||||
Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
|
||||
TOP_STACK = &aux_stack[-1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity; \
|
||||
TOP_STACK[HEAP_ENTRY(1)] = (CELL) (HR + 1); \
|
||||
for (i = 2; i <= heap_arity; i++) \
|
||||
TOP_STACK[HEAP_ENTRY(i)] = aux_stack[HEAP_ENTRY(i)]; \
|
||||
} else { \
|
||||
YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
TOP_STACK = &aux_stack[-2]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = 1; \
|
||||
TOP_STACK[HEAP_ENTRY(1)] = (CELL) (HR + 1); \
|
||||
} \
|
||||
aux_stack[VARS_ARITY_ENTRY - 1] = vars_arity + 1; \
|
||||
aux_stack[VARS_ENTRY(vars_arity + 1)] = (CELL) HR; \
|
||||
RESET_VARIABLE((CELL) HR); \
|
||||
HR += 2; \
|
||||
next_trie_instruction(node)
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** aux_stack_val_(in_pair_)instr **
|
||||
************************************************************************/
|
||||
|
||||
#define aux_stack_val_instr() \
|
||||
if (heap_arity) { \
|
||||
CELL aux_sub, aux_var; \
|
||||
aux_sub = aux_stack[HEAP_ENTRY(1)]; \
|
||||
aux_var = aux_stack[VARS_ENTRY(var_index + 1)]; \
|
||||
if (aux_sub > aux_var) { \
|
||||
Bind_Global((CELL *) aux_sub, aux_var); \
|
||||
} else { \
|
||||
RESET_VARIABLE(aux_sub); \
|
||||
Bind_Local((CELL *) aux_var, aux_sub); \
|
||||
aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
|
||||
} \
|
||||
TOP_STACK = &aux_stack[1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = heap_arity - 1; \
|
||||
next_instruction(heap_arity - 1 || subs_arity, node); \
|
||||
} else { \
|
||||
CELL aux_sub, aux_var; \
|
||||
aux_sub = aux_stack[SUBS_ENTRY(1)]; \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
aux_var = aux_stack[VARS_ENTRY(var_index + 1)]; \
|
||||
if (aux_sub > aux_var) { \
|
||||
if ((CELL *) aux_sub <= HR) { \
|
||||
Bind_Global((CELL *) aux_sub, aux_var); \
|
||||
} else if ((CELL *) aux_var <= HR) { \
|
||||
Bind_Local((CELL *) aux_sub, aux_var); \
|
||||
} else { \
|
||||
Bind_Local((CELL *) aux_var, aux_sub); \
|
||||
aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
|
||||
} \
|
||||
} else { \
|
||||
if ((CELL *) aux_var <= HR) { \
|
||||
Bind_Global((CELL *) aux_var, aux_sub); \
|
||||
aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
|
||||
} else if ((CELL *) aux_sub <= HR) { \
|
||||
Bind_Local((CELL *) aux_var, aux_sub); \
|
||||
aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
|
||||
} else { \
|
||||
Bind_Local((CELL *) aux_sub, aux_var); \
|
||||
} \
|
||||
} \
|
||||
next_instruction(subs_arity - 1, node); \
|
||||
}
|
||||
|
||||
#define aux_stack_val_in_pair_instr() \
|
||||
if (heap_arity) { \
|
||||
Bind_Global((CELL *) aux_stack[HEAP_ENTRY(1)], AbsPair(HR)); \
|
||||
} else { \
|
||||
YapBind((CELL *) aux_stack[SUBS_ENTRY(1)], AbsPair(HR)); \
|
||||
aux_stack[SUBS_ARITY_ENTRY] = subs_arity - 1; \
|
||||
TOP_STACK = &aux_stack[-1]; \
|
||||
TOP_STACK[HEAP_ARITY_ENTRY] = 1; \
|
||||
} \
|
||||
{ CELL aux_sub, aux_var; \
|
||||
aux_sub = (CELL) HR; \
|
||||
aux_var = aux_stack[VARS_ENTRY(var_index + 1)]; \
|
||||
if (aux_sub > aux_var) { \
|
||||
Bind_Global((CELL *) aux_sub, aux_var); \
|
||||
} else { \
|
||||
RESET_VARIABLE(aux_sub); \
|
||||
Bind_Local((CELL *) aux_var, aux_sub); \
|
||||
aux_stack[VARS_ENTRY(var_index + 1)] = aux_sub; \
|
||||
} \
|
||||
} \
|
||||
TOP_STACK[HEAP_ENTRY(1)] = (CELL) (HR + 1); \
|
||||
HR += 2; \
|
||||
next_trie_instruction(node)
|
||||
|
||||
|
||||
/************************************************************************
|
||||
** Trie instructions **
|
||||
************************************************************************/
|
||||
|
||||
PBOp(traced_trie_do_var, e)
|
||||
PBOp(trie_do_var, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_var, e)
|
||||
PBOp(trie_trust_var, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_var, e)
|
||||
PBOp(trie_try_var, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_var, e)
|
||||
PBOp(trie_retry_var, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_var_in_pair, e)
|
||||
PBOp(trie_do_var_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_var_in_pair, e)
|
||||
PBOp(trie_trust_var_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_var_in_pair, e)
|
||||
PBOp(trie_try_var_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_var_in_pair, e)
|
||||
PBOp(trie_retry_var_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_val, e)
|
||||
PBOp(trie_do_val, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_val, e)
|
||||
PBOp(trie_trust_val, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_val, e)
|
||||
PBOp(trie_try_val, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_val, e)
|
||||
PBOp(trie_retry_val, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_val_in_pair, e)
|
||||
PBOp(trie_do_val_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_val_in_pair, e)
|
||||
PBOp(trie_trust_val_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_val_in_pair, e)
|
||||
PBOp(trie_try_val_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_val_in_pair, e)
|
||||
PBOp(trie_retry_val_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_atom, e)
|
||||
PBOp(trie_do_atom, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_atom, e)
|
||||
PBOp(trie_trust_atom, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_atom, e)
|
||||
PBOp(trie_try_atom, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_atom, e)
|
||||
PBOp(trie_retry_atom, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_atom_in_pair, e)
|
||||
PBOp(trie_do_atom_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_atom_in_pair, e)
|
||||
PBOp(trie_trust_atom_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_atom_in_pair, e)
|
||||
PBOp(trie_try_atom_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_atom_in_pair, e)
|
||||
PBOp(trie_retry_atom_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_null, e)
|
||||
PBOp(trie_do_null, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_null, e)
|
||||
PBOp(trie_trust_null, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_null, e)
|
||||
PBOp(trie_try_null, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_null, e)
|
||||
PBOp(trie_retry_null, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_null_in_pair, e)
|
||||
PBOp(trie_do_null_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_null_in_pair, e)
|
||||
PBOp(trie_trust_null_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_null_in_pair, e)
|
||||
PBOp(trie_try_null_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_null_in_pair, e)
|
||||
PBOp(trie_retry_null_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_pair, e)
|
||||
PBOp(trie_do_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_pair, e)
|
||||
PBOp(trie_trust_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_pair, e)
|
||||
PBOp(trie_try_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_pair, e)
|
||||
PBOp(trie_retry_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_appl, e)
|
||||
PBOp(trie_do_appl, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_appl, e)
|
||||
PBOp(trie_trust_appl, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_appl, e)
|
||||
PBOp(trie_try_appl, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_appl, e)
|
||||
PBOp(trie_retry_appl, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_appl_in_pair, e)
|
||||
PBOp(trie_do_appl_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_appl_in_pair, e)
|
||||
PBOp(trie_trust_appl_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_appl_in_pair, e)
|
||||
PBOp(trie_try_appl_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_appl_in_pair, e)
|
||||
PBOp(trie_retry_appl_in_pair, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_extension, e)
|
||||
PBOp(trie_do_extension, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_extension, e)
|
||||
PBOp(trie_trust_extension, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_extension, e)
|
||||
PBOp(trie_try_extension, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_extension, e)
|
||||
PBOp(trie_retry_extension, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_double, e)
|
||||
PBOp(trie_do_double, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_stack = TOP_STACK;
|
||||
int heap_arity = aux_stack[HEAP_ARITY_ENTRY];
|
||||
@ -286,22 +678,22 @@ ENDPBOp();
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_trust_double, e)
|
||||
BOp(trie_trust_double, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "trie_trust_double: invalid instruction");
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_try_double, e)
|
||||
BOp(trie_try_double, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "trie_try_double: invalid instruction");
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_retry_double, e)
|
||||
BOp(trie_retry_double, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "trie_retry_double: invalid instruction");
|
||||
ENDBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_longint, e)
|
||||
PBOp(trie_do_longint, e)
|
||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||
register CELL *aux_stack = TOP_STACK;
|
||||
int heap_arity = aux_stack[HEAP_ARITY_ENTRY];
|
||||
@ -317,54 +709,54 @@ ENDPBOp();
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_trust_longint, e)
|
||||
BOp(trie_trust_longint, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "trie_trust_longint: invalid instruction");
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_try_longint, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "traced_trie_try_longint: invalid instruction");
|
||||
BOp(trie_try_longint, e)
|
||||
Yap_Error(INTERNAL_ERROR, TermNil, "trie_try_longint: invalid instruction");
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_retry_longint, e)
|
||||
BOp(trie_retry_longint, e)
|
||||
ENDBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_do_bigint, e)
|
||||
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
||||
PBOp(trie_do_bigint, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_trust_bigint, e)
|
||||
BOp(trie_trust_bigint, e)
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_try_bigint, e)
|
||||
BOp(trie_try_bigint, e)
|
||||
ENDBOp();
|
||||
|
||||
|
||||
BOp(traced_trie_retry_bigint, e)
|
||||
BOp(trie_retry_bigint, e)
|
||||
ENDBOp();
|
||||
|
||||
|
||||
|
||||
PBOp(traced_trie_do_gterm, e)
|
||||
PBOp(trie_do_gterm, e)
|
||||
|
||||
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_trust_gterm, e)
|
||||
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
||||
PBOp(trie_trust_gterm, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_try_gterm, e)
|
||||
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
||||
PBOp(trie_try_gterm, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
||||
|
||||
PBOp(traced_trie_retry_gterm, e)
|
||||
{ printf("Traced_Tries not supported by JIT!!\n"); exit(1); }
|
||||
PBOp(trie_retry_gterm, e)
|
||||
{ printf("Tries not supported by JIT!!\n"); exit(1); }
|
||||
ENDPBOp();
|
||||
|
@ -177,7 +177,7 @@ RL_Tree* set_in_rl(RL_Tree* tree,NUM number,STATUS status) {
|
||||
if ( number >0 && number <=tree->range_max)
|
||||
set_in(number,ROOT(tree),1,ROOT_INTERVAL(tree),tree->range_max,tree,status);
|
||||
#ifdef DEBUG
|
||||
printf("Setting: %d size=%d\n",number,tree->size);
|
||||
printf("Setting: %ul size=%ul\n",number,tree->size);
|
||||
#endif
|
||||
/*if (status==IN && !in_rl(tree,number)) {
|
||||
fprintf(stderr,"Error adding %lu to tree: size=%lu max=%lu\n",number,tree->size,tree->range_max);
|
||||
|
@ -47,17 +47,17 @@ main :-
|
||||
retractall(op(_,_)),
|
||||
file('OPTYap/tab.tries.insts.h', W, C, L, F, H, S),
|
||||
end_ifdef(W, C, L, F, H, S),
|
||||
start_ifdef("YAP_JIT", W, C, L, F, H, S),
|
||||
file('C/traced_absmi_insts.h', W, C, L, F, H, S),
|
||||
start_ifdef("YAPOR", W, C, L, F, H, S),
|
||||
file('OPTYap/traced_or.insts.h',W, C, L, F, H, S),
|
||||
end_ifdef(W, C, L, F, H, S),
|
||||
start_ifdef("TABLING", W, C, L, F, H, S),
|
||||
file('OPTYap/traced_tab.insts.h',W,C,L, F, H, S),
|
||||
retractall(op(_,_)),
|
||||
file('OPTYap/traced_tab.tries.insts.h', W, C, L, F, H, S),
|
||||
end_ifdef(W, C, L, F, H, S),
|
||||
end_ifdef(W, C, L, F, H, S),
|
||||
%start_ifdef("YAP_JIT", W, C, L, F, H, S),
|
||||
%file('C/traced_absmi_insts.h', W, C, L, F, H, S),
|
||||
%start_ifdef("YAPOR", W, C, L, F, H, S),
|
||||
%file('OPTYap/traced_or.insts.h',W, C, L, F, H, S),
|
||||
%end_ifdef(W, C, L, F, H, S),
|
||||
%start_ifdef("TABLING", W, C, L, F, H, S),
|
||||
%file('OPTYap/traced_tab.insts.h',W,C,L, F, H, S),
|
||||
%retractall(op(_,_)),
|
||||
%file('OPTYap/traced_tab.tries.insts.h', W, C, L, F, H, S),
|
||||
%end_ifdef(W, C, L, F, H, S),
|
||||
%end_ifdef(W, C, L, F, H, S),
|
||||
footer(W),
|
||||
footer_rclause(C),
|
||||
footer_walk_clause(L),
|
||||
@ -744,13 +744,6 @@ dump_head_action(logical, _, _, L) :-
|
||||
footer(W) :-
|
||||
format(W,' /* this instruction is hardwired */~n',[]),
|
||||
format(W,' /* or_last must be the last instruction. */~n',[]),
|
||||
format(W,'#ifdef YAP_JIT~n',[]),
|
||||
format(W,'#ifdef YAPOR~n',[]),
|
||||
format(W,' OPCODE(~s~36+,~s),~n',["traced_or_last","sblp"]),
|
||||
format(W,'#else~n',[]),
|
||||
format(W,' OPCODE(~s~36+,~s),~n',["traced_or_last","p"]),
|
||||
format(W,'#endif~n',[]),
|
||||
format(W,'#endif~n',[]),
|
||||
format(W,'#ifdef YAPOR~n',[]),
|
||||
format(W,' OPCODE(~s~36+,~s),~n',["or_last","sblp"]),
|
||||
format(W,'#else~n',[]),
|
||||
@ -760,14 +753,6 @@ footer(W) :-
|
||||
|
||||
footer_rclause(W) :-
|
||||
format(W,' /* this instruction is hardwired */~n',[]),
|
||||
format(W,'#ifdef YAP_JIT~n',[]),
|
||||
dump_ops(W,["traced_or_last"]),
|
||||
format(W,'#ifdef YAPOR~n',[]),
|
||||
output_typeinfo(W,"Osblp"),
|
||||
format(W,'#else~n',[]),
|
||||
output_typeinfo(W,"p"),
|
||||
format(W,'#endif~n',[]),
|
||||
format(W,'#endif~n',[]),
|
||||
dump_ops(W,["or_last"]),
|
||||
format(W,'#ifdef YAPOR~n',[]),
|
||||
output_typeinfo(W,"Osblp"),
|
||||
@ -781,14 +766,6 @@ footer_rclause(W) :-
|
||||
|
||||
footer_walk_clause(W) :-
|
||||
format(W,' /* this instruction is hardwired */~n',[]),
|
||||
format(W,'#ifdef YAP_JIT~n',[]),
|
||||
dump_ops(W,["traced_or_last"]),
|
||||
format(W,'#ifdef YAPOR~n',[]),
|
||||
add_pp(W,"Osblp","p0"),
|
||||
format(W,'#else~n',[]),
|
||||
add_pp(W,"p","p"),
|
||||
format(W,'#endif~n',[]),
|
||||
format(W,'#endif~n',[]),
|
||||
dump_ops(W,["or_last"]),
|
||||
format(W,'#ifdef YAPOR~n',[]),
|
||||
add_pp(W,"Osblp","p0"),
|
||||
|
Reference in New Issue
Block a user