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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 | 761 |
762 ldr(scratch, FieldMemOperand(scratch, token_offset)); | 762 ldr(scratch, FieldMemOperand(scratch, token_offset)); |
763 ldr(ip, FieldMemOperand(ip, token_offset)); | 763 ldr(ip, FieldMemOperand(ip, token_offset)); |
764 cmp(scratch, Operand(ip)); | 764 cmp(scratch, Operand(ip)); |
765 b(ne, miss); | 765 b(ne, miss); |
766 | 766 |
767 bind(&same_contexts); | 767 bind(&same_contexts); |
768 } | 768 } |
769 | 769 |
770 | 770 |
| 771 void MacroAssembler::AllocateObjectInNewSpace(int object_size, |
| 772 Register result, |
| 773 Register scratch1, |
| 774 Register scratch2, |
| 775 Label* gc_required, |
| 776 bool tag_allocated_object) { |
| 777 ASSERT(!result.is(scratch1)); |
| 778 ASSERT(!scratch1.is(scratch2)); |
| 779 |
| 780 // Load address of new object into result and allocation top address into |
| 781 // scratch1. |
| 782 ExternalReference new_space_allocation_top = |
| 783 ExternalReference::new_space_allocation_top_address(); |
| 784 mov(scratch1, Operand(new_space_allocation_top)); |
| 785 ldr(result, MemOperand(scratch1)); |
| 786 |
| 787 // Calculate new top and bail out if new space is exhausted. Use result |
| 788 // to calculate the new top. |
| 789 ExternalReference new_space_allocation_limit = |
| 790 ExternalReference::new_space_allocation_limit_address(); |
| 791 mov(scratch2, Operand(new_space_allocation_limit)); |
| 792 ldr(scratch2, MemOperand(scratch2)); |
| 793 add(result, result, Operand(object_size)); |
| 794 cmp(result, Operand(scratch2)); |
| 795 b(hi, gc_required); |
| 796 |
| 797 // Update allocation top. result temporarily holds the new top, |
| 798 str(result, MemOperand(scratch1)); |
| 799 |
| 800 // Tag and adjust back to start of new object. |
| 801 if (tag_allocated_object) { |
| 802 sub(result, result, Operand(object_size - kHeapObjectTag)); |
| 803 } else { |
| 804 sub(result, result, Operand(object_size)); |
| 805 } |
| 806 } |
| 807 |
| 808 |
771 void MacroAssembler::CompareObjectType(Register function, | 809 void MacroAssembler::CompareObjectType(Register function, |
772 Register map, | 810 Register map, |
773 Register type_reg, | 811 Register type_reg, |
774 InstanceType type) { | 812 InstanceType type) { |
775 ldr(map, FieldMemOperand(function, HeapObject::kMapOffset)); | 813 ldr(map, FieldMemOperand(function, HeapObject::kMapOffset)); |
776 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 814 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
777 cmp(type_reg, Operand(type)); | 815 cmp(type_reg, Operand(type)); |
778 } | 816 } |
779 | 817 |
780 | 818 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 } | 1053 } |
1016 #endif | 1054 #endif |
1017 mov(r0, Operand(p0)); | 1055 mov(r0, Operand(p0)); |
1018 push(r0); | 1056 push(r0); |
1019 mov(r0, Operand(Smi::FromInt(p1 - p0))); | 1057 mov(r0, Operand(Smi::FromInt(p1 - p0))); |
1020 push(r0); | 1058 push(r0); |
1021 CallRuntime(Runtime::kAbort, 2); | 1059 CallRuntime(Runtime::kAbort, 2); |
1022 // will not return here | 1060 // will not return here |
1023 } | 1061 } |
1024 | 1062 |
| 1063 |
1025 } } // namespace v8::internal | 1064 } } // namespace v8::internal |
OLD | NEW |