comparison src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @ 2449:bb22629531fa

7033732: C1: When calling c2 arraycopy stubs offsets and length must have clear upper 32bits Summary: With 7033154 we started calling c2 arraycopy stubs from c1. On sparcv9 we must clear the upper 32bits for offset (src_pos, dst_pos) and length parameters when calling them. Reviewed-by: never, kvn
author iveresov
date Mon, 04 Apr 2011 16:00:34 -0700
parents 13bc79b5c9c8
children 3d42f82cd811
comparison
equal deleted inserted replaced
2447:e863062e521d 2449:bb22629531fa
2056 int flags = op->flags(); 2056 int flags = op->flags();
2057 ciArrayKlass* default_type = op->expected_type(); 2057 ciArrayKlass* default_type = op->expected_type();
2058 BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL; 2058 BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL;
2059 if (basic_type == T_ARRAY) basic_type = T_OBJECT; 2059 if (basic_type == T_ARRAY) basic_type = T_OBJECT;
2060 2060
2061 #ifdef _LP64
2062 // higher 32bits must be null
2063 __ sra(dst_pos, 0, dst_pos);
2064 __ sra(src_pos, 0, src_pos);
2065 __ sra(length, 0, length);
2066 #endif
2067
2061 // set up the arraycopy stub information 2068 // set up the arraycopy stub information
2062 ArrayCopyStub* stub = op->stub(); 2069 ArrayCopyStub* stub = op->stub();
2063 2070
2064 // always do stub if no type information is available. it's ok if 2071 // always do stub if no type information is available. it's ok if
2065 // the known type isn't loaded since the code sanity checks 2072 // the known type isn't loaded since the code sanity checks
2148 __ add(length, dst_pos, tmp); 2155 __ add(length, dst_pos, tmp);
2149 __ cmp(tmp2, tmp); 2156 __ cmp(tmp2, tmp);
2150 __ br(Assembler::carrySet, false, Assembler::pn, *stub->entry()); 2157 __ br(Assembler::carrySet, false, Assembler::pn, *stub->entry());
2151 __ delayed()->nop(); 2158 __ delayed()->nop();
2152 } 2159 }
2153
2154 #ifndef _LP64
2155 __ sra(dst_pos, 0, dst_pos); //higher 32bits must be null
2156 __ sra(src_pos, 0, src_pos); //higher 32bits must be null
2157 #endif
2158 2160
2159 int shift = shift_amount(basic_type); 2161 int shift = shift_amount(basic_type);
2160 2162
2161 if (flags & LIR_OpArrayCopy::type_check) { 2163 if (flags & LIR_OpArrayCopy::type_check) {
2162 // We don't know the array types are compatible 2164 // We don't know the array types are compatible
2241 __ add(dst_ptr, dst_pos, dst_ptr); 2243 __ add(dst_ptr, dst_pos, dst_ptr);
2242 } else { 2244 } else {
2243 __ sll(dst_pos, shift, tmp); 2245 __ sll(dst_pos, shift, tmp);
2244 __ add(dst_ptr, tmp, dst_ptr); 2246 __ add(dst_ptr, tmp, dst_ptr);
2245 } 2247 }
2246 LP64_ONLY( __ sra(length, 0, length)); //higher 32bits must be null
2247 __ mov(length, len); 2248 __ mov(length, len);
2248 __ load_klass(dst, tmp); 2249 __ load_klass(dst, tmp);
2249 2250
2250 int ek_offset = (klassOopDesc::header_size() * HeapWordSize + 2251 int ek_offset = (klassOopDesc::header_size() * HeapWordSize +
2251 objArrayKlass::element_klass_offset_in_bytes()); 2252 objArrayKlass::element_klass_offset_in_bytes());