Skip to content

Commit

Permalink
Merge /Users/vsc/tmp/yap-6.3w
Browse files Browse the repository at this point in the history
  • Loading branch information
vscosta committed Feb 28, 2016
2 parents 7cc9d2f + 2192f73 commit 0ccee1a
Show file tree
Hide file tree
Showing 84 changed files with 2,722 additions and 2,742 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ GitSHA1.c
CMakeLists.txt.*
FindPackageLog.txt
GitSHA1.c
out

GitSHA1.c

os/YapIOConfig.h
Expand Down Expand Up @@ -148,6 +148,5 @@ cmake/cmake-android
yap-6.3.workspace

YAP.project
sublime

*.tmp
CBlocks
24 changes: 12 additions & 12 deletions C/absmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ push_live_regs(yamop *pco)
}
#endif

#if defined(ANALYST) || defined(DEBUG)
#if USE_THREADED_CODE && (defined(ANALYST) || defined(DEBUG))

char *Yap_op_names[] =
{
Expand Down Expand Up @@ -1066,27 +1066,27 @@ static void
execute_dealloc( USES_REGS1 )
{
/* other instructions do depend on S being set by deallocate
:-( */
CELL *ENV_YREG = YENV;
S = ENV_YREG;
CP = (yamop *) ENV_YREG[E_CP];
ENV = ENV_YREG = (CELL *) ENV_YREG[E_E];
*/
CELL *ENVYREG = YENV;
S = ENVYREG;
CP = (yamop *) ENVYREG[E_CP];
ENV = ENVYREG = (CELL *) ENVYREG[E_E];
#ifdef DEPTH_LIMIT
DEPTH = ENV_YREG[E_DEPTH];
DEPTH = ENVYREG[E_DEPTH];
#endif /* DEPTH_LIMIT */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
if (ENVYREG > (CELL *) top_b || ENVYREG < HR) ENVYREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
if (ENVYREG > (CELL *) top_b) ENVYREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
else ENV_YREG = (CELL *)((CELL) ENV_YREG + ENV_Size(CP));
else ENVYREG = (CELL *)((CELL) ENVYREG + ENV_Size(CP));
}
#else
if (ENV_YREG > (CELL *) B)
ENV_YREG = (CELL *) B;
if (ENVYREG > (CELL *) B)
ENVYREG = (CELL *) B;
else
ENV_YREG = (CELL *) ((CELL) ENV_YREG + ENV_Size(CP));
#endif /* FROZEN_STACKS */
Expand Down
64 changes: 32 additions & 32 deletions C/adtdefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,61 +562,61 @@ Yap_OpPropForModule(Atom a,
return info;
}

static OpEntry *
fetchOpWithModule( PropEntry *pp, Term tmod, op_type type )
{
OpEntry *
Yap_GetOpProp(Atom a,
op_type type
USES_REGS) { /* look property list of atom a for kind */
AtomEntry *ae = RepAtom(a);
PropEntry *pp;
OpEntry *oinfo = NULL;

READ_LOCK(ae->ARWLock);
pp = RepProp(ae->PropsOfAE);
while (!EndOfPAEntr(pp)) {
OpEntry *info = NULL;

if (pp->KindOfPE != OpProperty) {
pp = RepProp(pp->NextOfPE);
continue;
}
info = (OpEntry *)pp;
if (info->OpModule != tmod) {
if (info->OpModule != CurrentModule && info->OpModule != PROLOG_MODULE) {
pp = RepProp(pp->NextOfPE);
continue;
}
if (type == INFIX_OP) {
if (!info->Infix) {
return NULL;
pp = RepProp(pp->NextOfPE);
continue;
}
} else if (type == POSFIX_OP) {
if (!info->Posfix) {
return NULL;
pp = RepProp(pp->NextOfPE);
continue;
}
} else {
if (!info->Prefix) {
return NULL;
pp = RepProp(pp->NextOfPE);
continue;
}
}
return info;
/* if it is not the latest module */
if (info->OpModule == PROLOG_MODULE) {
/* cannot commit now */
oinfo = info;
pp = RepProp(pp->NextOfPE);
} else {
READ_LOCK(info->OpRWLock);
READ_UNLOCK(ae->ARWLock);
return info;
}
}
return NULL;
}

OpEntry *
Yap_GetOpProp(Atom a,
op_type type,
Term tmod
USES_REGS) { /* look property list of atom a for kind */
AtomEntry *ae = RepAtom(a);
PropEntry *pp;
OpEntry *info;

READ_LOCK(ae->ARWLock);
pp = RepProp(ae->PropsOfAE);
if (( (info = fetchOpWithModule( pp, tmod, type )) != NULL) ||
( (info = fetchOpWithModule( pp, USER_MODULE, type )) != NULL) ||
( (info = fetchOpWithModule( pp, PROLOG_MODULE, type )) != NULL)
) {
LOCK(info->OpRWLock);
return info;
if (oinfo) {
READ_LOCK(oinfo->OpRWLock);
READ_UNLOCK(ae->ARWLock);
return oinfo;
}
READ_UNLOCK(ae->ARWLock);

return NULL;
READ_UNLOCK(ae->ARWLock);
return NULL;
}

inline static Prop GetPredPropByAtomHavingLock(AtomEntry *ae, Term cur_mod)
Expand Down
Loading

0 comments on commit 0ccee1a

Please sign in to comment.