OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 | 657 |
658 // Update new top. Use scratch if available. | 658 // Update new top. Use scratch if available. |
659 if (scratch.is(no_reg)) { | 659 if (scratch.is(no_reg)) { |
660 mov(Operand::StaticVariable(new_space_allocation_top), result_end); | 660 mov(Operand::StaticVariable(new_space_allocation_top), result_end); |
661 } else { | 661 } else { |
662 mov(Operand(scratch, 0), result_end); | 662 mov(Operand(scratch, 0), result_end); |
663 } | 663 } |
664 } | 664 } |
665 | 665 |
666 | 666 |
667 void MacroAssembler::AllocateObjectInNewSpace(int object_size, | 667 void MacroAssembler::AllocateInNewSpace(int object_size, |
668 Register result, | 668 Register result, |
669 Register result_end, | 669 Register result_end, |
670 Register scratch, | 670 Register scratch, |
671 Label* gc_required, | 671 Label* gc_required, |
672 AllocationFlags flags) { | 672 AllocationFlags flags) { |
673 ASSERT(!result.is(result_end)); | 673 ASSERT(!result.is(result_end)); |
674 | 674 |
675 // Load address of new object into result. | 675 // Load address of new object into result. |
676 LoadAllocationTopHelper(result, result_end, scratch, flags); | 676 LoadAllocationTopHelper(result, result_end, scratch, flags); |
677 | 677 |
678 // Calculate new top and bail out if new space is exhausted. | 678 // Calculate new top and bail out if new space is exhausted. |
679 ExternalReference new_space_allocation_limit = | 679 ExternalReference new_space_allocation_limit = |
680 ExternalReference::new_space_allocation_limit_address(); | 680 ExternalReference::new_space_allocation_limit_address(); |
681 lea(result_end, Operand(result, object_size)); | 681 lea(result_end, Operand(result, object_size)); |
682 cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); | 682 cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); |
683 j(above, gc_required, not_taken); | 683 j(above, gc_required, not_taken); |
684 | 684 |
685 // Update allocation top. | 685 // Update allocation top. |
686 UpdateAllocationTopHelper(result_end, scratch); | 686 UpdateAllocationTopHelper(result_end, scratch); |
687 | 687 |
688 // Tag result if requested. | 688 // Tag result if requested. |
689 if ((flags & TAG_OBJECT) != 0) { | 689 if ((flags & TAG_OBJECT) != 0) { |
690 or_(Operand(result), Immediate(kHeapObjectTag)); | 690 or_(Operand(result), Immediate(kHeapObjectTag)); |
691 } | 691 } |
692 } | 692 } |
693 | 693 |
694 | 694 |
695 void MacroAssembler::AllocateObjectInNewSpace(int header_size, | 695 void MacroAssembler::AllocateInNewSpace(int header_size, |
696 ScaleFactor element_size, | 696 ScaleFactor element_size, |
697 Register element_count, | 697 Register element_count, |
698 Register result, | 698 Register result, |
699 Register result_end, | 699 Register result_end, |
700 Register scratch, | 700 Register scratch, |
701 Label* gc_required, | 701 Label* gc_required, |
702 AllocationFlags flags) { | 702 AllocationFlags flags) { |
703 ASSERT(!result.is(result_end)); | 703 ASSERT(!result.is(result_end)); |
704 | 704 |
705 // Load address of new object into result. | 705 // Load address of new object into result. |
706 LoadAllocationTopHelper(result, result_end, scratch, flags); | 706 LoadAllocationTopHelper(result, result_end, scratch, flags); |
707 | 707 |
708 // Calculate new top and bail out if new space is exhausted. | 708 // Calculate new top and bail out if new space is exhausted. |
709 ExternalReference new_space_allocation_limit = | 709 ExternalReference new_space_allocation_limit = |
710 ExternalReference::new_space_allocation_limit_address(); | 710 ExternalReference::new_space_allocation_limit_address(); |
711 lea(result_end, Operand(result, element_count, element_size, header_size)); | 711 lea(result_end, Operand(result, element_count, element_size, header_size)); |
712 cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); | 712 cmp(result_end, Operand::StaticVariable(new_space_allocation_limit)); |
713 j(above, gc_required); | 713 j(above, gc_required); |
714 | 714 |
715 // Update allocation top. | 715 // Update allocation top. |
716 UpdateAllocationTopHelper(result_end, scratch); | 716 UpdateAllocationTopHelper(result_end, scratch); |
717 | 717 |
718 // Tag result if requested. | 718 // Tag result if requested. |
719 if ((flags & TAG_OBJECT) != 0) { | 719 if ((flags & TAG_OBJECT) != 0) { |
720 or_(Operand(result), Immediate(kHeapObjectTag)); | 720 or_(Operand(result), Immediate(kHeapObjectTag)); |
721 } | 721 } |
722 } | 722 } |
723 | 723 |
724 | 724 |
725 void MacroAssembler::AllocateObjectInNewSpace(Register object_size, | 725 void MacroAssembler::AllocateInNewSpace(Register object_size, |
726 Register result, | 726 Register result, |
727 Register result_end, | 727 Register result_end, |
728 Register scratch, | 728 Register scratch, |
729 Label* gc_required, | 729 Label* gc_required, |
730 AllocationFlags flags) { | 730 AllocationFlags flags) { |
731 ASSERT(!result.is(result_end)); | 731 ASSERT(!result.is(result_end)); |
732 | 732 |
733 // Load address of new object into result. | 733 // Load address of new object into result. |
734 LoadAllocationTopHelper(result, result_end, scratch, flags); | 734 LoadAllocationTopHelper(result, result_end, scratch, flags); |
735 | 735 |
736 // Calculate new top and bail out if new space is exhausted. | 736 // Calculate new top and bail out if new space is exhausted. |
737 ExternalReference new_space_allocation_limit = | 737 ExternalReference new_space_allocation_limit = |
738 ExternalReference::new_space_allocation_limit_address(); | 738 ExternalReference::new_space_allocation_limit_address(); |
739 if (!object_size.is(result_end)) { | 739 if (!object_size.is(result_end)) { |
740 mov(result_end, object_size); | 740 mov(result_end, object_size); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 // Indicate that code has changed. | 1183 // Indicate that code has changed. |
1184 CPU::FlushICache(address_, size_); | 1184 CPU::FlushICache(address_, size_); |
1185 | 1185 |
1186 // Check that the code was patched as expected. | 1186 // Check that the code was patched as expected. |
1187 ASSERT(masm_.pc_ == address_ + size_); | 1187 ASSERT(masm_.pc_ == address_ + size_); |
1188 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1188 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1189 } | 1189 } |
1190 | 1190 |
1191 | 1191 |
1192 } } // namespace v8::internal | 1192 } } // namespace v8::internal |
OLD | NEW |