Mercurial > hg > graal-jvmci-8
comparison src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @ 644:c517646eef23
6813212: factor duplicated assembly code for general subclass check (for 6655638)
Summary: Code in interp_masm, stubGenerator, c1_LIRAssembler, and AD files moved into MacroAssembler.
Reviewed-by: kvn
author | jrose |
---|---|
date | Fri, 13 Mar 2009 18:39:22 -0700 |
parents | 37f87013dfd8 |
children | 6b2273dd6fa9 |
comparison
equal
deleted
inserted
replaced
643:c771b7f43bbf | 644:c517646eef23 |
---|---|
712 // | 712 // |
713 // ret : G3 | 713 // ret : G3 |
714 // sub : G3, argument, destroyed | 714 // sub : G3, argument, destroyed |
715 // super: G1, argument, not changed | 715 // super: G1, argument, not changed |
716 // raddr: O7, blown by call | 716 // raddr: O7, blown by call |
717 Label loop, miss; | 717 Label miss; |
718 | 718 |
719 __ save_frame(0); // Blow no registers! | 719 __ save_frame(0); // Blow no registers! |
720 | 720 |
721 __ ld_ptr( G3, sizeof(oopDesc) + Klass::secondary_supers_offset_in_bytes(), L3 ); | 721 __ check_klass_subtype_slow_path(G3, G1, L0, L1, L2, L4, NULL, &miss); |
722 __ lduw(L3,arrayOopDesc::length_offset_in_bytes(),L0); // length in l0 | |
723 __ add(L3,arrayOopDesc::base_offset_in_bytes(T_OBJECT),L1); // ptr into array | |
724 __ clr(L4); // Index | |
725 // Load a little early; will load 1 off the end of the array. | |
726 // Ok for now; revisit if we have other uses of this routine. | |
727 __ ld_ptr(L1,0,L2); // Will load a little early | |
728 | |
729 // The scan loop | |
730 __ bind(loop); | |
731 __ add(L1,wordSize,L1); // Bump by OOP size | |
732 __ cmp(L4,L0); | |
733 __ br(Assembler::equal,false,Assembler::pn,miss); | |
734 __ delayed()->inc(L4); // Bump index | |
735 __ subcc(L2,G1,L3); // Check for match; zero in L3 for a hit | |
736 __ brx( Assembler::notEqual, false, Assembler::pt, loop ); | |
737 __ delayed()->ld_ptr(L1,0,L2); // Will load a little early | |
738 | |
739 // Got a hit; report success; set cache | |
740 __ st_ptr( G1, G3, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes() ); | |
741 | 722 |
742 __ mov(1, G3); | 723 __ mov(1, G3); |
743 __ ret(); // Result in G5 is ok; flags set | 724 __ ret(); // Result in G5 is 'true' |
744 __ delayed()->restore(); // free copy or add can go here | 725 __ delayed()->restore(); // free copy or add can go here |
745 | 726 |
746 __ bind(miss); | 727 __ bind(miss); |
747 __ mov(0, G3); | 728 __ mov(0, G3); |
748 __ ret(); // Result in G5 is ok; flags set | 729 __ ret(); // Result in G5 is 'false' |
749 __ delayed()->restore(); // free copy or add can go here | 730 __ delayed()->restore(); // free copy or add can go here |
750 } | 731 } |
751 | 732 |
752 case monitorenter_nofpu_id: | 733 case monitorenter_nofpu_id: |
753 case monitorenter_id: | 734 case monitorenter_id: |