/* forward typedefs ***********************************************************/
+typedef struct cachedref_t cachedref_t;
+typedef struct patchref_t patchref_t;
+
#include "config.h"
#include "vm/types.h"
-#include "toolbox/list.h"
+#include "toolbox/list.hpp"
#include "vm/global.h"
#include "vm/jit/jit.hpp"
+#if defined (ENABLE_JITCACHE)
+struct cached_ref_t;
+#endif
/* patchref_t ******************************************************************
*******************************************************************************/
-typedef struct patchref_t {
+struct patchref_t {
ptrint mpc; /* absolute position in code segment */
ptrint datap; /* absolute position in data segment */
s4 disp; /* displacement of ref in the data segment */
void* ref; /* reference passed */
uint32_t mcode; /* machine code to be patched back in */
bool done; /* XXX preliminary: patch already applied? */
- listnode_t linkage;
-} patchref_t;
+#if defined (ENABLE_JITCACHE)
+ cachedref_t *attached_ref;
+ /* cached reference which must be resolved *
+ * patcher has been run. */
+#endif
+};
/* macros *********************************************************************/
#endif /* defined(__I386__) */
+#if defined (__ARM__)
+void patch_md(s4 md_patch, ptrint dest, void* ref);
+#endif /* defined(__ARM__) */
+
#ifdef __cplusplus
} // extern "C"
#endif