Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: patcher.c 7694 2007-04-12 15:35:13Z tbfg $
+ $Id: patcher.c 7909 2007-05-15 10:32:16Z tbfg $
*/
*((s4 *)(ra + 5*4)) |= (disp & 0x0000ffff);
/* sync instruction cache */
- md_icacheflush(ra, 5*4);
+ md_icacheflush(ra, 6*4);
return true;
}
{
constant_classref *cr;
s4 disp;
- u1 *pv;
+ u1 *pv, *ra;
+ u4 mcode;
classinfo *c;
/* get stuff from the stack */
+ ra = (u1 *) *((ptrint *) (sp + 5 * 8));
+ mcode = *((u4 *) (sp + 3 * 8));
cr = (constant_classref *) *((ptrint *) (sp + 2 * 8));
disp = *((s4 *) (sp + 1 * 8));
pv = (u1 *) *((ptrint *) (sp + 0 * 8));
if (!(c = resolve_classref_eager(cr)))
return false;
+ /* patch back original code */
+
+ *((u4 *) ra) = mcode;
+
+ /* synchronize instruction cache */
+
+ md_icacheflush(ra, 4);
+
/* patch the classinfo pointer */
*((ptrint *) (pv + disp)) = (ptrint) c;
{
constant_classref *cr;
s4 disp;
- u1 *pv;
+ u1 *pv, *ra;
+ u4 mcode;
classinfo *c;
/* get stuff from the stack */
+ ra = (u1 *) *((ptrint *) (sp + 5 * 8));
+ mcode = *((u4 *) (sp + 3 * 8));
cr = (constant_classref *) *((ptrint *) (sp + 2 * 8));
disp = *((s4 *) (sp + 1 * 8));
pv = (u1 *) *((ptrint *) (sp + 0 * 8));
if (!(c = resolve_classref_eager(cr)))
return false;
+ /* patch back original code */
+
+ *((u4 *) ra) = mcode;
+
+ /* synchronize instruction cache */
+
+ md_icacheflush(ra, 4);
+
/* patch super class' vftbl */
*((ptrint *) (pv + disp)) = (ptrint) c->vftbl;
{
constant_classref *cr;
s4 disp;
- u1 *pv;
+ u1 *pv, *ra;
+ u4 mcode;
classinfo *c;
/* get stuff from the stack */
+ ra = (u1 *) *((ptrint *) (sp + 5 * 8));
+ mcode = *((u4 *) (sp + 3 * 8));
cr = (constant_classref *) *((ptrint *) (sp + 2 * 8));
disp = *((s4 *) (sp + 1 * 8));
pv = (u1 *) *((ptrint *) (sp + 0 * 8));
if (!(c = resolve_classref_eager(cr)))
return false;
+ /* patch back original code */
+
+ *((u4 *) ra) = mcode;
+
+ /* synchronize instruction cache */
+
+ md_icacheflush(ra, 4);
+
/* patch class flags */
*((s4 *) (pv + disp)) = (s4) c->flags;