1.1 --- a/src/cpu/sparc/vm/sparc.ad Wed Mar 18 11:37:48 2009 -0400 1.2 +++ b/src/cpu/sparc/vm/sparc.ad Thu Mar 19 09:13:24 2009 -0700 1.3 @@ -547,7 +547,11 @@ 1.4 int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes(); 1.5 int klass_load_size; 1.6 if (UseCompressedOops) { 1.7 - klass_load_size = 3*BytesPerInstWord; // see MacroAssembler::load_klass() 1.8 + assert(Universe::heap() != NULL, "java heap should be initialized"); 1.9 + if (Universe::narrow_oop_base() == NULL) 1.10 + klass_load_size = 2*BytesPerInstWord; // see MacroAssembler::load_klass() 1.11 + else 1.12 + klass_load_size = 3*BytesPerInstWord; 1.13 } else { 1.14 klass_load_size = 1*BytesPerInstWord; 1.15 } 1.16 @@ -1601,9 +1605,11 @@ 1.17 st->print_cr("\nUEP:"); 1.18 #ifdef _LP64 1.19 if (UseCompressedOops) { 1.20 + assert(Universe::heap() != NULL, "java heap should be initialized"); 1.21 st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass"); 1.22 st->print_cr("\tSLL R_G5,3,R_G5"); 1.23 - st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); 1.24 + if (Universe::narrow_oop_base() != NULL) 1.25 + st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5"); 1.26 } else { 1.27 st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check"); 1.28 } 1.29 @@ -2502,7 +2508,11 @@ 1.30 __ load_klass(O0, G3_scratch); 1.31 int klass_load_size; 1.32 if (UseCompressedOops) { 1.33 - klass_load_size = 3*BytesPerInstWord; 1.34 + assert(Universe::heap() != NULL, "java heap should be initialized"); 1.35 + if (Universe::narrow_oop_base() == NULL) 1.36 + klass_load_size = 2*BytesPerInstWord; 1.37 + else 1.38 + klass_load_size = 3*BytesPerInstWord; 1.39 } else { 1.40 klass_load_size = 1*BytesPerInstWord; 1.41 } 1.42 @@ -9005,6 +9015,33 @@ 1.43 ins_pipe(long_memory_op); 1.44 %} 1.45 1.46 + 1.47 +//---------- Population Count Instructions ------------------------------------- 1.48 + 1.49 +instruct popCountI(iRegI dst, iRegI src) %{ 1.50 + predicate(UsePopCountInstruction); 1.51 + match(Set dst (PopCountI src)); 1.52 + 1.53 + format %{ "POPC $src, $dst" %} 1.54 + ins_encode %{ 1.55 + __ popc($src$$Register, $dst$$Register); 1.56 + %} 1.57 + ins_pipe(ialu_reg); 1.58 +%} 1.59 + 1.60 +// Note: Long.bitCount(long) returns an int. 1.61 +instruct popCountL(iRegI dst, iRegL src) %{ 1.62 + predicate(UsePopCountInstruction); 1.63 + match(Set dst (PopCountL src)); 1.64 + 1.65 + format %{ "POPC $src, $dst" %} 1.66 + ins_encode %{ 1.67 + __ popc($src$$Register, $dst$$Register); 1.68 + %} 1.69 + ins_pipe(ialu_reg); 1.70 +%} 1.71 + 1.72 + 1.73 // ============================================================================ 1.74 //------------Bytes reverse-------------------------------------------------- 1.75