| 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 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
| (...skipping 3230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3241 ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); | 3241 ldr(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); |
| 3242 tst(scratch, Operand(mask)); | 3242 tst(scratch, Operand(mask)); |
| 3243 b(cc, condition_met); | 3243 b(cc, condition_met); |
| 3244 } | 3244 } |
| 3245 | 3245 |
| 3246 | 3246 |
| 3247 void MacroAssembler::JumpIfBlack(Register object, | 3247 void MacroAssembler::JumpIfBlack(Register object, |
| 3248 Register scratch0, | 3248 Register scratch0, |
| 3249 Register scratch1, | 3249 Register scratch1, |
| 3250 Label* on_black) { | 3250 Label* on_black) { |
| 3251 HasColor(object, scratch0, scratch1, on_black, 1, 0); // kBlackBitPattern. | 3251 HasColor(object, scratch0, scratch1, on_black, 1, 1); // kBlackBitPattern. |
| 3252 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | 3252 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
| 3253 } | 3253 } |
| 3254 | 3254 |
| 3255 | 3255 |
| 3256 void MacroAssembler::HasColor(Register object, | 3256 void MacroAssembler::HasColor(Register object, |
| 3257 Register bitmap_scratch, | 3257 Register bitmap_scratch, |
| 3258 Register mask_scratch, | 3258 Register mask_scratch, |
| 3259 Label* has_color, | 3259 Label* has_color, |
| 3260 int first_bit, | 3260 int first_bit, |
| 3261 int second_bit) { | 3261 int second_bit) { |
| 3262 DCHECK(!AreAliased(object, bitmap_scratch, mask_scratch, no_reg)); | 3262 DCHECK(!AreAliased(object, bitmap_scratch, mask_scratch, no_reg)); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3297 | 3297 |
| 3298 | 3298 |
| 3299 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, | 3299 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, |
| 3300 Register mask_scratch, Register load_scratch, | 3300 Register mask_scratch, Register load_scratch, |
| 3301 Label* value_is_white) { | 3301 Label* value_is_white) { |
| 3302 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, ip)); | 3302 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, ip)); |
| 3303 GetMarkBits(value, bitmap_scratch, mask_scratch); | 3303 GetMarkBits(value, bitmap_scratch, mask_scratch); |
| 3304 | 3304 |
| 3305 // If the value is black or grey we don't need to do anything. | 3305 // If the value is black or grey we don't need to do anything. |
| 3306 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); | 3306 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); |
| 3307 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | 3307 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
| 3308 DCHECK(strcmp(Marking::kGreyBitPattern, "11") == 0); | 3308 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0); |
| 3309 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); | 3309 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); |
| 3310 | 3310 |
| 3311 // Since both black and grey have a 1 in the first position and white does | 3311 // Since both black and grey have a 1 in the first position and white does |
| 3312 // not have a 1 there we only need to check one bit. | 3312 // not have a 1 there we only need to check one bit. |
| 3313 ldr(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 3313 ldr(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
| 3314 tst(mask_scratch, load_scratch); | 3314 tst(mask_scratch, load_scratch); |
| 3315 b(eq, value_is_white); | 3315 b(eq, value_is_white); |
| 3316 } | 3316 } |
| 3317 | 3317 |
| 3318 | 3318 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3595 } | 3595 } |
| 3596 } | 3596 } |
| 3597 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3597 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
| 3598 add(result, result, Operand(dividend, LSR, 31)); | 3598 add(result, result, Operand(dividend, LSR, 31)); |
| 3599 } | 3599 } |
| 3600 | 3600 |
| 3601 } // namespace internal | 3601 } // namespace internal |
| 3602 } // namespace v8 | 3602 } // namespace v8 |
| 3603 | 3603 |
| 3604 #endif // V8_TARGET_ARCH_ARM | 3604 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |