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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 // Set dirty mark for region. | 72 // Set dirty mark for region. |
73 bts(Operand(object, Page::kDirtyFlagOffset), addr); | 73 bts(Operand(object, Page::kDirtyFlagOffset), addr); |
74 } | 74 } |
75 | 75 |
76 | 76 |
77 void MacroAssembler::RecordWrite(Register object, | 77 void MacroAssembler::RecordWrite(Register object, |
78 int offset, | 78 int offset, |
79 Register value, | 79 Register value, |
80 Register scratch) { | 80 Register scratch) { |
81 // The compiled code assumes that record write doesn't change the | |
82 // context register, so we check that none of the clobbered | |
83 // registers are esi. | |
84 ASSERT(!object.is(esi) && !value.is(esi) && !scratch.is(esi)); | |
85 | |
86 // First, check if a write barrier is even needed. The tests below | 81 // First, check if a write barrier is even needed. The tests below |
87 // catch stores of Smis and stores into young gen. | 82 // catch stores of Smis and stores into young gen. |
88 NearLabel done; | 83 NearLabel done; |
89 | 84 |
90 // Skip barrier if writing a smi. | 85 // Skip barrier if writing a smi. |
91 ASSERT_EQ(0, kSmiTag); | 86 ASSERT_EQ(0, kSmiTag); |
92 test(value, Immediate(kSmiTagMask)); | 87 test(value, Immediate(kSmiTagMask)); |
93 j(zero, &done); | 88 j(zero, &done); |
94 | 89 |
95 InNewSpace(object, value, equal, &done); | 90 InNewSpace(object, value, equal, &done); |
(...skipping 26 matching lines...) Expand all Loading... |
122 mov(object, Immediate(BitCast<int32_t>(kZapValue))); | 117 mov(object, Immediate(BitCast<int32_t>(kZapValue))); |
123 mov(value, Immediate(BitCast<int32_t>(kZapValue))); | 118 mov(value, Immediate(BitCast<int32_t>(kZapValue))); |
124 mov(scratch, Immediate(BitCast<int32_t>(kZapValue))); | 119 mov(scratch, Immediate(BitCast<int32_t>(kZapValue))); |
125 } | 120 } |
126 } | 121 } |
127 | 122 |
128 | 123 |
129 void MacroAssembler::RecordWrite(Register object, | 124 void MacroAssembler::RecordWrite(Register object, |
130 Register address, | 125 Register address, |
131 Register value) { | 126 Register value) { |
132 // The compiled code assumes that record write doesn't change the | |
133 // context register, so we check that none of the clobbered | |
134 // registers are esi. | |
135 ASSERT(!object.is(esi) && !value.is(esi) && !address.is(esi)); | |
136 | |
137 // First, check if a write barrier is even needed. The tests below | 127 // First, check if a write barrier is even needed. The tests below |
138 // catch stores of Smis and stores into young gen. | 128 // catch stores of Smis and stores into young gen. |
139 Label done; | 129 Label done; |
140 | 130 |
141 // Skip barrier if writing a smi. | 131 // Skip barrier if writing a smi. |
142 ASSERT_EQ(0, kSmiTag); | 132 ASSERT_EQ(0, kSmiTag); |
143 test(value, Immediate(kSmiTagMask)); | 133 test(value, Immediate(kSmiTagMask)); |
144 j(zero, &done); | 134 j(zero, &done); |
145 | 135 |
146 InNewSpace(object, value, equal, &done); | 136 InNewSpace(object, value, equal, &done); |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1899 | 1889 |
1900 // Check that the code was patched as expected. | 1890 // Check that the code was patched as expected. |
1901 ASSERT(masm_.pc_ == address_ + size_); | 1891 ASSERT(masm_.pc_ == address_ + size_); |
1902 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1892 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1903 } | 1893 } |
1904 | 1894 |
1905 | 1895 |
1906 } } // namespace v8::internal | 1896 } } // namespace v8::internal |
1907 | 1897 |
1908 #endif // V8_TARGET_ARCH_IA32 | 1898 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |