Mercurial > hg > truffle
comparison src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @ 362:f8199438385b
Merge
author | apetrusenko |
---|---|
date | Wed, 17 Sep 2008 16:49:18 +0400 |
parents | dc7f315e41f7 1ee8caae33af |
children | c6386080541b |
comparison
equal
deleted
inserted
replaced
316:5fa96a5a7e76 | 362:f8199438385b |
---|---|
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) { |
1152 addr = new LIR_Address(tmp, 0, type); | 1164 addr = new LIR_Address(tmp, 0, type); |
1153 } else { | 1165 } else { |
1154 addr = new LIR_Address(base_op, index_op, type); | 1166 addr = new LIR_Address(base_op, index_op, type); |
1155 } | 1167 } |
1156 | 1168 |
1169 if (is_obj) { | |
1170 pre_barrier(LIR_OprFact::address(addr), false, NULL); | |
1171 // _bs->c1_write_barrier_pre(this, LIR_OprFact::address(addr)); | |
1172 } | |
1157 __ move(data, addr); | 1173 __ move(data, addr); |
1158 if (is_obj) { | 1174 if (is_obj) { |
1159 // This address is precise | 1175 // This address is precise |
1160 post_barrier(LIR_OprFact::address(addr), data); | 1176 post_barrier(LIR_OprFact::address(addr), data); |
1161 } | 1177 } |