OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 152 matching lines...) Loading... |
163 } | 163 } |
164 | 164 |
165 for (int i = kNumberOfSavedRegs - 1; i >= 0; i--) { | 165 for (int i = kNumberOfSavedRegs - 1; i >= 0; i--) { |
166 Register reg = saved_regs[i]; | 166 Register reg = saved_regs[i]; |
167 if (!reg.is(exclusion1) && !reg.is(exclusion2) && !reg.is(exclusion3)) { | 167 if (!reg.is(exclusion1) && !reg.is(exclusion2) && !reg.is(exclusion3)) { |
168 pop(reg); | 168 pop(reg); |
169 } | 169 } |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 void MacroAssembler::InNewSpace( | 173 void MacroAssembler::InNewSpace(Register object, Register scratch, Condition cc, |
174 Register object, | 174 Label* condition_met, |
175 Register scratch, | 175 Label::Distance distance) { |
176 Condition cc, | 176 const int mask = |
177 Label* condition_met, | 177 (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE); |
178 Label::Distance condition_met_distance) { | 178 CheckPageFlag(object, scratch, mask, cc, condition_met, distance); |
179 DCHECK(cc == equal || cc == not_equal); | |
180 if (scratch.is(object)) { | |
181 and_(scratch, Immediate(~Page::kPageAlignmentMask)); | |
182 } else { | |
183 mov(scratch, Immediate(~Page::kPageAlignmentMask)); | |
184 and_(scratch, object); | |
185 } | |
186 // Check that we can use a test_b. | |
187 DCHECK(MemoryChunk::IN_FROM_SPACE < 8); | |
188 DCHECK(MemoryChunk::IN_TO_SPACE < 8); | |
189 int mask = (1 << MemoryChunk::IN_FROM_SPACE) | |
190 | (1 << MemoryChunk::IN_TO_SPACE); | |
191 // If non-zero, the page belongs to new-space. | |
192 test_b(Operand(scratch, MemoryChunk::kFlagsOffset), | |
193 static_cast<uint8_t>(mask)); | |
194 j(cc, condition_met, condition_met_distance); | |
195 } | 179 } |
196 | 180 |
197 | 181 |
198 void MacroAssembler::RememberedSetHelper( | 182 void MacroAssembler::RememberedSetHelper( |
199 Register object, // Only used for debug checks. | 183 Register object, // Only used for debug checks. |
200 Register addr, | 184 Register addr, |
201 Register scratch, | 185 Register scratch, |
202 SaveFPRegsMode save_fp, | 186 SaveFPRegsMode save_fp, |
203 MacroAssembler::RememberedSetFinalAction and_then) { | 187 MacroAssembler::RememberedSetFinalAction and_then) { |
204 Label done; | 188 Label done; |
(...skipping 3009 matching lines...) Loading... |
3214 mov(eax, dividend); | 3198 mov(eax, dividend); |
3215 shr(eax, 31); | 3199 shr(eax, 31); |
3216 add(edx, eax); | 3200 add(edx, eax); |
3217 } | 3201 } |
3218 | 3202 |
3219 | 3203 |
3220 } // namespace internal | 3204 } // namespace internal |
3221 } // namespace v8 | 3205 } // namespace v8 |
3222 | 3206 |
3223 #endif // V8_TARGET_ARCH_IA32 | 3207 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |