* merged with tip (040f180a056b)
[cacao.git] / src / vm / jit / codegen-common.c
index 2cbe198fc9373c7ac79d1b3e45441e695ef74194..7adb13985a9b8b6b08438bcfc5db8e24a011265e 100644 (file)
@@ -45,6 +45,8 @@
 #include <assert.h>
 #include <string.h>
 
+#include "vm/jit/jitcache.h"
+
 #include "vm/types.h"
 
 #include "codegen.h"
@@ -658,9 +660,13 @@ void codegen_finish(jitdata *jd)
        /* jump table resolving */
 
        for (jr = cd->jumpreferences; jr != NULL; jr = jr->next)
+       {
                *((functionptr *) ((ptrint) epoint + jr->tablepos)) =
                        (functionptr) ((ptrint) epoint + (ptrint) jr->target->mpc);
 
+               JITCACHE_ADD_CACHED_REF(code, CRT_JUMPREFERENCE, jr->target->mpc, jr->tablepos);
+       }
+
        /* patcher resolving */
 
        patcher_resolve(jd);