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