compact source mode.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@934 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2003-11-21 16:56:20 +00:00
parent 8d3f30de9c
commit f5edbc8aa7
16 changed files with 254 additions and 88 deletions

View File

@@ -2079,6 +2079,7 @@ do_pass(void)
} else {
/* static clause */
if (pass_no) {
cl_u->sc.Id = FunctorDBRef;
cl_u->sc.ClFlags = 0;
cl_u->sc.Owner = Yap_ConsultingFile();
if (clause_has_blobs) {
@@ -2441,7 +2442,7 @@ do_pass(void)
longjmp(Yap_CompilerBotch, 3);
}
if ( (char *)(label_offset+cpc->rnd1) > freep)
if ( (char *)(label_offset+cpc->rnd1) >= freep)
freep = (char *)(label_offset+(cpc->rnd1+1));
label_offset[cpc->rnd1] = (CELL) code_p;
}
@@ -2650,15 +2651,44 @@ Yap_assemble(int mode, Term t, PredEntry *ap, int is_fact)
!is_fact) {
DBTerm *x;
LogUpdClause *cl;
CELL *h0 = H;
H = (CELL *)freep;
while ((x = Yap_StoreTermInDBPlusExtraSpace(t, size)) == NULL) {
H = h0;
if (!Yap_growheap(TRUE, size)) {
Yap_Error_TYPE = SYSTEM_ERROR;
return NULL;
}
h0 = H;
H = (CELL *)freep;
}
H = h0;
cl = (LogUpdClause *)((CODEADDR)x-(UInt)size);
cl->ClSource = x;
code_addr = (yamop *)cl;
} else if (mode == ASSEMBLING_CLAUSE &&
(ap->PredFlags & SourcePredFlag ||
(!ap->cs.p_code.NOfClauses && yap_flags[SOURCE_MODE_FLAG])) &&
!is_fact) {
DBTerm *x;
StaticClause *cl;
CELL *h0 = H;
H = (CELL *)freep;
while ((x = Yap_StoreTermInDBPlusExtraSpace(t, size)) == NULL) {
H = h0;
if (!Yap_growheap(TRUE, size)) {
Yap_Error_TYPE = SYSTEM_ERROR;
return NULL;
}
h0 = H;
H = (CELL *)freep;
}
H = h0;
cl = (StaticClause *)((CODEADDR)x-(UInt)size);
cl->ClSource = x;
code_addr = (yamop *)cl;
} else {
while ((code_addr = (yamop *) Yap_AllocCodeSpace(size)) == NULL) {
if (!Yap_growheap(TRUE, size)) {
@@ -2667,7 +2697,6 @@ Yap_assemble(int mode, Term t, PredEntry *ap, int is_fact)
}
}
}
// fprintf(stderr,"vsc: asking for %p\n",code_addr);
entry_code = do_pass();
YAPLeaveCriticalSection();
#ifdef LOW_PROF