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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 5972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5983 ld(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); | 5983 ld(scratch, MemOperand(scratch, MemoryChunk::kFlagsOffset)); |
5984 And(scratch, scratch, Operand(mask)); | 5984 And(scratch, scratch, Operand(mask)); |
5985 Branch(condition_met, cc, scratch, Operand(zero_reg)); | 5985 Branch(condition_met, cc, scratch, Operand(zero_reg)); |
5986 } | 5986 } |
5987 | 5987 |
5988 | 5988 |
5989 void MacroAssembler::JumpIfBlack(Register object, | 5989 void MacroAssembler::JumpIfBlack(Register object, |
5990 Register scratch0, | 5990 Register scratch0, |
5991 Register scratch1, | 5991 Register scratch1, |
5992 Label* on_black) { | 5992 Label* on_black) { |
5993 HasColor(object, scratch0, scratch1, on_black, 1, 0); // kBlackBitPattern. | 5993 HasColor(object, scratch0, scratch1, on_black, 1, 1); // kBlackBitPattern. |
5994 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | 5994 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
5995 } | 5995 } |
5996 | 5996 |
5997 | 5997 |
5998 void MacroAssembler::HasColor(Register object, | 5998 void MacroAssembler::HasColor(Register object, |
5999 Register bitmap_scratch, | 5999 Register bitmap_scratch, |
6000 Register mask_scratch, | 6000 Register mask_scratch, |
6001 Label* has_color, | 6001 Label* has_color, |
6002 int first_bit, | 6002 int first_bit, |
6003 int second_bit) { | 6003 int second_bit) { |
6004 DCHECK(!AreAliased(object, bitmap_scratch, mask_scratch, t8)); | 6004 DCHECK(!AreAliased(object, bitmap_scratch, mask_scratch, t8)); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6040 | 6040 |
6041 | 6041 |
6042 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, | 6042 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, |
6043 Register mask_scratch, Register load_scratch, | 6043 Register mask_scratch, Register load_scratch, |
6044 Label* value_is_white) { | 6044 Label* value_is_white) { |
6045 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, t8)); | 6045 DCHECK(!AreAliased(value, bitmap_scratch, mask_scratch, t8)); |
6046 GetMarkBits(value, bitmap_scratch, mask_scratch); | 6046 GetMarkBits(value, bitmap_scratch, mask_scratch); |
6047 | 6047 |
6048 // If the value is black or grey we don't need to do anything. | 6048 // If the value is black or grey we don't need to do anything. |
6049 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); | 6049 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); |
6050 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); | 6050 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0); |
6051 DCHECK(strcmp(Marking::kGreyBitPattern, "11") == 0); | 6051 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0); |
6052 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); | 6052 DCHECK(strcmp(Marking::kImpossibleBitPattern, "01") == 0); |
6053 | 6053 |
6054 // Since both black and grey have a 1 in the first position and white does | 6054 // Since both black and grey have a 1 in the first position and white does |
6055 // not have a 1 there we only need to check one bit. | 6055 // not have a 1 there we only need to check one bit. |
6056 // Note that we are using a 4-byte aligned 8-byte load. | 6056 // Note that we are using a 4-byte aligned 8-byte load. |
6057 if (emit_debug_code()) { | 6057 if (emit_debug_code()) { |
6058 LoadWordPair(load_scratch, | 6058 LoadWordPair(load_scratch, |
6059 MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 6059 MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
6060 } else { | 6060 } else { |
6061 lwu(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 6061 lwu(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6367 if (mag.shift > 0) sra(result, result, mag.shift); | 6367 if (mag.shift > 0) sra(result, result, mag.shift); |
6368 srl(at, dividend, 31); | 6368 srl(at, dividend, 31); |
6369 Addu(result, result, Operand(at)); | 6369 Addu(result, result, Operand(at)); |
6370 } | 6370 } |
6371 | 6371 |
6372 | 6372 |
6373 } // namespace internal | 6373 } // namespace internal |
6374 } // namespace v8 | 6374 } // namespace v8 |
6375 | 6375 |
6376 #endif // V8_TARGET_ARCH_MIPS64 | 6376 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |