Changes:
- $Id: patcher.c 2449 2005-05-11 13:34:47Z twisti $
+ $Id: patcher.c 2527 2005-05-25 08:07:57Z twisti $
*/
#include "vm/references.h"
#include "vm/jit/asmpart.h"
#include "vm/jit/helper.h"
+#include "vm/jit/patcher.h"
/* patcher_get_putstatic *******************************************************
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the fieldinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the fieldinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - (4 + 4);
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the classinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - (4 + 4);
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the classinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the classinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - (2 * 4);
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the classinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - (4 + 4);
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the classinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the fieldinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the fieldinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the fieldinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the fieldinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the fieldinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* get the fieldinfo */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}
ra = ra - 4;
*((ptrint *) (sp + 3 * 8)) = (ptrint) ra;
-#if defined(USE_THREADS)
- /* enter a monitor on the patching position */
-
- builtin_monitorenter(o);
-
- /* check if the position has already been patched */
-
- if (o->vftbl) {
- builtin_monitorexit(o);
-
- return true;
- }
-#endif
+ PATCHER_MONITORENTER;
/* check if the class is initialized */
asm_sync_instruction_cache();
-#if defined(USE_THREADS)
- /* this position has been patched */
-
- o->vftbl = (vftbl_t *) 1;
-
- /* leave the monitor on the patching position */
-
- builtin_monitorexit(o);
-#endif
+ PATCHER_MONITOREXIT;
return true;
}