comparison src/share/vm/prims/methodHandles.hpp @ 1849:5beba6174298

6987555: JSR 292 unboxing to a boolean value fails on big-endian SPARC Reviewed-by: never, jrose
author twisti
date Wed, 13 Oct 2010 01:19:43 -0700
parents d257356e35f0
children f95d63e2154a
comparison
equal deleted inserted replaced
1847:a932f331ef90 1849:5beba6174298
224 static int stack_move_unit() { 224 static int stack_move_unit() {
225 return frame::interpreter_frame_expression_stack_direction() * Interpreter::stackElementWords; 225 return frame::interpreter_frame_expression_stack_direction() * Interpreter::stackElementWords;
226 } 226 }
227 227
228 enum { CONV_VMINFO_SIGN_FLAG = 0x80 }; 228 enum { CONV_VMINFO_SIGN_FLAG = 0x80 };
229 static int adapter_subword_vminfo(BasicType dest) { 229 // Shift values for prim-to-prim conversions.
230 if (dest == T_BOOLEAN) return (BitsPerInt - 1); 230 static int adapter_prim_to_prim_subword_vminfo(BasicType dest) {
231 if (dest == T_CHAR) return (BitsPerInt - 16); 231 if (dest == T_BOOLEAN) return (BitsPerInt - 1); // boolean is 1 bit
232 if (dest == T_BYTE) return (BitsPerInt - 8) | CONV_VMINFO_SIGN_FLAG; 232 if (dest == T_CHAR) return (BitsPerInt - BitsPerShort);
233 if (dest == T_SHORT) return (BitsPerInt - 16) | CONV_VMINFO_SIGN_FLAG; 233 if (dest == T_BYTE) return (BitsPerInt - BitsPerByte ) | CONV_VMINFO_SIGN_FLAG;
234 if (dest == T_SHORT) return (BitsPerInt - BitsPerShort) | CONV_VMINFO_SIGN_FLAG;
235 return 0; // case T_INT
236 }
237 // Shift values for unboxing a primitive.
238 static int adapter_unbox_subword_vminfo(BasicType dest) {
239 if (dest == T_BOOLEAN) return (BitsPerInt - BitsPerByte ); // implemented as 1 byte
240 if (dest == T_CHAR) return (BitsPerInt - BitsPerShort);
241 if (dest == T_BYTE) return (BitsPerInt - BitsPerByte ) | CONV_VMINFO_SIGN_FLAG;
242 if (dest == T_SHORT) return (BitsPerInt - BitsPerShort) | CONV_VMINFO_SIGN_FLAG;
234 return 0; // case T_INT 243 return 0; // case T_INT
235 } 244 }
236 // Here is the transformation the i2i adapter must perform: 245 // Here is the transformation the i2i adapter must perform:
237 static int truncate_subword_from_vminfo(jint value, int vminfo) { 246 static int truncate_subword_from_vminfo(jint value, int vminfo) {
238 jint tem = value << vminfo; 247 jint tem = value << vminfo;