mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 13:55:07 +00:00
Add a test to find the number of words needed to represent a
configure.in:
Add a test to find the number of words needed to represent a
synchronization term.
boehm_gc/gc.h:
fix a declaration by replacing the args () with (void).
boehm_gc/solaris_pthreads.c:
add a missing include
check the return values of pthread calls.
compiler/*.m:
Add handling for the new HLDS goal type par_conj.
Add handling for the four new LLDS instructions:
init_sync_term
fork
join_and_terminate
join_and_continue
compiler/code_info.m:
add a new alternative for slot_contents - sync_term.
compiler/handle_options.m:
add .par as part of the grade
compiler/hlds_goal.m:
add the new goal type par_conj.
compiler/instmap.m:
add instmap__unify which takes a list of instmaps
and abstractly unifies them.
add unify_instmap_delta which tajes two instmap deltas
and abstractly unifies them.
compiler/llds.m:
add the new llds instructions.
compiler/mode_info.m:
add par_conj as a lock reason.
library/Makefile:
work around a bug in the solaris version pthread.h
library/benchmarking.m:
reference the stack zones from the engine structure
rather than from global variables.
library/{nc,sp}_builtin.nl:
add an op declaration for &.
library/std_util.m:
change references to global variables to references inside
the engine structure.
runtime/Mmakefile:
add mercury_thread.{c,h}
add THREADLIBS to the libraries
runtime/*.{c,h}
Remove some old junk from the previous processes/shrd-mem
changes that found their way into the repository.
Add MR_ prefixes to lots of names.
runtime/mercury_context.c:
Add init_thread_stuff for creating and initializing a
context structure for the current thread.
runtime/mercury_context.h:
add a field to the mercury context which stores the thread id
of the thread where this context originated.
add various macros for implementing the new llds instructions.
runtime/mercury_engine.c:
initialize the engine structure, rather than a bunch of globals.
runtime/mercury_engine.h:
declare the mercury_engine structure.
runtime/mercury_regorder.h:
if MR_THREAD_SAFE, and there is at least one global register
then use mr0 as a pointer to the mercury engine structure.
scripts/init_grade_options.sh-subr
add thread_safe
scripts/mgnuc.in
add THREAD_OPTS
scripts/ml.in:
add THREAD_LIBS
This commit is contained in:
@@ -40,6 +40,11 @@
|
||||
---> mode_error_disj(merge_context, merge_errors)
|
||||
% different arms of a disjunction result in
|
||||
% different insts for some non-local variables
|
||||
; mode_error_par_conj(merge_errors)
|
||||
% different arms of a parallel conj result in
|
||||
% mutually exclusive bindings - ie the process
|
||||
% of unifying the instmaps from the end of each
|
||||
% branch failed.
|
||||
; mode_error_higher_order_pred_var(pred_or_func, var, inst, arity)
|
||||
% the predicate variable in a higher-order predicate
|
||||
% or function call didn't have a higher-order
|
||||
@@ -68,7 +73,8 @@
|
||||
% instantiated variable (for preds with >1 mode)
|
||||
; mode_error_bind_var(var_lock_reason, var, inst, inst)
|
||||
% attempt to bind a non-local variable inside
|
||||
% a negated context
|
||||
% a negated context, or attempt to re-bind a variable
|
||||
% in a parallel conjunct
|
||||
; mode_error_non_local_lambda_var(var, inst)
|
||||
% attempt to pass a live non-ground var as a
|
||||
% non-local variable to a lambda goal
|
||||
@@ -85,9 +91,10 @@
|
||||
% a conjunction contains one or more unscheduleable
|
||||
% goals; schedule_culprit gives the reason why
|
||||
% they couldn't be scheduled.
|
||||
; mode_error_final_inst(int, var, inst, inst, final_inst_error).
|
||||
; mode_error_final_inst(int, var, inst, inst, final_inst_error)
|
||||
% one of the head variables did not have the
|
||||
% expected final inst on exit from the proc
|
||||
.
|
||||
|
||||
:- type schedule_culprit
|
||||
---> goal_itself_was_impure
|
||||
@@ -174,6 +181,8 @@
|
||||
|
||||
report_mode_error(mode_error_disj(MergeContext, ErrorList), ModeInfo) -->
|
||||
report_mode_error_disj(ModeInfo, MergeContext, ErrorList).
|
||||
report_mode_error(mode_error_par_conj(ErrorList), ModeInfo) -->
|
||||
report_mode_error_par_conj(ModeInfo, ErrorList).
|
||||
report_mode_error(mode_error_higher_order_pred_var(PredOrFunc, Var, Inst,
|
||||
Arity), ModeInfo) -->
|
||||
report_mode_error_higher_order_pred_var(ModeInfo, PredOrFunc, Var,
|
||||
@@ -348,6 +357,23 @@ report_mode_error_disj(ModeInfo, MergeContext, ErrorList) -->
|
||||
io__write_string(".\n"),
|
||||
write_merge_error_list(ErrorList, ModeInfo).
|
||||
|
||||
:- pred report_mode_error_par_conj(mode_info, merge_errors,
|
||||
io__state, io__state).
|
||||
:- mode report_mode_error_par_conj(mode_info_no_io, in, di, uo) is det.
|
||||
|
||||
report_mode_error_par_conj(ModeInfo, ErrorList) -->
|
||||
{ mode_info_get_context(ModeInfo, Context) },
|
||||
mode_info_write_context(ModeInfo),
|
||||
prog_out__write_context(Context),
|
||||
io__write_string(" mode error: mutually exclusive bindings in parallel conjunction.\n"),
|
||||
mode_info_write_context(ModeInfo),
|
||||
prog_out__write_context(Context),
|
||||
io__write_string(" (The current implementation does not permit\n"),
|
||||
mode_info_write_context(ModeInfo),
|
||||
prog_out__write_context(Context),
|
||||
io__write_string(" parallel conjunctions to fail.)\n"),
|
||||
write_merge_error_list(ErrorList, ModeInfo).
|
||||
|
||||
:- pred write_merge_error_list(merge_errors, mode_info, io__state, io__state).
|
||||
:- mode write_merge_error_list(in, mode_info_no_io, di, uo) is det.
|
||||
|
||||
@@ -396,6 +422,10 @@ report_mode_error_bind_var(ModeInfo, Reason, Var, VarInst, Inst) -->
|
||||
io__write_string("attempt to bind a non-local variable inside\n"),
|
||||
prog_out__write_context(Context),
|
||||
io__write_strings([" a ", PredOrFuncS, " lambda goal.\n"])
|
||||
; { Reason = par_conj },
|
||||
io__write_string("attempt to bind a non-local variable\n"),
|
||||
prog_out__write_context(Context),
|
||||
io__write_string(" inside more than one parallel conjunct.\n")
|
||||
),
|
||||
prog_out__write_context(Context),
|
||||
io__write_string(" Variable `"),
|
||||
@@ -420,6 +450,9 @@ report_mode_error_bind_var(ModeInfo, Reason, Var, VarInst, Inst) -->
|
||||
; { Reason = lambda(_) },
|
||||
io__write_string("\tA lambda goal is only allowed to bind its arguments\n"),
|
||||
io__write_string("\tand variables local to the lambda expression.\n")
|
||||
; { Reason = par_conj },
|
||||
io__write_string("\tA nonlocal variable of a parallel conjunction may be\n"),
|
||||
io__write_string("\tbound in at most one conjunct.\n")
|
||||
)
|
||||
;
|
||||
[]
|
||||
@@ -800,7 +833,6 @@ report_mode_error_final_inst(ModeInfo, ArgNum, Var, VarInst, Inst, Reason) -->
|
||||
io__write_string("'.\n").
|
||||
|
||||
|
||||
%-----------------------------------------------------------------------------%
|
||||
%-----------------------------------------------------------------------------%
|
||||
|
||||
mode_context_init(uninitialized).
|
||||
|
||||
Reference in New Issue
Block a user