OLD | NEW |
1 | 1 |
2 // Copyright 2012 the V8 project authors. All rights reserved. | 2 // Copyright 2012 the V8 project authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include <limits.h> // For LONG_MIN, LONG_MAX. | 6 #include <limits.h> // For LONG_MIN, LONG_MAX. |
7 | 7 |
8 #if V8_TARGET_ARCH_MIPS | 8 #if V8_TARGET_ARCH_MIPS |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 5377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5388 lw(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); | 5388 lw(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); |
5389 And(scratch, scratch, Operand(mask)); | 5389 And(scratch, scratch, Operand(mask)); |
5390 Branch(condition_met, cc, scratch, Operand(zero_reg)); | 5390 Branch(condition_met, cc, scratch, Operand(zero_reg)); |
5391 } | 5391 } |
5392 | 5392 |
5393 | 5393 |
5394 void MacroAssembler::JumpIfBlack(Register object, | 5394 void MacroAssembler::JumpIfBlack(Register object, |
5395 Register scratch0, | 5395 Register scratch0, |
5396 Register scratch1, | 5396 Register scratch1, |
5397 Label* on_black) { | 5397 Label* on_black) { |
5398 HasColor(object, scratch0, scratch1, on_black, 1, 0); // kBlackBitPattern. | 5398 HasColor(object, scratch0, scratch1, on_black, 1, 1); // kBlackBitPattern. |
5399 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | 5399 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
5400 } | 5400 } |
5401 | 5401 |
5402 | 5402 |
5403 void MacroAssembler::HasColor(Register object, | 5403 void MacroAssembler::HasColor(Register object, |
5404 Register bitmap_scratch, | 5404 Register bitmap_scratch, |
5405 Register mask_scratch, | 5405 Register mask_scratch, |
5406 Label* has_color, | 5406 Label* has_color, |
5407 int first_bit, | 5407 int first_bit, |
5408 int second_bit) { | 5408 int second_bit) { |
5409 DCHECK(!AreAliased(object, bitmap_scratch, mask_scratch, t8)); | 5409 DCHECK(!AreAliased(object, bitmap_scratch, mask_scratch, t8)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5446 | 5446 |
5447 | 5447 |
5448 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, | 5448 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, |
5449 Register mask_scratch, Register load_scratch, | 5449 Register mask_scratch, Register load_scratch, |
5450 Label* value_is_white) { | 5450 Label* value_is_white) { |
5451 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, t8)); | 5451 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, t8)); |
5452 GetMarkBits(value, bitmap_scratch, mask_scratch); | 5452 GetMarkBits(value, bitmap_scratch, mask_scratch); |
5453 | 5453 |
5454 // If the value is black or grey we don't need to do anything. | 5454 // If the value is black or grey we don't need to do anything. |
5455 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); | 5455 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); |
5456 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | 5456 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
5457 DCHECK(strcmp(Marking::kGreyBitPattern, "11") == 0); | 5457 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0); |
5458 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); | 5458 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); |
5459 | 5459 |
5460 // Since both black and grey have a 1 in the first position and white does | 5460 // Since both black and grey have a 1 in the first position and white does |
5461 // not have a 1 there we only need to check one bit. | 5461 // not have a 1 there we only need to check one bit. |
5462 lw(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 5462 lw(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
5463 And(t8, mask_scratch, load_scratch); | 5463 And(t8, mask_scratch, load_scratch); |
5464 Branch(value_is_white, eq, t8, Operand(zero_reg)); | 5464 Branch(value_is_white, eq, t8, Operand(zero_reg)); |
5465 } | 5465 } |
5466 | 5466 |
5467 | 5467 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5753 if (mag.shift > 0) sra(result, result, mag.shift); | 5753 if (mag.shift > 0) sra(result, result, mag.shift); |
5754 srl(at, dividend, 31); | 5754 srl(at, dividend, 31); |
5755 Addu(result, result, Operand(at)); | 5755 Addu(result, result, Operand(at)); |
5756 } | 5756 } |
5757 | 5757 |
5758 | 5758 |
5759 } // namespace internal | 5759 } // namespace internal |
5760 } // namespace v8 | 5760 } // namespace v8 |
5761 | 5761 |
5762 #endif // V8_TARGET_ARCH_MIPS | 5762 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |