Bugfix for the _great_ x86_64 isa. Since %r12 is handled like %rsp, moves
authortwisti <none@none>
Sat, 30 Apr 2005 20:12:59 +0000 (20:12 +0000)
committertwisti <none@none>
Sat, 30 Apr 2005 20:12:59 +0000 (20:12 +0000)
with %r12 as base register are 1-byte longer. Arghh, i hate cisc...

src/vm/jit/x86_64/patcher.c

index 689640f48a1eda9ecf2db4b08d6dab0584d1899c..b5356be9860c52b74f5acd38a544e3e39ef68345 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: patcher.c 2424 2005-04-30 13:45:06Z jowenn $
+   $Id: patcher.c 2426 2005-04-30 20:12:59Z twisti $
 
 */
 
@@ -329,6 +329,11 @@ bool patcher_putfieldconst(u1 *sp)
        if (showdisassemble)
                ra = ra + 5;
 
+       /* handle special case when the base register is %r12 */
+
+       if (*(ra + 2) == 0x84)
+               ra = ra + 1;
+
        /* patch the field's offset */
 
        if (IS_2_WORD_TYPE(fi->type) || IS_ADR_TYPE(fi->type)) {