| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 Register scratch, | 79 Register scratch, |
| 80 SaveFPRegsMode save_fp) { | 80 SaveFPRegsMode save_fp) { |
| 81 if (FLAG_debug_code) { | 81 if (FLAG_debug_code) { |
| 82 // Check that the object is not in new space. | 82 // Check that the object is not in new space. |
| 83 NearLabel not_in_new_space; | 83 NearLabel not_in_new_space; |
| 84 InNewSpace(object, scratch, not_equal, ¬_in_new_space); | 84 InNewSpace(object, scratch, not_equal, ¬_in_new_space); |
| 85 Abort("new-space object passed to RecordWriteHelper"); | 85 Abort("new-space object passed to RecordWriteHelper"); |
| 86 bind(¬_in_new_space); | 86 bind(¬_in_new_space); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Load write buffer top. | 89 // Load store buffer top. |
| 90 LoadRoot(scratch, Heap::kWriteBufferTopRootIndex); | 90 LoadRoot(scratch, Heap::kStoreBufferTopRootIndex); |
| 91 // Store pointer to buffer. | 91 // Store pointer to buffer. |
| 92 movq(Operand(scratch, 0), addr); | 92 movq(Operand(scratch, 0), addr); |
| 93 // Increment buffer top. | 93 // Increment buffer top. |
| 94 addq(scratch, Immediate(kPointerSize)); | 94 addq(scratch, Immediate(kPointerSize)); |
| 95 // Write back new top of buffer. | 95 // Write back new top of buffer. |
| 96 StoreRoot(scratch, Heap::kWriteBufferTopRootIndex); | 96 StoreRoot(scratch, Heap::kStoreBufferTopRootIndex); |
| 97 // Call stub on end of buffer. | 97 // Call stub on end of buffer. |
| 98 NearLabel no_overflow; | 98 NearLabel no_overflow; |
| 99 // Check for end of buffer. | 99 // Check for end of buffer. |
| 100 testq(scratch, Immediate(WriteBuffer::kWriteBufferOverflowBit)); | 100 testq(scratch, Immediate(StoreBuffer::kStoreBufferOverflowBit)); |
| 101 j(equal, &no_overflow); | 101 j(equal, &no_overflow); |
| 102 WriteBufferOverflowStub write_buffer_overflow = | 102 StoreBufferOverflowStub store_buffer_overflow = |
| 103 WriteBufferOverflowStub(save_fp); | 103 StoreBufferOverflowStub(save_fp); |
| 104 CallStub(&write_buffer_overflow); | 104 CallStub(&store_buffer_overflow); |
| 105 bind(&no_overflow); | 105 bind(&no_overflow); |
| 106 } | 106 } |
| 107 | 107 |
| 108 | 108 |
| 109 void MacroAssembler::RecordWrite(Register object, | 109 void MacroAssembler::RecordWrite(Register object, |
| 110 int offset, | 110 int offset, |
| 111 Register value, | 111 Register value, |
| 112 Register index, | 112 Register index, |
| 113 SaveFPRegsMode save_fp) { | 113 SaveFPRegsMode save_fp) { |
| 114 // The compiled code assumes that record write doesn't change the | 114 // The compiled code assumes that record write doesn't change the |
| (...skipping 2242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2357 CPU::FlushICache(address_, size_); | 2357 CPU::FlushICache(address_, size_); |
| 2358 | 2358 |
| 2359 // Check that the code was patched as expected. | 2359 // Check that the code was patched as expected. |
| 2360 ASSERT(masm_.pc_ == address_ + size_); | 2360 ASSERT(masm_.pc_ == address_ + size_); |
| 2361 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2361 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 2362 } | 2362 } |
| 2363 | 2363 |
| 2364 } } // namespace v8::internal | 2364 } } // namespace v8::internal |
| 2365 | 2365 |
| 2366 #endif // V8_TARGET_ARCH_X64 | 2366 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |