OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 cmpq(with, kScratchRegister); | 88 cmpq(with, kScratchRegister); |
89 } | 89 } |
90 | 90 |
91 | 91 |
92 void MacroAssembler::RecordWriteHelper(Register object, | 92 void MacroAssembler::RecordWriteHelper(Register object, |
93 Register addr, | 93 Register addr, |
94 Register scratch) { | 94 Register scratch) { |
95 if (FLAG_debug_code) { | 95 if (FLAG_debug_code) { |
96 // Check that the object is not in new space. | 96 // Check that the object is not in new space. |
97 NearLabel not_in_new_space; | 97 NearLabel not_in_new_space; |
98 InNewSpace(object, scratch, not_equal, ¬_in_new_space); | 98 if (addr.is(kScratchRegister)) { |
| 99 push(kScratchRegister); |
| 100 InNewSpace(object, scratch, not_equal, ¬_in_new_space); |
| 101 pop(kScratchRegister); |
| 102 } else { |
| 103 InNewSpace(object, scratch, not_equal, ¬_in_new_space); |
| 104 } |
99 Abort("new-space object passed to RecordWriteHelper"); | 105 Abort("new-space object passed to RecordWriteHelper"); |
100 bind(¬_in_new_space); | 106 bind(¬_in_new_space); |
101 } | 107 } |
102 | 108 |
103 // Compute the page start address from the heap object pointer, and reuse | 109 // Compute the page start address from the heap object pointer, and reuse |
104 // the 'object' register for it. | 110 // the 'object' register for it. |
105 and_(object, Immediate(~Page::kPageAlignmentMask)); | 111 and_(object, Immediate(~Page::kPageAlignmentMask)); |
106 | 112 |
107 // Compute number of region covering addr. See Page::GetRegionNumberForAddress | 113 // Compute number of region covering addr. See Page::GetRegionNumberForAddress |
108 // method for more details. | 114 // method for more details. |
(...skipping 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2664 CPU::FlushICache(address_, size_); | 2670 CPU::FlushICache(address_, size_); |
2665 | 2671 |
2666 // Check that the code was patched as expected. | 2672 // Check that the code was patched as expected. |
2667 ASSERT(masm_.pc_ == address_ + size_); | 2673 ASSERT(masm_.pc_ == address_ + size_); |
2668 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2674 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2669 } | 2675 } |
2670 | 2676 |
2671 } } // namespace v8::internal | 2677 } } // namespace v8::internal |
2672 | 2678 |
2673 #endif // V8_TARGET_ARCH_X64 | 2679 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |