From d35c2c1481cf1ffdfed1b402fcb8f08438dcc537 Mon Sep 17 00:00:00 2001 From: "reed%reedloden.com" Date: Fri, 14 Mar 2008 16:24:25 +0000 Subject: [PATCH] Bug 422337 - "Bad assembly on m68k" [p=mh+mozilla@glandium.org (Mike Hommey) r=bsmedberg a1.9=damons] git-svn-id: svn://10.0.0.236/trunk@247836 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/md/unix/xptcinvoke_linux_m68k.cpp | 36 +++++++++---------- .../src/md/unix/xptcstubs_linux_m68k.cpp | 12 +------ 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp b/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp index 363e45e09ac..67a644a438a 100644 --- a/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp +++ b/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp @@ -137,32 +137,28 @@ XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, n = invoke_count_words(paramCount, params) * 4; __asm__ __volatile__( - "subl %5, %/sp\n\t" /* make room for params */ - "movl %/sp, %/a0\n\t" - "movl %4, %/sp@-\n\t" - "movl %3, %/sp@-\n\t" - "movl %/a0, %/sp@-\n\t" + "subl %5, %%sp\n\t" /* make room for params */ + "movel %4, %%sp@-\n\t" + "movel %3, %%sp@-\n\t" + "pea %%sp@(8)\n\t" "jbsr invoke_copy_to_stack\n\t" /* copy params */ - "addl #12, %/sp\n\t" - "movl %1, %/a0\n\t" - "movl %/a0, %/sp@-\n\t" - "movl %/a0@, %/a0\n\t" - "movl %2, %/d0\n\t" /* function index */ + "addw #12, %%sp\n\t" + "movel %1, %%sp@-\n\t" + "movel %1@, %%a0\n\t" #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ - "movl %/a0@(%/d0:l:4), %/a0\n\t" + "movel %%a0@(%2:l:4), %%a0\n\t" #else /* not V3 */ - "movl %/a0@(8,%/d0:l:4), %/a0\n\t" + "movel %%a0@(8,%2:l:4), %%a0\n\t" #endif - "jbsr %/a0@\n\t" /* safe to not cleanup sp */ - "movl %/d0, %0\n\t" - "addql #4, %/sp\n\t" - "addl %5, %/sp" - : "=g" (result) /* %0 */ - : "g" (that), /* %1 */ - "g" (methodIndex), /* %2 */ + "jbsr %%a0@\n\t" /* safe to not cleanup sp */ + "lea %%sp@(4,%5:l), %%sp\n\t" + "movel %%d0, %0" + : "=d" (result) /* %0 */ + : "a" (that), /* %1 */ + "d" (methodIndex), /* %2 */ "g" (paramCount), /* %3 */ "g" (params), /* %4 */ - "g" (n) /* %5 */ + "d" (n) /* %5 */ : "a0", "a1", "d0", "d1", "memory" ); diff --git a/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp b/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp index 76045601be0..46471d1371e 100644 --- a/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp +++ b/mozilla/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp @@ -121,18 +121,8 @@ extern "C" { #define STUB_ENTRY(n) \ nsresult nsXPTCStubBase::Stub##n() \ { \ - register nsresult result asm("d0"); \ void *frame = __builtin_frame_address(0); \ - __asm__ __volatile__( \ - "pea %2@(12)\n\t" /* args */ \ - "pea "#n"\n\t" /* method index */ \ - "movl %1, %/sp@-\n\t" /* this */ \ - "jbsr PrepareAndDispatch\n\t" \ - "addw #12, %/sp" \ - : "=&d" (result) /* %0 */ \ - : "a" (this), "a" (frame) \ - : "memory" ); \ - return result; \ + return PrepareAndDispatch(this, n, (uint32*)frame + 3); \ } #define SENTINEL_ENTRY(n) \