droid
This commit is contained in:
parent
f0343fc62c
commit
8ab005480f
5
C/exec.c
5
C/exec.c
@ -1576,14 +1576,15 @@ void Yap_PrepGoal(arity_t arity, CELL *pt, choiceptr saved_b USES_REGS) {
|
||||
static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, bool top USES_REGS) {
|
||||
choiceptr saved_b = B;
|
||||
bool out;
|
||||
|
||||
Yap_PrepGoal(arity, pt, saved_b PASS_REGS);
|
||||
CACHE_A1();
|
||||
CACHE_S();
|
||||
CACHE_A1();
|
||||
P = (yamop *)CodeAdr;
|
||||
// S = CellPtr(RepPredProp(
|
||||
// PredPropByFunc(Yap_MkFunctor(AtomCall, 1), 0))); /* A1 mishaps */
|
||||
|
||||
out = exec_absmi(top, YAP_EXEC_ABSMI PASS_REGS);
|
||||
ENDCACHE_S();
|
||||
// if (out) {
|
||||
// out = Yap_GetFromSlot(sl);
|
||||
// }
|
||||
|
@ -6,6 +6,8 @@
|
||||
#ifndef _YAPDB_H
|
||||
#define _YAPDB_H
|
||||
|
||||
#include <YapInterface.h>
|
||||
|
||||
#define YAP_CPP_DB_INTERFACE 1
|
||||
|
||||
|
||||
@ -70,7 +72,7 @@ class X_API YAPModuleProp : public YAPProp {
|
||||
|
||||
public:
|
||||
YAPModuleProp(YAPModule tmod) { m = Yap_GetModuleEntry(tmod.gt()); };
|
||||
YAPModuleProp() { CACHE_REGS m = Yap_GetModuleEntry(Yap_CurrentModule()); };
|
||||
YAPModuleProp() { m = Yap_GetModuleEntry(YAP_CurrentModule()); };
|
||||
virtual YAPModule module() { return YAPModule(m->AtomOfME); };
|
||||
};
|
||||
|
||||
|
4
H/Regs.h
4
H/Regs.h
@ -24,7 +24,7 @@
|
||||
#define MaxTemps 512
|
||||
#define MaxArithms 32
|
||||
|
||||
#ifdef i386
|
||||
#if defined(i386) && CELLSIZE == 4
|
||||
#define PUSH_REGS 1
|
||||
#undef PUSH_X
|
||||
#endif
|
||||
@ -34,7 +34,7 @@
|
||||
#undef PUSH_X
|
||||
#endif
|
||||
|
||||
#ifdef __x86_64__
|
||||
#if defined(__x86_64__) && CELLSIZE == 8
|
||||
#define PUSH_REGS 1
|
||||
#undef PUSH_X
|
||||
#endif
|
||||
|
46
H/absmi.h
46
H/absmi.h
@ -58,7 +58,7 @@
|
||||
#define USE_PREFETCH 1
|
||||
#endif
|
||||
|
||||
#ifdef i386
|
||||
#if defined(i386) && CELLSIZE == 4
|
||||
#define Y_IN_MEM 1
|
||||
#define S_IN_MEM 1
|
||||
#define TR_IN_MEM 1
|
||||
@ -86,7 +86,7 @@ register struct yami *P1REG asm("bp"); /* can't use yamop before Yap.h */
|
||||
#define TR_IN_MEM 1
|
||||
#endif /* sparc_ */
|
||||
|
||||
#ifdef __x86_64__
|
||||
#if defined(__x86_64__) && CELLSIZE == 8
|
||||
#define SHADOW_P 1
|
||||
#ifdef BP_FREE
|
||||
#undef BP_FREE
|
||||
@ -100,7 +100,7 @@ register struct yami *P1REG asm("bp"); /* can't use yamop before Yap.h */
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
#if defined(__arm__) || defined(__thumb__) || defined(mips) || \
|
||||
defined(__mips64) || defined(__aarch64__)
|
||||
defined(__mips64) || defined(__arch64__)
|
||||
|
||||
#define Y_IN_MEM 1
|
||||
#define S_IN_MEM 1
|
||||
@ -119,7 +119,7 @@ register struct yami *P1REG asm("bp"); /* can't use yamop before Yap.h */
|
||||
#define SHADOW_S 1
|
||||
#endif
|
||||
|
||||
#ifdef i386
|
||||
#if defined(i386) && CELLSIZE == 4
|
||||
#define Y_IN_MEM 1
|
||||
#define S_IN_MEM 1
|
||||
#define TR_IN_MEM 1
|
||||
@ -305,30 +305,6 @@ INLINE_ONLY inline EXTERN void restore_absmi_regs(REGSTORE *old_regs) {
|
||||
|
||||
#endif
|
||||
|
||||
#if S_IN_MEM
|
||||
|
||||
#define CACHE_A1()
|
||||
|
||||
#define CACHED_A1() ARG1
|
||||
|
||||
#else
|
||||
|
||||
#ifndef _NATIVE
|
||||
|
||||
#define CACHE_A1() (SREG = (CELL *)ARG1)
|
||||
|
||||
#define CACHED_A1() ((CELL)SREG)
|
||||
|
||||
#else
|
||||
|
||||
#define CACHE_A1() ((*_SREG) = (CELL *)ARG1)
|
||||
|
||||
#define CACHED_A1() ((CELL)(*_SREG))
|
||||
|
||||
#endif /* _NATIVE */
|
||||
|
||||
#endif /* S_IN_MEM */
|
||||
|
||||
/***************************************************************
|
||||
* TR is usually, but not always, a register. This affects *
|
||||
* backtracking *
|
||||
@ -374,11 +350,19 @@ INLINE_ONLY inline EXTERN void restore_absmi_regs(REGSTORE *old_regs) {
|
||||
|
||||
#define READ_IN_S() S_SREG = SREG
|
||||
|
||||
#define CACHE_A1() (SREG = (CELL *)ARG1)
|
||||
|
||||
#define CACHED_A1() ((CELL)SREG)
|
||||
|
||||
#else
|
||||
|
||||
#define READ_IN_S() S_SREG = *_SREG
|
||||
|
||||
#endif
|
||||
#define CACHE_A1() ((*_SREG) = (CELL *)ARG1)
|
||||
|
||||
#define CACHED_A1() ((CELL)(*_SREG))
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
@ -390,6 +374,10 @@ INLINE_ONLY inline EXTERN void restore_absmi_regs(REGSTORE *old_regs) {
|
||||
|
||||
#define READ_IN_S()
|
||||
|
||||
#define CACHE_A1()
|
||||
|
||||
#define CACHED_A1() (ARG1)
|
||||
|
||||
#define S_SREG SREG
|
||||
|
||||
#endif
|
||||
|
@ -78,6 +78,9 @@ open_asset(VFS_t *me, const char *fname, const char *io_mode, int sno) {
|
||||
// strcpy(dir, fname);
|
||||
// char *d = basename(dir);
|
||||
am = AAssetManager_open(Yap_assetManager(), fname, mode);
|
||||
if (am==NULL)
|
||||
__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "failed open %s <%s>", fname, strerror(errno) );
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, "YAPDroid", "open %s <%s>", fname, io_mode );
|
||||
// while (dp) {
|
||||
// char *f = AAssetDir_getNextFileName(dp);
|
||||
|
Reference in New Issue
Block a user