From: edwin Date: Thu, 16 Mar 2006 18:32:11 +0000 (+0000) Subject: * src/vm/jit/code.c (code_get_sync_slot_count): No synchronization slots X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=c5ec70d9837f1365757319da0c308a5e89ac597f;p=cacao.git * src/vm/jit/code.c (code_get_sync_slot_count): No synchronization slots if USE_THREADS is undefined. (code_get_stack_frame_size): Added x86_64 alignment slot. --- diff --git a/src/vm/jit/code.c b/src/vm/jit/code.c index 73403110a..a07dc5372 100644 --- a/src/vm/jit/code.c +++ b/src/vm/jit/code.c @@ -89,6 +89,7 @@ int code_get_sync_slot_count(codeinfo *code) { assert(code); +#ifdef USE_THREADS if (!checksync) return 0; @@ -101,12 +102,22 @@ int code_get_sync_slot_count(codeinfo *code) #else return 1; #endif +#else /* !USE_THREADS */ + return 0; +#endif /* USE_THREADS */ } /* code_get_stack_frame_size *************************************************** Return the number of stack slots that the stack frame of the given code comprises. + + IMPORTANT: The return value does *not* include the saved return address + slot, although it is part of non-leaf stack frames on RISC + architectures. The rationale behind this is that the saved + return address is never moved or changed by replacement, and + this way CISC and RISC architectures can be treated the same. + (See also doc/stack_frames.txt.) IN: code.............the codeinfo of the code in question @@ -132,6 +143,12 @@ int code_get_stack_frame_size(codeinfo *code) count += code_get_sync_slot_count(code); +#if defined(__X86_64__) + /* keep stack 16-byte aligned */ + if (!code->isleafmethod || opt_verbosecall) + count |= 1; +#endif + return count; }