*** empty log message ***
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1683 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
089e864621
commit
f69ba78f02
@ -2379,6 +2379,9 @@ p_still_variant(void)
|
|||||||
link_entry *lp = (link_entry *)(dbt->Contents+dbt->NOfCells);
|
link_entry *lp = (link_entry *)(dbt->Contents+dbt->NOfCells);
|
||||||
link_entry link;
|
link_entry link;
|
||||||
|
|
||||||
|
if (!dbt->NOfCells) {
|
||||||
|
return IsVarTerm(t2);
|
||||||
|
}
|
||||||
while ((link = *lp++)) {
|
while ((link = *lp++)) {
|
||||||
Term t2 = Deref(old_h[link-1]);
|
Term t2 = Deref(old_h[link-1]);
|
||||||
if (IsUnboundVar(dbt->Contents+(link-1))) {
|
if (IsUnboundVar(dbt->Contents+(link-1))) {
|
||||||
|
47
C/heapgc.c
47
C/heapgc.c
@ -1098,12 +1098,12 @@ mark_variable(CELL_PTR current)
|
|||||||
CELL_PTR next;
|
CELL_PTR next;
|
||||||
register CELL ccur;
|
register CELL ccur;
|
||||||
unsigned int arity;
|
unsigned int arity;
|
||||||
|
char *local_bp = Yap_bp;
|
||||||
|
|
||||||
begin:
|
begin:
|
||||||
if (MARKED_PTR(current)) {
|
if (UNMARKED_MARK(current,local_bp)) {
|
||||||
POP_CONTINUATION();
|
POP_CONTINUATION();
|
||||||
}
|
}
|
||||||
MARK(current);
|
|
||||||
if (current >= H0 && current < H) {
|
if (current >= H0 && current < H) {
|
||||||
total_marked++;
|
total_marked++;
|
||||||
if (current < HGEN) {
|
if (current < HGEN) {
|
||||||
@ -1203,14 +1203,35 @@ mark_variable(CELL_PTR current)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
POP_CONTINUATION();
|
POP_CONTINUATION();
|
||||||
|
} else if (IsAtomOrIntTerm(ccur)) {
|
||||||
|
#ifdef INSTRUMENT_GC
|
||||||
|
if (IsAtomTerm(ccur))
|
||||||
|
inc_vars_of_type(current,gc_atom);
|
||||||
|
else
|
||||||
|
inc_vars_of_type(current, gc_int);
|
||||||
|
#endif
|
||||||
|
POP_CONTINUATION();
|
||||||
} else if (IsPairTerm(ccur)) {
|
} else if (IsPairTerm(ccur)) {
|
||||||
#ifdef INSTRUMENT_GC
|
#ifdef INSTRUMENT_GC
|
||||||
inc_vars_of_type(current,gc_list);
|
inc_vars_of_type(current,gc_list);
|
||||||
#endif
|
#endif
|
||||||
if (ONHEAP(next)) {
|
if (ONHEAP(next)) {
|
||||||
PUSH_CONTINUATION(next+1,1);
|
/* speedup for strings */
|
||||||
current = next;
|
if (IsAtomOrIntTerm(*next)) {
|
||||||
goto begin;
|
if (!UNMARKED_MARK(next,local_bp)) {
|
||||||
|
total_marked++;
|
||||||
|
if (next < HGEN) {
|
||||||
|
total_oldies++;
|
||||||
|
}
|
||||||
|
PUSH_POINTER(next);
|
||||||
|
}
|
||||||
|
current = next+1;
|
||||||
|
goto begin;
|
||||||
|
} else {
|
||||||
|
PUSH_CONTINUATION(next+1,1);
|
||||||
|
current = next;
|
||||||
|
goto begin;
|
||||||
|
}
|
||||||
} else if (ONCODE(next)) {
|
} else if (ONCODE(next)) {
|
||||||
mark_db_fixed(RepPair(ccur));
|
mark_db_fixed(RepPair(ccur));
|
||||||
}
|
}
|
||||||
@ -1323,13 +1344,6 @@ mark_variable(CELL_PTR current)
|
|||||||
PUSH_CONTINUATION(current+1,arity-1);
|
PUSH_CONTINUATION(current+1,arity-1);
|
||||||
goto begin;
|
goto begin;
|
||||||
}
|
}
|
||||||
#ifdef INSTRUMENT_GC
|
|
||||||
else if (IsAtomTerm(ccur))
|
|
||||||
inc_vars_of_type(current,gc_atom);
|
|
||||||
else
|
|
||||||
inc_vars_of_type(current, gc_int);
|
|
||||||
#endif
|
|
||||||
POP_CONTINUATION();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -3451,18 +3465,17 @@ static void
|
|||||||
sweep_oldgen(CELL *max, CELL *base)
|
sweep_oldgen(CELL *max, CELL *base)
|
||||||
{
|
{
|
||||||
CELL *ptr = base;
|
CELL *ptr = base;
|
||||||
long int nof = 0;
|
char *bpb = Yap_bp+(base-(CELL*)Yap_GlobalBase);
|
||||||
|
|
||||||
while (ptr < max) {
|
while (ptr < max) {
|
||||||
if (MARKED_PTR(ptr)) {
|
if (*bpb & MARK_BIT) {
|
||||||
nof++;
|
|
||||||
UNMARK(ptr);
|
|
||||||
if (HEAP_PTR(*ptr)) {
|
if (HEAP_PTR(*ptr)) {
|
||||||
into_relocation_chain(ptr, GET_NEXT(*ptr));
|
into_relocation_chain(ptr, GET_NEXT(*ptr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ptr++;
|
ptr++;
|
||||||
|
bpb++;
|
||||||
}
|
}
|
||||||
/* fprintf(stderr,"found %d, %p-%p\n", nof, base, max); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef COROUTINING
|
#ifdef COROUTINING
|
||||||
|
@ -120,7 +120,6 @@ p_stream_to_codes(void)
|
|||||||
RESET_VARIABLE(h0);
|
RESET_VARIABLE(h0);
|
||||||
ARG4 = AbsPair(HBASE);
|
ARG4 = AbsPair(HBASE);
|
||||||
ARG5 = (CELL)h0;
|
ARG5 = (CELL)h0;
|
||||||
fprintf(stderr,"+ %p-%p=%p\n",HBASE,H,H-HBASE);
|
|
||||||
if (!Yap_gc(5, ENV, P)) {
|
if (!Yap_gc(5, ENV, P)) {
|
||||||
Yap_Error(OUT_OF_STACK_ERROR, ARG1, "read_stream_to_codes/3");
|
Yap_Error(OUT_OF_STACK_ERROR, ARG1, "read_stream_to_codes/3");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -128,7 +127,6 @@ p_stream_to_codes(void)
|
|||||||
/* build a legal term again */
|
/* build a legal term again */
|
||||||
h0 = (CELL *)ARG5;
|
h0 = (CELL *)ARG5;
|
||||||
HBASE = RepPair(ARG4);
|
HBASE = RepPair(ARG4);
|
||||||
fprintf(stderr,"- %p-%p=%d\n",HBASE,h0,h0-HBASE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (H == HBASE)
|
if (H == HBASE)
|
||||||
|
11
C/tracer.c
11
C/tracer.c
@ -355,6 +355,16 @@ static Int p_stop_low_level_trace(void)
|
|||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
volatile int vsc_wait;
|
||||||
|
|
||||||
|
static Int p_vsc_wait(void)
|
||||||
|
{
|
||||||
|
fprintf(stderr,"attach %d\n",getpid());
|
||||||
|
while (!vsc_wait);
|
||||||
|
vsc_wait=1;
|
||||||
|
return(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Yap_InitLowLevelTrace(void)
|
Yap_InitLowLevelTrace(void)
|
||||||
{
|
{
|
||||||
@ -363,6 +373,7 @@ Yap_InitLowLevelTrace(void)
|
|||||||
Yap_InitCPred("start_low_level_trace", 1, p_start_low_level_trace2, SafePredFlag);
|
Yap_InitCPred("start_low_level_trace", 1, p_start_low_level_trace2, SafePredFlag);
|
||||||
#endif
|
#endif
|
||||||
Yap_InitCPred("stop_low_level_trace", 0, p_stop_low_level_trace, SafePredFlag);
|
Yap_InitCPred("stop_low_level_trace", 0, p_stop_low_level_trace, SafePredFlag);
|
||||||
|
Yap_InitCPred("vsc_wait", 0, p_vsc_wait, SafePredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
17
H/heapgc.h
17
H/heapgc.h
@ -96,7 +96,7 @@ extern char *Yap_bp;
|
|||||||
#define MARK_BIT 1
|
#define MARK_BIT 1
|
||||||
#define RMARK_BIT 2
|
#define RMARK_BIT 2
|
||||||
|
|
||||||
#define mcell(X) Yap_bp[X-(CELL *)Yap_GlobalBase]
|
#define mcell(X) Yap_bp[(X)-(CELL *)Yap_GlobalBase]
|
||||||
|
|
||||||
static inline Int
|
static inline Int
|
||||||
MARKED_PTR(CELL* ptr)
|
MARKED_PTR(CELL* ptr)
|
||||||
@ -104,6 +104,18 @@ MARKED_PTR(CELL* ptr)
|
|||||||
return mcell(ptr) & MARK_BIT;
|
return mcell(ptr) & MARK_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline Int
|
||||||
|
UNMARKED_MARK(CELL* ptr, char *bp)
|
||||||
|
{
|
||||||
|
Int pos = ptr - (CELL *)Yap_GlobalBase;
|
||||||
|
char t = bp[pos];
|
||||||
|
if (t & MARK_BIT) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
bp[pos] = t | MARK_BIT;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
MARK(CELL* ptr)
|
MARK(CELL* ptr)
|
||||||
{
|
{
|
||||||
@ -116,6 +128,9 @@ UNMARK(CELL* ptr)
|
|||||||
mcell(ptr) = mcell(ptr) & ~MARK_BIT;
|
mcell(ptr) = mcell(ptr) & ~MARK_BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* not really that useful */
|
||||||
|
#define MAY_UNMARK(X)
|
||||||
|
|
||||||
#define UNMARK_CELL(X) (X)
|
#define UNMARK_CELL(X) (X)
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -16,8 +16,10 @@
|
|||||||
|
|
||||||
<h2>Yap-5.1.2:</h2>
|
<h2>Yap-5.1.2:</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li> NEW: a first cut at readutil.yap (request from Stefan Weinbrenner)</li>
|
<li> FIXED: recordaifnot(a,_,_) was broken (obs from Jesse Davis).</li>
|
||||||
<li> FIXED: compile | as a disjunction (obs from Ole Edsberg)</li>
|
<li> SPEEDUP: some speedups to garbage collector (obs from Nicos Angelopoulos).</li>
|
||||||
|
<li> NEW: a first cut at readutil.yap (request from Stefan Weinbrenner).</li>
|
||||||
|
<li> FIXED: compile | as a disjunction (obs from Ole Edsberg).</li>
|
||||||
<li> NEW: rbqueues keeps a simple db queue</li>
|
<li> NEW: rbqueues keeps a simple db queue</li>
|
||||||
<li> NEW: cut_up_to_next_disjunction/0 tries to prune until the closest
|
<li> NEW: cut_up_to_next_disjunction/0 tries to prune until the closest
|
||||||
choice-point from the parent disjunction (think query packs).</li>
|
choice-point from the parent disjunction (think query packs).</li>
|
||||||
|
Reference in New Issue
Block a user