Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @ 2002:ac637b7220d1
6985015: C1 needs to support compressed oops
Summary: This change implements compressed oops for C1 for x64 and sparc. The changes are mostly on the codegen level, with a few exceptions when we do access things outside of the heap that are uncompressed from the IR. Compressed oops are now also enabled with tiered.
Reviewed-by: twisti, kvn, never, phh
author | iveresov |
---|---|
date | Tue, 30 Nov 2010 23:23:40 -0800 |
parents | f95d63e2154a |
children | b1a2afa37ec4 |
comparison
equal
deleted
inserted
replaced
1972:f95d63e2154a | 2002:ac637b7220d1 |
---|---|
38 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { | 38 void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { |
39 Label L; | 39 Label L; |
40 const Register temp_reg = G3_scratch; | 40 const Register temp_reg = G3_scratch; |
41 // Note: needs more testing of out-of-line vs. inline slow case | 41 // Note: needs more testing of out-of-line vs. inline slow case |
42 verify_oop(receiver); | 42 verify_oop(receiver); |
43 ld_ptr(receiver, oopDesc::klass_offset_in_bytes(), temp_reg); | 43 load_klass(receiver, temp_reg); |
44 cmp(temp_reg, iCache); | 44 cmp(temp_reg, iCache); |
45 brx(Assembler::equal, true, Assembler::pt, L); | 45 brx(Assembler::equal, true, Assembler::pt, L); |
46 delayed()->nop(); | 46 delayed()->nop(); |
47 AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub()); | 47 AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub()); |
48 jump_to(ic_miss, temp_reg); | 48 jump_to(ic_miss, temp_reg); |
183 if (UseBiasedLocking && !len->is_valid()) { | 183 if (UseBiasedLocking && !len->is_valid()) { |
184 ld_ptr(klass, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes(), t1); | 184 ld_ptr(klass, Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes(), t1); |
185 } else { | 185 } else { |
186 set((intx)markOopDesc::prototype(), t1); | 186 set((intx)markOopDesc::prototype(), t1); |
187 } | 187 } |
188 st_ptr(t1 , obj, oopDesc::mark_offset_in_bytes ()); | 188 st_ptr(t1, obj, oopDesc::mark_offset_in_bytes()); |
189 st_ptr(klass, obj, oopDesc::klass_offset_in_bytes ()); | 189 if (UseCompressedOops) { |
190 if (len->is_valid()) st(len , obj, arrayOopDesc::length_offset_in_bytes()); | 190 // Save klass |
191 mov(klass, t1); | |
192 encode_heap_oop_not_null(t1); | |
193 stw(t1, obj, oopDesc::klass_offset_in_bytes()); | |
194 } else { | |
195 st_ptr(klass, obj, oopDesc::klass_offset_in_bytes()); | |
196 } | |
197 if (len->is_valid()) st(len, obj, arrayOopDesc::length_offset_in_bytes()); | |
198 else if (UseCompressedOops) { | |
199 store_klass_gap(G0, obj); | |
200 } | |
191 } | 201 } |
192 | 202 |
193 | 203 |
194 void C1_MacroAssembler::initialize_body(Register base, Register index) { | 204 void C1_MacroAssembler::initialize_body(Register base, Register index) { |
195 assert_different_registers(base, index); | 205 assert_different_registers(base, index); |
233 Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise | 243 Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise |
234 int con_size_in_bytes, // object size in bytes if known at compile time | 244 int con_size_in_bytes, // object size in bytes if known at compile time |
235 Register t1, // temp register | 245 Register t1, // temp register |
236 Register t2 // temp register | 246 Register t2 // temp register |
237 ) { | 247 ) { |
238 const int hdr_size_in_bytes = instanceOopDesc::base_offset_in_bytes(); | 248 const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; |
239 | 249 |
240 initialize_header(obj, klass, noreg, t1, t2); | 250 initialize_header(obj, klass, noreg, t1, t2); |
241 | 251 |
242 #ifdef ASSERT | 252 #ifdef ASSERT |
243 { | 253 { |