comparison src/cpu/x86/vm/interp_masm_x86_64.cpp @ 178:6d172e3548cb

6695819: verify_oopx rax: broken oop in decode_heap_oop Summary: Code in gen_subtype_check was encoding rax as an oop on a path where rax was not an oop. Reviewed-by: never, kvn
author coleenp
date Thu, 05 Jun 2008 17:02:54 -0400
parents ba764ed4b6f2
children d1605aabd0a1 6aae2f9d0294
comparison
equal deleted inserted replaced
177:2a8ec427fbe1 178:6d172e3548cb
231 assert(Rsub_klass != r14, "r14 holds locals"); 231 assert(Rsub_klass != r14, "r14 holds locals");
232 assert(Rsub_klass != r13, "r13 holds bcp"); 232 assert(Rsub_klass != r13, "r13 holds bcp");
233 assert(Rsub_klass != rcx, "rcx holds 2ndary super array length"); 233 assert(Rsub_klass != rcx, "rcx holds 2ndary super array length");
234 assert(Rsub_klass != rdi, "rdi holds 2ndary super array scan ptr"); 234 assert(Rsub_klass != rdi, "rdi holds 2ndary super array scan ptr");
235 235
236 Label not_subtype, loop; 236 Label not_subtype, not_subtype_pop, loop;
237 237
238 // Profile the not-null value's klass. 238 // Profile the not-null value's klass.
239 profile_typecheck(rcx, Rsub_klass, rdi); // blows rcx, rdi 239 profile_typecheck(rcx, Rsub_klass, rdi); // blows rcx, rdi
240 240
241 // Load the super-klass's check offset into rcx 241 // Load the super-klass's check offset into rcx
270 270
271 // this part is kind tricky, as values in supers array could be 32 or 64 bit wide 271 // this part is kind tricky, as values in supers array could be 32 or 64 bit wide
272 // and we store values in objArrays always encoded, thus we need to encode value 272 // and we store values in objArrays always encoded, thus we need to encode value
273 // before repne 273 // before repne
274 if (UseCompressedOops) { 274 if (UseCompressedOops) {
275 pushq(rax);
275 encode_heap_oop(rax); 276 encode_heap_oop(rax);
276 repne_scanl(); 277 repne_scanl();
277 // Not equal? 278 // Not equal?
278 jcc(Assembler::notEqual, not_subtype); 279 jcc(Assembler::notEqual, not_subtype_pop);
279 // decode heap oop here for movq 280 // restore heap oop here for movq
280 decode_heap_oop(rax); 281 popq(rax);
281 } else { 282 } else {
282 repne_scanq(); 283 repne_scanq();
283 jcc(Assembler::notEqual, not_subtype); 284 jcc(Assembler::notEqual, not_subtype);
284 } 285 }
285 // Must be equal but missed in cache. Update cache. 286 // Must be equal but missed in cache. Update cache.
286 movq(Address(Rsub_klass, sizeof(oopDesc) + 287 movq(Address(Rsub_klass, sizeof(oopDesc) +
287 Klass::secondary_super_cache_offset_in_bytes()), rax); 288 Klass::secondary_super_cache_offset_in_bytes()), rax);
288 jmp(ok_is_subtype); 289 jmp(ok_is_subtype);
289 290
291 bind(not_subtype_pop);
292 // restore heap oop here for miss
293 if (UseCompressedOops) popq(rax);
290 bind(not_subtype); 294 bind(not_subtype);
291 // decode heap oop here for miss
292 if (UseCompressedOops) decode_heap_oop(rax);
293 profile_typecheck_failed(rcx); // blows rcx 295 profile_typecheck_failed(rcx); // blows rcx
294 } 296 }
295 297
296 298
297 // Java Expression Stack 299 // Java Expression Stack