1.1 --- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp Wed Mar 18 11:37:48 2009 -0400 1.2 +++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp Thu Mar 19 09:13:24 2009 -0700 1.3 @@ -2091,66 +2091,9 @@ 1.4 1.5 Label L_miss; 1.6 1.7 - // a couple of useful fields in sub_klass: 1.8 - int ss_offset = (klassOopDesc::header_size() * HeapWordSize + 1.9 - Klass::secondary_supers_offset_in_bytes()); 1.10 - int sc_offset = (klassOopDesc::header_size() * HeapWordSize + 1.11 - Klass::secondary_super_cache_offset_in_bytes()); 1.12 - Address secondary_supers_addr(sub_klass, ss_offset); 1.13 - Address super_cache_addr( sub_klass, sc_offset); 1.14 - 1.15 - // if the pointers are equal, we are done (e.g., String[] elements) 1.16 - __ cmpptr(super_klass, sub_klass); 1.17 - __ jcc(Assembler::equal, L_success); 1.18 - 1.19 - // check the supertype display: 1.20 - Address super_check_addr(sub_klass, super_check_offset, Address::times_1, 0); 1.21 - __ cmpptr(super_klass, super_check_addr); // test the super type 1.22 - __ jcc(Assembler::equal, L_success); 1.23 - 1.24 - // if it was a primary super, we can just fail immediately 1.25 - __ cmpl(super_check_offset, sc_offset); 1.26 - __ jcc(Assembler::notEqual, L_miss); 1.27 - 1.28 - // Now do a linear scan of the secondary super-klass chain. 1.29 - // The repne_scan instruction uses fixed registers, which we must spill. 1.30 - // (We need a couple more temps in any case.) 1.31 - // This code is rarely used, so simplicity is a virtue here. 1.32 - inc_counter_np(SharedRuntime::_partial_subtype_ctr); 1.33 - { 1.34 - __ push(rax); 1.35 - __ push(rcx); 1.36 - __ push(rdi); 1.37 - assert_different_registers(sub_klass, super_klass, rax, rcx, rdi); 1.38 - 1.39 - __ movptr(rdi, secondary_supers_addr); 1.40 - // Load the array length. 1.41 - __ movl(rcx, Address(rdi, arrayOopDesc::length_offset_in_bytes())); 1.42 - // Skip to start of data. 1.43 - __ addptr(rdi, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); 1.44 - // Scan rcx words at [rdi] for occurance of rax 1.45 - // Set NZ/Z based on last compare 1.46 - __ movptr(rax, super_klass); 1.47 - if (UseCompressedOops) { 1.48 - // Compare against compressed form. Don't need to uncompress because 1.49 - // looks like orig rax is restored in popq below. 1.50 - __ encode_heap_oop(rax); 1.51 - __ repne_scanl(); 1.52 - } else { 1.53 - __ repne_scan(); 1.54 - } 1.55 - 1.56 - // Unspill the temp. registers: 1.57 - __ pop(rdi); 1.58 - __ pop(rcx); 1.59 - __ pop(rax); 1.60 - 1.61 - __ jcc(Assembler::notEqual, L_miss); 1.62 - } 1.63 - 1.64 - // Success. Cache the super we found and proceed in triumph. 1.65 - __ movptr(super_cache_addr, super_klass); // note: rax is dead 1.66 - __ jmp(L_success); 1.67 + __ check_klass_subtype_fast_path(sub_klass, super_klass, noreg, &L_success, &L_miss, NULL, 1.68 + super_check_offset); 1.69 + __ check_klass_subtype_slow_path(sub_klass, super_klass, noreg, noreg, &L_success, NULL); 1.70 1.71 // Fall through on failure! 1.72 __ BIND(L_miss);