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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 | 158 |
159 for (int i = kNumberOfSavedRegs - 1; i >= 0; i--) { | 159 for (int i = kNumberOfSavedRegs - 1; i >= 0; i--) { |
160 Register reg = saved_regs[i]; | 160 Register reg = saved_regs[i]; |
161 if (!reg.is(exclusion1) && !reg.is(exclusion2) && !reg.is(exclusion3)) { | 161 if (!reg.is(exclusion1) && !reg.is(exclusion2) && !reg.is(exclusion3)) { |
162 pop(reg); | 162 pop(reg); |
163 } | 163 } |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 void MacroAssembler::InNewSpace( | 167 void MacroAssembler::InNewSpace(Register object, Register scratch, Condition cc, |
168 Register object, | 168 Label* condition_met, |
169 Register scratch, | 169 Label::Distance distance) { |
170 Condition cc, | 170 const int mask = |
171 Label* condition_met, | 171 (1 << MemoryChunk::IN_FROM_SPACE) | (1 << MemoryChunk::IN_TO_SPACE); |
172 Label::Distance condition_met_distance) { | 172 CheckPageFlag(object, scratch, mask, cc, condition_met, distance); |
173 DCHECK(cc == equal || cc == not_equal); | |
174 if (scratch.is(object)) { | |
175 and_(scratch, Immediate(~Page::kPageAlignmentMask)); | |
176 } else { | |
177 mov(scratch, Immediate(~Page::kPageAlignmentMask)); | |
178 and_(scratch, object); | |
179 } | |
180 // Check that we can use a test_b. | |
181 DCHECK(MemoryChunk::IN_FROM_SPACE < 8); | |
182 DCHECK(MemoryChunk::IN_TO_SPACE < 8); | |
183 int mask = (1 << MemoryChunk::IN_FROM_SPACE) | |
184 | (1 << MemoryChunk::IN_TO_SPACE); | |
185 // If non-zero, the page belongs to new-space. | |
186 test_b(Operand(scratch, MemoryChunk::kFlagsOffset), | |
187 static_cast<uint8_t>(mask)); | |
188 j(cc, condition_met, condition_met_distance); | |
189 } | 173 } |
190 | 174 |
191 | 175 |
192 void MacroAssembler::RememberedSetHelper( | 176 void MacroAssembler::RememberedSetHelper( |
193 Register object, // Only used for debug checks. | 177 Register object, // Only used for debug checks. |
194 Register addr, Register scratch, SaveFPRegsMode save_fp, | 178 Register addr, Register scratch, SaveFPRegsMode save_fp, |
195 MacroAssembler::RememberedSetFinalAction and_then) { | 179 MacroAssembler::RememberedSetFinalAction and_then) { |
196 Label done; | 180 Label done; |
197 if (emit_debug_code()) { | 181 if (emit_debug_code()) { |
198 Label ok; | 182 Label ok; |
(...skipping 2881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3080 mov(eax, dividend); | 3064 mov(eax, dividend); |
3081 shr(eax, 31); | 3065 shr(eax, 31); |
3082 add(edx, eax); | 3066 add(edx, eax); |
3083 } | 3067 } |
3084 | 3068 |
3085 | 3069 |
3086 } // namespace internal | 3070 } // namespace internal |
3087 } // namespace v8 | 3071 } // namespace v8 |
3088 | 3072 |
3089 #endif // V8_TARGET_ARCH_X87 | 3073 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |