| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 : Assembler(buffer, size), | 45 : Assembler(buffer, size), |
| 46 generating_stub_(false), | 46 generating_stub_(false), |
| 47 allow_stub_calls_(true), | 47 allow_stub_calls_(true), |
| 48 code_object_(Heap::undefined_value()) { | 48 code_object_(Heap::undefined_value()) { |
| 49 } | 49 } |
| 50 | 50 |
| 51 | 51 |
| 52 void MacroAssembler::RecordWriteHelper(Register object, | 52 void MacroAssembler::RecordWriteHelper(Register object, |
| 53 Register addr, | 53 Register addr, |
| 54 Register scratch) { | 54 Register scratch) { |
| 55 if (FLAG_new_gc) return; |
| 56 |
| 55 if (FLAG_debug_code) { | 57 if (FLAG_debug_code) { |
| 56 // Check that the object is not in new space. | 58 // Check that the object is not in new space. |
| 57 Label not_in_new_space; | 59 Label not_in_new_space; |
| 58 InNewSpace(object, scratch, not_equal, ¬_in_new_space); | 60 InNewSpace(object, scratch, not_equal, ¬_in_new_space); |
| 59 Abort("new-space object passed to RecordWriteHelper"); | 61 Abort("new-space object passed to RecordWriteHelper"); |
| 60 bind(¬_in_new_space); | 62 bind(¬_in_new_space); |
| 61 } | 63 } |
| 62 | 64 |
| 63 // Compute the page start address from the heap object pointer, and reuse | 65 // Compute the page start address from the heap object pointer, and reuse |
| 64 // the 'object' register for it. | 66 // the 'object' register for it. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 95 and_(scratch, Heap::NewSpaceMask()); | 97 and_(scratch, Heap::NewSpaceMask()); |
| 96 j(cc, branch); | 98 j(cc, branch); |
| 97 } | 99 } |
| 98 } | 100 } |
| 99 | 101 |
| 100 | 102 |
| 101 void MacroAssembler::RecordWrite(Register object, | 103 void MacroAssembler::RecordWrite(Register object, |
| 102 int offset, | 104 int offset, |
| 103 Register value, | 105 Register value, |
| 104 Register scratch) { | 106 Register scratch) { |
| 107 if (FLAG_new_gc) return; |
| 108 |
| 105 // The compiled code assumes that record write doesn't change the | 109 // The compiled code assumes that record write doesn't change the |
| 106 // context register, so we check that none of the clobbered | 110 // context register, so we check that none of the clobbered |
| 107 // registers are esi. | 111 // registers are esi. |
| 108 ASSERT(!object.is(esi) && !value.is(esi) && !scratch.is(esi)); | 112 ASSERT(!object.is(esi) && !value.is(esi) && !scratch.is(esi)); |
| 109 | 113 |
| 110 // First, check if a write barrier is even needed. The tests below | 114 // First, check if a write barrier is even needed. The tests below |
| 111 // catch stores of Smis and stores into young gen. | 115 // catch stores of Smis and stores into young gen. |
| 112 Label done; | 116 Label done; |
| 113 | 117 |
| 114 // Skip barrier if writing a smi. | 118 // Skip barrier if writing a smi. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 mov(object, Immediate(BitCast<int32_t>(kZapValue))); | 150 mov(object, Immediate(BitCast<int32_t>(kZapValue))); |
| 147 mov(value, Immediate(BitCast<int32_t>(kZapValue))); | 151 mov(value, Immediate(BitCast<int32_t>(kZapValue))); |
| 148 mov(scratch, Immediate(BitCast<int32_t>(kZapValue))); | 152 mov(scratch, Immediate(BitCast<int32_t>(kZapValue))); |
| 149 } | 153 } |
| 150 } | 154 } |
| 151 | 155 |
| 152 | 156 |
| 153 void MacroAssembler::RecordWrite(Register object, | 157 void MacroAssembler::RecordWrite(Register object, |
| 154 Register address, | 158 Register address, |
| 155 Register value) { | 159 Register value) { |
| 160 if (FLAG_new_gc) return; |
| 161 |
| 156 // The compiled code assumes that record write doesn't change the | 162 // The compiled code assumes that record write doesn't change the |
| 157 // context register, so we check that none of the clobbered | 163 // context register, so we check that none of the clobbered |
| 158 // registers are esi. | 164 // registers are esi. |
| 159 ASSERT(!object.is(esi) && !value.is(esi) && !address.is(esi)); | 165 ASSERT(!object.is(esi) && !value.is(esi) && !address.is(esi)); |
| 160 | 166 |
| 161 // First, check if a write barrier is even needed. The tests below | 167 // First, check if a write barrier is even needed. The tests below |
| 162 // catch stores of Smis and stores into young gen. | 168 // catch stores of Smis and stores into young gen. |
| 163 Label done; | 169 Label done; |
| 164 | 170 |
| 165 // Skip barrier if writing a smi. | 171 // Skip barrier if writing a smi. |
| (...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1915 | 1921 |
| 1916 // Check that the code was patched as expected. | 1922 // Check that the code was patched as expected. |
| 1917 ASSERT(masm_.pc_ == address_ + size_); | 1923 ASSERT(masm_.pc_ == address_ + size_); |
| 1918 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1924 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 1919 } | 1925 } |
| 1920 | 1926 |
| 1921 | 1927 |
| 1922 } } // namespace v8::internal | 1928 } } // namespace v8::internal |
| 1923 | 1929 |
| 1924 #endif // V8_TARGET_ARCH_IA32 | 1930 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |