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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 Register result_end, | 624 Register result_end, |
625 Register scratch, | 625 Register scratch, |
626 AllocationFlags flags) { | 626 AllocationFlags flags) { |
627 ExternalReference new_space_allocation_top = | 627 ExternalReference new_space_allocation_top = |
628 ExternalReference::new_space_allocation_top_address(); | 628 ExternalReference::new_space_allocation_top_address(); |
629 | 629 |
630 // Just return if allocation top is already known. | 630 // Just return if allocation top is already known. |
631 if ((flags & RESULT_CONTAINS_TOP) != 0) { | 631 if ((flags & RESULT_CONTAINS_TOP) != 0) { |
632 // No use of scratch if allocation top is provided. | 632 // No use of scratch if allocation top is provided. |
633 ASSERT(scratch.is(no_reg)); | 633 ASSERT(scratch.is(no_reg)); |
| 634 #ifdef DEBUG |
| 635 // Assert that result actually contains top on entry. |
| 636 cmp(result, Operand::StaticVariable(new_space_allocation_top)); |
| 637 Check(equal, "Unexpected allocation top"); |
| 638 #endif |
634 return; | 639 return; |
635 } | 640 } |
636 | 641 |
637 // Move address of new object to result. Use scratch register if available. | 642 // Move address of new object to result. Use scratch register if available. |
638 if (scratch.is(no_reg)) { | 643 if (scratch.is(no_reg)) { |
639 mov(result, Operand::StaticVariable(new_space_allocation_top)); | 644 mov(result, Operand::StaticVariable(new_space_allocation_top)); |
640 } else { | 645 } else { |
641 ASSERT(!scratch.is(result_end)); | 646 ASSERT(!scratch.is(result_end)); |
642 mov(Operand(scratch), Immediate(new_space_allocation_top)); | 647 mov(Operand(scratch), Immediate(new_space_allocation_top)); |
643 mov(result, Operand(scratch, 0)); | 648 mov(result, Operand(scratch, 0)); |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 // Indicate that code has changed. | 1182 // Indicate that code has changed. |
1178 CPU::FlushICache(address_, size_); | 1183 CPU::FlushICache(address_, size_); |
1179 | 1184 |
1180 // Check that the code was patched as expected. | 1185 // Check that the code was patched as expected. |
1181 ASSERT(masm_.pc_ == address_ + size_); | 1186 ASSERT(masm_.pc_ == address_ + size_); |
1182 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1187 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1183 } | 1188 } |
1184 | 1189 |
1185 | 1190 |
1186 } } // namespace v8::internal | 1191 } } // namespace v8::internal |
OLD | NEW |