Bug 422337 - "Bad assembly on m68k" [p=mh+mozilla@glandium.org (Mike Hommey) r=bsmedberg a1.9=damons]

This commit is contained in:
reed@reedloden.com 2008-03-14 09:24:25 -07:00
parent 63cef0cdff
commit 785b599a30
2 changed files with 17 additions and 31 deletions

View File

@ -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"
);

View File

@ -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) \