fix indexing on dynamics (bug introduced when fixing MT code).
This commit is contained in:
parent
98ee3fd078
commit
a4081673e5
16
C/index.c
16
C/index.c
@ -1118,6 +1118,11 @@ move_next(ClauseDef *clause, UInt regno)
|
|||||||
switch (op) {
|
switch (op) {
|
||||||
case _native_me:
|
case _native_me:
|
||||||
return;
|
return;
|
||||||
|
#if THREADS
|
||||||
|
case _unlock_lu:
|
||||||
|
clause->CurrentCode = NEXTOP(cl,e);
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
case _p_db_ref_x:
|
case _p_db_ref_x:
|
||||||
case _p_float_x:
|
case _p_float_x:
|
||||||
if (wreg == cl->y_u.xl.x) {
|
if (wreg == cl->y_u.xl.x) {
|
||||||
@ -1386,6 +1391,11 @@ add_arg_info(ClauseDef *clause, PredEntry *ap, UInt argno)
|
|||||||
case _run_eam:
|
case _run_eam:
|
||||||
cl = NEXTOP(cl,os);
|
cl = NEXTOP(cl,os);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#ifdef THREADS
|
||||||
|
case _unlock_lu:
|
||||||
|
cl = NEXTOP(cl,e);
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
case _get_dbterm:
|
case _get_dbterm:
|
||||||
cl = NEXTOP(cl,xc);
|
cl = NEXTOP(cl,xc);
|
||||||
@ -1508,6 +1518,9 @@ skip_to_arg(ClauseDef *clause, PredEntry *ap, UInt argno, int at_point)
|
|||||||
case _unify_struct_write:
|
case _unify_struct_write:
|
||||||
cl = NEXTOP(cl,ofa);
|
cl = NEXTOP(cl,ofa);
|
||||||
break;
|
break;
|
||||||
|
#ifdef THREADS
|
||||||
|
case _unlock_lu:
|
||||||
|
#endif
|
||||||
case _pop:
|
case _pop:
|
||||||
cl = NEXTOP(cl,e);
|
cl = NEXTOP(cl,e);
|
||||||
break;
|
break;
|
||||||
@ -5580,9 +5593,6 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause
|
|||||||
case _lock_lu:
|
case _lock_lu:
|
||||||
ipc = NEXTOP(ipc,p);
|
ipc = NEXTOP(ipc,p);
|
||||||
break;
|
break;
|
||||||
case _unlock_lu:
|
|
||||||
ipc = NEXTOP(ipc,e);
|
|
||||||
break;
|
|
||||||
case _op_fail:
|
case _op_fail:
|
||||||
while ((--sp)->flag != block_entry);
|
while ((--sp)->flag != block_entry);
|
||||||
*sp->uip.cle.entry_code = cls->Code;
|
*sp->uip.cle.entry_code = cls->Code;
|
||||||
|
@ -625,6 +625,9 @@
|
|||||||
case _lock_lu:
|
case _lock_lu:
|
||||||
cl = NEXTOP(cl,p);
|
cl = NEXTOP(cl,p);
|
||||||
break;
|
break;
|
||||||
|
case _unlock_lu:
|
||||||
|
cl = NEXTOP(cl,e);
|
||||||
|
break;
|
||||||
case _call_bfunc_xx:
|
case _call_bfunc_xx:
|
||||||
cl = NEXTOP(cl,plxxs);
|
cl = NEXTOP(cl,plxxs);
|
||||||
break;
|
break;
|
||||||
|
@ -7,8 +7,11 @@
|
|||||||
op_numbers op = Yap_op_from_opcode(cl->opc);
|
op_numbers op = Yap_op_from_opcode(cl->opc);
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case _ensure_space:
|
case _ensure_space:
|
||||||
cl = NEXTOP(cl,Osbpa);
|
cl = NEXTOP(cl,Osbpa);
|
||||||
break;
|
break;
|
||||||
|
case _unlock_lu:
|
||||||
|
cl = NEXTOP(cl,e);
|
||||||
|
break;
|
||||||
case _native_me:
|
case _native_me:
|
||||||
cl = NEXTOP(cl,aFlp);
|
cl = NEXTOP(cl,aFlp);
|
||||||
break;
|
break;
|
||||||
|
@ -171,6 +171,8 @@ special_op("table_answer_resolution_completion","THREADS_CONSUMER_SHARING").
|
|||||||
special_op("run_eam","BEAM").
|
special_op("run_eam","BEAM").
|
||||||
special_op("retry_eam","BEAM").
|
special_op("retry_eam","BEAM").
|
||||||
special_op("thread_local","THREADS").
|
special_op("thread_local","THREADS").
|
||||||
|
special_op("lock_lu","THREADS").
|
||||||
|
special_op("unlock_lu","THREADS").
|
||||||
|
|
||||||
output_rclause(C) :-
|
output_rclause(C) :-
|
||||||
setof(T,O^op(T,O),Types),
|
setof(T,O^op(T,O),Types),
|
||||||
@ -196,7 +198,7 @@ output_typeinfo(_,_).
|
|||||||
|
|
||||||
% tables require access to the table info.
|
% tables require access to the table info.
|
||||||
special_formats(C,"e") :- !,
|
special_formats(C,"e") :- !,
|
||||||
format(C,' if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return;~n',[]).
|
format(C,' if (pp == _nstop || op == _copy_idb_term || op == _unify_idb_term) return;~n',[]).
|
||||||
special_formats(C,"l") :- !,
|
special_formats(C,"l") :- !,
|
||||||
format(C,' if (op == _Ystop) return;~n',[]).
|
format(C,' if (op == _Ystop) return;~n',[]).
|
||||||
special_formats(C,"sssl") :- !,
|
special_formats(C,"sssl") :- !,
|
||||||
@ -858,6 +860,8 @@ opinfo("p_nonvar_y",[body,ifthenelse]).
|
|||||||
opinfo("save_b_x",[body,new("x")]).
|
opinfo("save_b_x",[body,new("x")]).
|
||||||
opinfo("save_b_y",[body,new("y")]).
|
opinfo("save_b_y",[body,new("y")]).
|
||||||
opinfo("ensure_space",[]).
|
opinfo("ensure_space",[]).
|
||||||
|
opinfo("lock_lu",[body]).
|
||||||
|
opinfo("unlock_lu",[]).
|
||||||
opinfo("write_x_loc",[body]).
|
opinfo("write_x_loc",[body]).
|
||||||
opinfo("write_x_var",[body,new("x")]).
|
opinfo("write_x_var",[body,new("x")]).
|
||||||
opinfo("write_y_var",[body,new("y")]).
|
opinfo("write_y_var",[body,new("y")]).
|
||||||
@ -1128,7 +1132,6 @@ opinfo("put_i_val_x",[body]).
|
|||||||
opinfo("put_fi_val_y",[body]).
|
opinfo("put_fi_val_y",[body]).
|
||||||
opinfo("put_f_val_y",[body]).
|
opinfo("put_f_val_y",[body]).
|
||||||
opinfo("put_i_val_y",[body]).
|
opinfo("put_i_val_y",[body]).
|
||||||
opinfo("lock_lu",[body]).
|
|
||||||
opinfo("call_bfunc_xx",[body]).
|
opinfo("call_bfunc_xx",[body]).
|
||||||
opinfo("call_bfunc_yx",[body]).
|
opinfo("call_bfunc_yx",[body]).
|
||||||
opinfo("call_bfunc_xy",[body]).
|
opinfo("call_bfunc_xy",[body]).
|
||||||
@ -1148,12 +1151,14 @@ output_save_clause(S) :-
|
|||||||
output_save_clause(_).
|
output_save_clause(_).
|
||||||
|
|
||||||
output_save_type(S, T) :-
|
output_save_type(S, T) :-
|
||||||
|
(T=="e" -> start_low_level_trace; true),
|
||||||
format(S,' /* instructions type ~s */~n',[T]),
|
format(S,' /* instructions type ~s */~n',[T]),
|
||||||
setof(Op,op(T,Op),Ops),
|
setof(Op,op(T,Op),Ops),
|
||||||
dump_ops(S,Ops),
|
dump_ops(S,Ops),
|
||||||
% then the code for every instruction with this header.
|
% then the code for every instruction with this header.
|
||||||
tinfo(T, Desc),
|
tinfo(T, Desc),
|
||||||
output_save(S, T, Desc, T),
|
output_save(S, T, Desc, T),
|
||||||
|
(T=="e" -> stop_low_level_trace; true),
|
||||||
format(S,' pc = NEXTOP(pc,~s);~n',[T]),
|
format(S,' pc = NEXTOP(pc,~s);~n',[T]),
|
||||||
format(S,' break;~n',[]).
|
format(S,' break;~n',[]).
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user