src/cpu/x86/vm/c1_LIRAssembler_x86.cpp

changeset 1082
bd441136a5ce
parent 1063
7bb995fbd3c0
parent 1079
c517646eef23
child 1215
c96bf21b756f
     1.1 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Wed Mar 18 11:37:48 2009 -0400
     1.2 +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Thu Mar 19 09:13:24 2009 -0700
     1.3 @@ -1598,18 +1598,9 @@
     1.4  
     1.5      // get instance klass
     1.6      __ movptr(k_RInfo, Address(k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)));
     1.7 -    // get super_check_offset
     1.8 -    __ movl(Rtmp1, Address(k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes()));
     1.9 -    // See if we get an immediate positive hit
    1.10 -    __ cmpptr(k_RInfo, Address(klass_RInfo, Rtmp1, Address::times_1));
    1.11 -    __ jcc(Assembler::equal, done);
    1.12 -    // check for immediate negative hit
    1.13 -    __ cmpl(Rtmp1, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes());
    1.14 -    __ jcc(Assembler::notEqual, *stub->entry());
    1.15 -    // check for self
    1.16 -    __ cmpptr(klass_RInfo, k_RInfo);
    1.17 -    __ jcc(Assembler::equal, done);
    1.18 -
    1.19 +    // perform the fast part of the checking logic
    1.20 +    __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, &done, stub->entry(), NULL);
    1.21 +    // call out-of-line instance of __ check_klass_subtype_slow_path(...):
    1.22      __ push(klass_RInfo);
    1.23      __ push(k_RInfo);
    1.24      __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id)));
    1.25 @@ -1735,17 +1726,9 @@
    1.26          }
    1.27          __ bind(done);
    1.28        } else {
    1.29 -        __ movl(Rtmp1, Address(k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes()));
    1.30 -        // See if we get an immediate positive hit
    1.31 -        __ cmpptr(k_RInfo, Address(klass_RInfo, Rtmp1, Address::times_1));
    1.32 -        __ jcc(Assembler::equal, done);
    1.33 -        // check for immediate negative hit
    1.34 -        __ cmpl(Rtmp1, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes());
    1.35 -        __ jcc(Assembler::notEqual, *stub->entry());
    1.36 -        // check for self
    1.37 -        __ cmpptr(klass_RInfo, k_RInfo);
    1.38 -        __ jcc(Assembler::equal, done);
    1.39 -
    1.40 +        // perform the fast part of the checking logic
    1.41 +        __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, &done, stub->entry(), NULL);
    1.42 +        // call out-of-line instance of __ check_klass_subtype_slow_path(...):
    1.43          __ push(klass_RInfo);
    1.44          __ push(k_RInfo);
    1.45          __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id)));
    1.46 @@ -1821,23 +1804,15 @@
    1.47            __ pop(dst);
    1.48            __ jmp(done);
    1.49          }
    1.50 -      } else {
    1.51 -#else
    1.52 -      { // YUCK
    1.53 +      }
    1.54 +        else // next block is unconditional if LP64:
    1.55  #endif // LP64
    1.56 +      {
    1.57          assert(dst != klass_RInfo && dst != k_RInfo, "need 3 registers");
    1.58  
    1.59 -        __ movl(dst, Address(k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes()));
    1.60 -        // See if we get an immediate positive hit
    1.61 -        __ cmpptr(k_RInfo, Address(klass_RInfo, dst, Address::times_1));
    1.62 -        __ jcc(Assembler::equal, one);
    1.63 -        // check for immediate negative hit
    1.64 -        __ cmpl(dst, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes());
    1.65 -        __ jcc(Assembler::notEqual, zero);
    1.66 -        // check for self
    1.67 -        __ cmpptr(klass_RInfo, k_RInfo);
    1.68 -        __ jcc(Assembler::equal, one);
    1.69 -
    1.70 +        // perform the fast part of the checking logic
    1.71 +        __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, dst, &one, &zero, NULL);
    1.72 +        // call out-of-line instance of __ check_klass_subtype_slow_path(...):
    1.73          __ push(klass_RInfo);
    1.74          __ push(k_RInfo);
    1.75          __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id)));

mercurial