Re: [Sablevm-developer] powerpc port status
Brought to you by:
egagnon
From: Etienne M. G. <eti...@uq...> - 2002-12-13 22:19:03
|
On Fri, Dec 13, 2002 at 02:46:53PM -0500, David Paul BELANGER wrote: > > Hello, > > There something I don't quite get > > native.c around line 1240: > > Original code (does not work on PPC): > case SVM_TYPE_BOOLEAN: > params[0].jint = *((jboolean *) &result[0]); > > > Could it be simply replaced by (works on PPC): > params[0].jint = result[0].jint; > instead? > > or is the address taken, cast, deference for some reason? I guess it > depends on how the data is stored in _svmt_stack_value_union by ffi_call > and how the union is layed out in memory? libffi is supposed to be returning a boolean (i.e. "char") value at the location &result [at least, this is what I understood from the documentation]. So, *((jboolean *) &result[0]) seems to be "the right way" to extract the returned boolean value. Nowhere, in the libffi doc, have I see any special note about handling sub-32bits values specially (because of alignment constraints), so I suspect libffi is buggy. Etienne -- Etienne M. Gagnon http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |