fix indexing on dynamics (bug introduced when fixing MT code).

This commit is contained in:
Vitor Santos Costa 2014-10-20 23:47:33 +01:00
parent 98ee3fd078
commit a4081673e5
4 changed files with 28 additions and 7 deletions

View File

@ -1118,6 +1118,11 @@ move_next(ClauseDef *clause, UInt regno)
switch (op) {
case _native_me:
return;
#if THREADS
case _unlock_lu:
clause->CurrentCode = NEXTOP(cl,e);
return;
#endif
case _p_db_ref_x:
case _p_float_x:
if (wreg == cl->y_u.xl.x) {
@ -1386,6 +1391,11 @@ add_arg_info(ClauseDef *clause, PredEntry *ap, UInt argno)
case _run_eam:
cl = NEXTOP(cl,os);
break;
#endif
#ifdef THREADS
case _unlock_lu:
cl = NEXTOP(cl,e);
break;
#endif
case _get_dbterm:
cl = NEXTOP(cl,xc);
@ -1508,6 +1518,9 @@ skip_to_arg(ClauseDef *clause, PredEntry *ap, UInt argno, int at_point)
case _unify_struct_write:
cl = NEXTOP(cl,ofa);
break;
#ifdef THREADS
case _unlock_lu:
#endif
case _pop:
cl = NEXTOP(cl,e);
break;
@ -5580,9 +5593,6 @@ add_to_index(struct intermediates *cint, int first, path_stack_entry *sp, Clause
case _lock_lu:
ipc = NEXTOP(ipc,p);
break;
case _unlock_lu:
ipc = NEXTOP(ipc,e);
break;
case _op_fail:
while ((--sp)->flag != block_entry);
*sp->uip.cle.entry_code = cls->Code;

View File

@ -625,6 +625,9 @@
case _lock_lu:
cl = NEXTOP(cl,p);
break;
case _unlock_lu:
cl = NEXTOP(cl,e);
break;
case _call_bfunc_xx:
cl = NEXTOP(cl,plxxs);
break;

View File

@ -7,8 +7,11 @@
op_numbers op = Yap_op_from_opcode(cl->opc);
switch (op) {
case _ensure_space:
cl = NEXTOP(cl,Osbpa);
break;
cl = NEXTOP(cl,Osbpa);
break;
case _unlock_lu:
cl = NEXTOP(cl,e);
break;
case _native_me:
cl = NEXTOP(cl,aFlp);
break;

View File

@ -171,6 +171,8 @@ special_op("table_answer_resolution_completion","THREADS_CONSUMER_SHARING").
special_op("run_eam","BEAM").
special_op("retry_eam","BEAM").
special_op("thread_local","THREADS").
special_op("lock_lu","THREADS").
special_op("unlock_lu","THREADS").
output_rclause(C) :-
setof(T,O^op(T,O),Types),
@ -196,7 +198,7 @@ output_typeinfo(_,_).
% tables require access to the table info.
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") :- !,
format(C,' if (op == _Ystop) return;~n',[]).
special_formats(C,"sssl") :- !,
@ -858,6 +860,8 @@ opinfo("p_nonvar_y",[body,ifthenelse]).
opinfo("save_b_x",[body,new("x")]).
opinfo("save_b_y",[body,new("y")]).
opinfo("ensure_space",[]).
opinfo("lock_lu",[body]).
opinfo("unlock_lu",[]).
opinfo("write_x_loc",[body]).
opinfo("write_x_var",[body,new("x")]).
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_f_val_y",[body]).
opinfo("put_i_val_y",[body]).
opinfo("lock_lu",[body]).
opinfo("call_bfunc_xx",[body]).
opinfo("call_bfunc_yx",[body]).
opinfo("call_bfunc_xy",[body]).
@ -1148,12 +1151,14 @@ output_save_clause(S) :-
output_save_clause(_).
output_save_type(S, T) :-
(T=="e" -> start_low_level_trace; true),
format(S,' /* instructions type ~s */~n',[T]),
setof(Op,op(T,Op),Ops),
dump_ops(S,Ops),
% then the code for every instruction with this header.
tinfo(T, Desc),
output_save(S, T, Desc, T),
(T=="e" -> stop_low_level_trace; true),
format(S,' pc = NEXTOP(pc,~s);~n',[T]),
format(S,' break;~n',[]).