Mercurial > hg > truffle
comparison src/cpu/x86/vm/stubGenerator_x86_32.cpp @ 362:f8199438385b
Merge
author | apetrusenko |
---|---|
date | Wed, 17 Sep 2008 16:49:18 +0400 |
parents | dc7f315e41f7 1ee8caae33af |
children | eb28cf662f56 2649e5276dd7 |
comparison
equal
deleted
inserted
replaced
316:5fa96a5a7e76 | 362:f8199438385b |
---|---|
710 // Input: | 710 // Input: |
711 // start - starting address | 711 // start - starting address |
712 // end - element count | 712 // end - element count |
713 void gen_write_ref_array_pre_barrier(Register start, Register count) { | 713 void gen_write_ref_array_pre_barrier(Register start, Register count) { |
714 assert_different_registers(start, count); | 714 assert_different_registers(start, count); |
715 #if 0 // G1 only | |
716 BarrierSet* bs = Universe::heap()->barrier_set(); | 715 BarrierSet* bs = Universe::heap()->barrier_set(); |
717 switch (bs->kind()) { | 716 switch (bs->kind()) { |
718 case BarrierSet::G1SATBCT: | 717 case BarrierSet::G1SATBCT: |
719 case BarrierSet::G1SATBCTLogging: | 718 case BarrierSet::G1SATBCTLogging: |
720 { | 719 { |
721 __ pusha(); // push registers | 720 __ pusha(); // push registers |
722 __ push(count); | 721 __ push(count); |
723 __ push(start); | 722 __ push(start); |
724 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre)); | 723 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre))); |
725 __ addl(esp, wordSize * 2); | 724 __ addptr(rsp, 2*wordSize); |
726 __ popa(); | 725 __ popa(); |
727 } | 726 } |
728 break; | 727 break; |
729 case BarrierSet::CardTableModRef: | 728 case BarrierSet::CardTableModRef: |
730 case BarrierSet::CardTableExtension: | 729 case BarrierSet::CardTableExtension: |
732 break; | 731 break; |
733 default : | 732 default : |
734 ShouldNotReachHere(); | 733 ShouldNotReachHere(); |
735 | 734 |
736 } | 735 } |
737 #endif // 0 - G1 only | |
738 } | 736 } |
739 | 737 |
740 | 738 |
741 // | 739 // |
742 // Generate a post-barrier for an array store | 740 // Generate a post-barrier for an array store |
748 // | 746 // |
749 void gen_write_ref_array_post_barrier(Register start, Register count) { | 747 void gen_write_ref_array_post_barrier(Register start, Register count) { |
750 BarrierSet* bs = Universe::heap()->barrier_set(); | 748 BarrierSet* bs = Universe::heap()->barrier_set(); |
751 assert_different_registers(start, count); | 749 assert_different_registers(start, count); |
752 switch (bs->kind()) { | 750 switch (bs->kind()) { |
753 #if 0 // G1 only | |
754 case BarrierSet::G1SATBCT: | 751 case BarrierSet::G1SATBCT: |
755 case BarrierSet::G1SATBCTLogging: | 752 case BarrierSet::G1SATBCTLogging: |
756 { | 753 { |
757 __ pusha(); // push registers | 754 __ pusha(); // push registers |
758 __ push(count); | 755 __ push(count); |
759 __ push(start); | 756 __ push(start); |
760 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post)); | 757 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post))); |
761 __ addl(esp, wordSize * 2); | 758 __ addptr(rsp, 2*wordSize); |
762 __ popa(); | 759 __ popa(); |
763 | 760 |
764 } | 761 } |
765 break; | 762 break; |
766 #endif // 0 G1 only | |
767 | 763 |
768 case BarrierSet::CardTableModRef: | 764 case BarrierSet::CardTableModRef: |
769 case BarrierSet::CardTableExtension: | 765 case BarrierSet::CardTableExtension: |
770 { | 766 { |
771 CardTableModRefBS* ct = (CardTableModRefBS*)bs; | 767 CardTableModRefBS* ct = (CardTableModRefBS*)bs; |
1376 Address from_element_addr(end_from, count, Address::times_ptr, 0); | 1372 Address from_element_addr(end_from, count, Address::times_ptr, 0); |
1377 Address to_element_addr(end_to, count, Address::times_ptr, 0); | 1373 Address to_element_addr(end_to, count, Address::times_ptr, 0); |
1378 Address elem_klass_addr(elem, oopDesc::klass_offset_in_bytes()); | 1374 Address elem_klass_addr(elem, oopDesc::klass_offset_in_bytes()); |
1379 | 1375 |
1380 // Copy from low to high addresses, indexed from the end of each array. | 1376 // Copy from low to high addresses, indexed from the end of each array. |
1377 gen_write_ref_array_pre_barrier(to, count); | |
1381 __ lea(end_from, end_from_addr); | 1378 __ lea(end_from, end_from_addr); |
1382 __ lea(end_to, end_to_addr); | 1379 __ lea(end_to, end_to_addr); |
1383 gen_write_ref_array_pre_barrier(to, count); | |
1384 assert(length == count, ""); // else fix next line: | 1380 assert(length == count, ""); // else fix next line: |
1385 __ negptr(count); // negate and test the length | 1381 __ negptr(count); // negate and test the length |
1386 __ jccb(Assembler::notZero, L_load_element); | 1382 __ jccb(Assembler::notZero, L_load_element); |
1387 | 1383 |
1388 // Empty array: Nothing to do. | 1384 // Empty array: Nothing to do. |