1.1 --- a/src/cpu/x86/vm/x86_32.ad Fri Mar 13 11:35:17 2009 -0700 1.2 +++ b/src/cpu/x86/vm/x86_32.ad Fri Mar 13 18:39:22 2009 -0700 1.3 @@ -1692,26 +1692,15 @@ 1.4 Register Reax = as_Register(EAX_enc); // super class 1.5 Register Recx = as_Register(ECX_enc); // killed 1.6 Register Resi = as_Register(ESI_enc); // sub class 1.7 - Label hit, miss; 1.8 + Label miss; 1.9 1.10 MacroAssembler _masm(&cbuf); 1.11 - // Compare super with sub directly, since super is not in its own SSA. 1.12 - // The compiler used to emit this test, but we fold it in here, 1.13 - // to allow platform-specific tweaking on sparc. 1.14 - __ cmpptr(Reax, Resi); 1.15 - __ jcc(Assembler::equal, hit); 1.16 -#ifndef PRODUCT 1.17 - __ incrementl(ExternalAddress((address)&SharedRuntime::_partial_subtype_ctr)); 1.18 -#endif //PRODUCT 1.19 - __ movptr(Redi,Address(Resi,sizeof(oopDesc) + Klass::secondary_supers_offset_in_bytes())); 1.20 - __ movl(Recx,Address(Redi,arrayOopDesc::length_offset_in_bytes())); 1.21 - __ addptr(Redi,arrayOopDesc::base_offset_in_bytes(T_OBJECT)); 1.22 - __ repne_scan(); 1.23 - __ jcc(Assembler::notEqual, miss); 1.24 - __ movptr(Address(Resi,sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes()),Reax); 1.25 - __ bind(hit); 1.26 - if( $primary ) 1.27 - __ xorptr(Redi,Redi); 1.28 + __ check_klass_subtype_slow_path(Resi, Reax, Recx, Redi, 1.29 + NULL, &miss, 1.30 + /*set_cond_codes:*/ true); 1.31 + if ($primary) { 1.32 + __ xorptr(Redi, Redi); 1.33 + } 1.34 __ bind(miss); 1.35 %} 1.36 1.37 @@ -12566,15 +12555,12 @@ 1.38 effect( KILL rcx, KILL cr ); 1.39 1.40 ins_cost(1100); // slightly larger than the next version 1.41 - format %{ "CMPL EAX,ESI\n\t" 1.42 - "JEQ,s hit\n\t" 1.43 - "MOV EDI,[$sub+Klass::secondary_supers]\n\t" 1.44 + format %{ "MOV EDI,[$sub+Klass::secondary_supers]\n\t" 1.45 "MOV ECX,[EDI+arrayKlass::length]\t# length to scan\n\t" 1.46 "ADD EDI,arrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t" 1.47 "REPNE SCASD\t# Scan *EDI++ for a match with EAX while CX-- != 0\n\t" 1.48 "JNE,s miss\t\t# Missed: EDI not-zero\n\t" 1.49 "MOV [$sub+Klass::secondary_super_cache],$super\t# Hit: update cache\n\t" 1.50 - "hit:\n\t" 1.51 "XOR $result,$result\t\t Hit: EDI zero\n\t" 1.52 "miss:\t" %} 1.53 1.54 @@ -12588,9 +12574,7 @@ 1.55 effect( KILL rcx, KILL result ); 1.56 1.57 ins_cost(1000); 1.58 - format %{ "CMPL EAX,ESI\n\t" 1.59 - "JEQ,s miss\t# Actually a hit; we are done.\n\t" 1.60 - "MOV EDI,[$sub+Klass::secondary_supers]\n\t" 1.61 + format %{ "MOV EDI,[$sub+Klass::secondary_supers]\n\t" 1.62 "MOV ECX,[EDI+arrayKlass::length]\t# length to scan\n\t" 1.63 "ADD EDI,arrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t" 1.64 "REPNE SCASD\t# Scan *EDI++ for a match with EAX while CX-- != 0\n\t"