src/cpu/sparc/vm/interp_masm_sparc.cpp

changeset 1079
c517646eef23
parent 1049
3db67f76d308
child 1162
6b2273dd6fa9
     1.1 --- a/src/cpu/sparc/vm/interp_masm_sparc.cpp	Fri Mar 13 11:35:17 2009 -0700
     1.2 +++ b/src/cpu/sparc/vm/interp_masm_sparc.cpp	Fri Mar 13 18:39:22 2009 -0700
     1.3 @@ -866,65 +866,18 @@
     1.4                                                    Register Rtmp2,
     1.5                                                    Register Rtmp3,
     1.6                                                    Label &ok_is_subtype ) {
     1.7 -  Label not_subtype, loop;
     1.8 +  Label not_subtype;
     1.9  
    1.10    // Profile the not-null value's klass.
    1.11    profile_typecheck(Rsub_klass, Rtmp1);
    1.12  
    1.13 -  // Load the super-klass's check offset into Rtmp1
    1.14 -  ld( Rsuper_klass, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes(), Rtmp1 );
    1.15 -  // Load from the sub-klass's super-class display list, or a 1-word cache of
    1.16 -  // the secondary superclass list, or a failing value with a sentinel offset
    1.17 -  // if the super-klass is an interface or exceptionally deep in the Java
    1.18 -  // hierarchy and we have to scan the secondary superclass list the hard way.
    1.19 -  ld_ptr( Rsub_klass, Rtmp1, Rtmp2 );
    1.20 -  // See if we get an immediate positive hit
    1.21 -  cmp( Rtmp2, Rsuper_klass );
    1.22 -  brx( Assembler::equal, false, Assembler::pt, ok_is_subtype );
    1.23 -  // In the delay slot, check for immediate negative hit
    1.24 -  delayed()->cmp( Rtmp1, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes() );
    1.25 -  br( Assembler::notEqual, false, Assembler::pt, not_subtype );
    1.26 -  // In the delay slot, check for self
    1.27 -  delayed()->cmp( Rsub_klass, Rsuper_klass );
    1.28 -  brx( Assembler::equal, false, Assembler::pt, ok_is_subtype );
    1.29 -
    1.30 -  // Now do a linear scan of the secondary super-klass chain.
    1.31 -  delayed()->ld_ptr( Rsub_klass, sizeof(oopDesc) + Klass::secondary_supers_offset_in_bytes(), Rtmp2 );
    1.32 -
    1.33 -  // compress superclass
    1.34 -  if (UseCompressedOops) encode_heap_oop(Rsuper_klass);
    1.35 -
    1.36 -  // Rtmp2 holds the objArrayOop of secondary supers.
    1.37 -  ld( Rtmp2, arrayOopDesc::length_offset_in_bytes(), Rtmp1 );// Load the array length
    1.38 -  // Check for empty secondary super list
    1.39 -  tst(Rtmp1);
    1.40 -
    1.41 -  // Top of search loop
    1.42 -  bind( loop );
    1.43 -  br( Assembler::equal, false, Assembler::pn, not_subtype );
    1.44 -  delayed()->nop();
    1.45 -
    1.46 -  // load next super to check
    1.47 -  if (UseCompressedOops) {
    1.48 -    lduw( Rtmp2, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Rtmp3);
    1.49 -    // Bump array pointer forward one oop
    1.50 -    add( Rtmp2, 4, Rtmp2 );
    1.51 -  } else {
    1.52 -    ld_ptr( Rtmp2, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Rtmp3);
    1.53 -    // Bump array pointer forward one oop
    1.54 -    add( Rtmp2, wordSize, Rtmp2);
    1.55 -  }
    1.56 -  // Look for Rsuper_klass on Rsub_klass's secondary super-class-overflow list
    1.57 -  cmp( Rtmp3, Rsuper_klass );
    1.58 -  // A miss means we are NOT a subtype and need to keep looping
    1.59 -  brx( Assembler::notEqual, false, Assembler::pt, loop );
    1.60 -  delayed()->deccc( Rtmp1 );    // dec trip counter in delay slot
    1.61 -  // Falling out the bottom means we found a hit; we ARE a subtype
    1.62 -  if (UseCompressedOops) decode_heap_oop(Rsuper_klass);
    1.63 -  br( Assembler::always, false, Assembler::pt, ok_is_subtype );
    1.64 -  // Update the cache
    1.65 -  delayed()->st_ptr( Rsuper_klass, Rsub_klass,
    1.66 -                     sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes() );
    1.67 +  check_klass_subtype_fast_path(Rsub_klass, Rsuper_klass,
    1.68 +                                Rtmp1, Rtmp2,
    1.69 +                                &ok_is_subtype, &not_subtype, NULL);
    1.70 +
    1.71 +  check_klass_subtype_slow_path(Rsub_klass, Rsuper_klass,
    1.72 +                                Rtmp1, Rtmp2, Rtmp3, /*hack:*/ noreg,
    1.73 +                                &ok_is_subtype, NULL);
    1.74  
    1.75    bind(not_subtype);
    1.76    profile_typecheck_failed(Rtmp1);

mercurial