comparison src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @ 342:37f87013dfd8

6711316: Open source the Garbage-First garbage collector Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author ysr
date Thu, 05 Jun 2008 15:57:56 -0700
parents d5fc211aea19
children 1ee8caae33af
comparison
equal deleted inserted replaced
189:0b27f3512f9e 342:37f87013dfd8
363 363
364 CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info); 364 CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info);
365 __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3, store_check_info); 365 __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3, store_check_info);
366 } 366 }
367 367
368 if (obj_store) {
369 // Needs GC write barriers.
370 pre_barrier(LIR_OprFact::address(array_addr), false, NULL);
371 }
368 __ move(value.result(), array_addr, null_check_info); 372 __ move(value.result(), array_addr, null_check_info);
369 if (obj_store) { 373 if (obj_store) {
370 // Is this precise? 374 // Is this precise?
371 post_barrier(LIR_OprFact::address(array_addr), value.result()); 375 post_barrier(LIR_OprFact::address(array_addr), value.result());
372 } 376 }
661 cmp.load_item(); 665 cmp.load_item();
662 val.load_item(); 666 val.load_item();
663 667
664 __ add(obj.result(), offset.result(), addr); 668 __ add(obj.result(), offset.result(), addr);
665 669
670 if (type == objectType) { // Write-barrier needed for Object fields.
671 pre_barrier(obj.result(), false, NULL);
672 }
673
666 if (type == objectType) 674 if (type == objectType)
667 __ cas_obj(addr, cmp.result(), val.result(), t1, t2); 675 __ cas_obj(addr, cmp.result(), val.result(), t1, t2);
668 else if (type == intType) 676 else if (type == intType)
669 __ cas_int(addr, cmp.result(), val.result(), t1, t2); 677 __ cas_int(addr, cmp.result(), val.result(), t1, t2);
670 else if (type == longType) 678 else if (type == longType)
675 683
676 // generate conditional move of boolean result 684 // generate conditional move of boolean result
677 LIR_Opr result = rlock_result(x); 685 LIR_Opr result = rlock_result(x);
678 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result); 686 __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), result);
679 if (type == objectType) { // Write-barrier needed for Object fields. 687 if (type == objectType) { // Write-barrier needed for Object fields.
688 #ifdef PRECISE_CARDMARK
689 post_barrier(addr, val.result());
690 #else
680 post_barrier(obj.result(), val.result()); 691 post_barrier(obj.result(), val.result());
692 #endif // PRECISE_CARDMARK
681 } 693 }
682 } 694 }
683 695
684 696
685 void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { 697 void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
1151 addr = new LIR_Address(tmp, 0, type); 1163 addr = new LIR_Address(tmp, 0, type);
1152 } else { 1164 } else {
1153 addr = new LIR_Address(base_op, index_op, type); 1165 addr = new LIR_Address(base_op, index_op, type);
1154 } 1166 }
1155 1167
1168 if (is_obj) {
1169 pre_barrier(LIR_OprFact::address(addr), false, NULL);
1170 // _bs->c1_write_barrier_pre(this, LIR_OprFact::address(addr));
1171 }
1156 __ move(data, addr); 1172 __ move(data, addr);
1157 if (is_obj) { 1173 if (is_obj) {
1158 // This address is precise 1174 // This address is precise
1159 post_barrier(LIR_OprFact::address(addr), data); 1175 post_barrier(LIR_OprFact::address(addr), data);
1160 } 1176 }