| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3136 ASSERT(strcmp(Marking::kBlackBitPattern, "10") == 0); | 3136 ASSERT(strcmp(Marking::kBlackBitPattern, "10") == 0); |
| 3137 } | 3137 } |
| 3138 | 3138 |
| 3139 | 3139 |
| 3140 void MacroAssembler::HasColor(Register object, | 3140 void MacroAssembler::HasColor(Register object, |
| 3141 Register bitmap_scratch, | 3141 Register bitmap_scratch, |
| 3142 Register mask_scratch, | 3142 Register mask_scratch, |
| 3143 Label* has_color, | 3143 Label* has_color, |
| 3144 int first_bit, | 3144 int first_bit, |
| 3145 int second_bit) { | 3145 int second_bit) { |
| 3146 ASSERT(!Aliasing(object, bitmap_scratch, mask_scratch, no_reg)); | 3146 ASSERT(!AreAliased(object, bitmap_scratch, mask_scratch, no_reg)); |
| 3147 | 3147 |
| 3148 GetMarkBits(object, bitmap_scratch, mask_scratch); | 3148 GetMarkBits(object, bitmap_scratch, mask_scratch); |
| 3149 | 3149 |
| 3150 Label other_color, word_boundary; | 3150 Label other_color, word_boundary; |
| 3151 ldr(ip, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); | 3151 ldr(ip, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); |
| 3152 tst(ip, Operand(mask_scratch)); | 3152 tst(ip, Operand(mask_scratch)); |
| 3153 b(first_bit == 1 ? eq : ne, &other_color); | 3153 b(first_bit == 1 ? eq : ne, &other_color); |
| 3154 // Shift left 1 by adding. | 3154 // Shift left 1 by adding. |
| 3155 add(mask_scratch, mask_scratch, Operand(mask_scratch), SetCC); | 3155 add(mask_scratch, mask_scratch, Operand(mask_scratch), SetCC); |
| 3156 b(eq, &word_boundary); | 3156 b(eq, &word_boundary); |
| 3157 tst(ip, Operand(mask_scratch)); | 3157 tst(ip, Operand(mask_scratch)); |
| 3158 b(second_bit == 1 ? ne : eq, has_color); | 3158 b(second_bit == 1 ? ne : eq, has_color); |
| 3159 jmp(&other_color); | 3159 jmp(&other_color); |
| 3160 | 3160 |
| 3161 bind(&word_boundary); | 3161 bind(&word_boundary); |
| 3162 ldr(ip, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize + kPointerSize)); | 3162 ldr(ip, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize + kPointerSize)); |
| 3163 tst(ip, Operand(1)); | 3163 tst(ip, Operand(1)); |
| 3164 b(second_bit == 1 ? ne : eq, has_color); | 3164 b(second_bit == 1 ? ne : eq, has_color); |
| 3165 bind(&other_color); | 3165 bind(&other_color); |
| 3166 } | 3166 } |
| 3167 | 3167 |
| 3168 | 3168 |
| 3169 void MacroAssembler::GetMarkBits(Register addr_reg, | 3169 void MacroAssembler::GetMarkBits(Register addr_reg, |
| 3170 Register bitmap_reg, | 3170 Register bitmap_reg, |
| 3171 Register mask_reg) { | 3171 Register mask_reg) { |
| 3172 ASSERT(!Aliasing(addr_reg, bitmap_reg, mask_reg, no_reg)); | 3172 ASSERT(!AreAliased(addr_reg, bitmap_reg, mask_reg, no_reg)); |
| 3173 and_(bitmap_reg, addr_reg, Operand(~Page::kPageAlignmentMask)); | 3173 and_(bitmap_reg, addr_reg, Operand(~Page::kPageAlignmentMask)); |
| 3174 Ubfx(mask_reg, addr_reg, kPointerSizeLog2, Bitmap::kBitsPerCellLog2); | 3174 Ubfx(mask_reg, addr_reg, kPointerSizeLog2, Bitmap::kBitsPerCellLog2); |
| 3175 const int kLowBits = kPointerSizeLog2 + Bitmap::kBitsPerCellLog2; | 3175 const int kLowBits = kPointerSizeLog2 + Bitmap::kBitsPerCellLog2; |
| 3176 Ubfx(ip, addr_reg, kLowBits, kPageSizeBits - kLowBits); | 3176 Ubfx(ip, addr_reg, kLowBits, kPageSizeBits - kLowBits); |
| 3177 add(bitmap_reg, bitmap_reg, Operand(ip, LSL, kPointerSizeLog2)); | 3177 add(bitmap_reg, bitmap_reg, Operand(ip, LSL, kPointerSizeLog2)); |
| 3178 mov(ip, Operand(1)); | 3178 mov(ip, Operand(1)); |
| 3179 mov(mask_reg, Operand(ip, LSL, mask_reg)); | 3179 mov(mask_reg, Operand(ip, LSL, mask_reg)); |
| 3180 } | 3180 } |
| 3181 | 3181 |
| 3182 | 3182 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3222 Register descriptors) { | 3222 Register descriptors) { |
| 3223 ldr(descriptors, | 3223 ldr(descriptors, |
| 3224 FieldMemOperand(map, Map::kInstanceDescriptorsOrBitField3Offset)); | 3224 FieldMemOperand(map, Map::kInstanceDescriptorsOrBitField3Offset)); |
| 3225 Label not_smi; | 3225 Label not_smi; |
| 3226 JumpIfNotSmi(descriptors, ¬_smi); | 3226 JumpIfNotSmi(descriptors, ¬_smi); |
| 3227 mov(descriptors, Operand(FACTORY->empty_descriptor_array())); | 3227 mov(descriptors, Operand(FACTORY->empty_descriptor_array())); |
| 3228 bind(¬_smi); | 3228 bind(¬_smi); |
| 3229 } | 3229 } |
| 3230 | 3230 |
| 3231 | 3231 |
| 3232 bool Aliasing(Register r1, Register r2, Register r3, Register r4) { | 3232 bool AreAliased(Register r1, Register r2, Register r3, Register r4) { |
| 3233 if (r1.is(r2)) return true; | 3233 if (r1.is(r2)) return true; |
| 3234 if (r1.is(r3)) return true; | 3234 if (r1.is(r3)) return true; |
| 3235 if (r1.is(r4)) return true; | 3235 if (r1.is(r4)) return true; |
| 3236 if (r2.is(r3)) return true; | 3236 if (r2.is(r3)) return true; |
| 3237 if (r2.is(r4)) return true; | 3237 if (r2.is(r4)) return true; |
| 3238 if (r3.is(r4)) return true; | 3238 if (r3.is(r4)) return true; |
| 3239 return false; | 3239 return false; |
| 3240 } | 3240 } |
| 3241 | 3241 |
| 3242 | 3242 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3275 void CodePatcher::EmitCondition(Condition cond) { | 3275 void CodePatcher::EmitCondition(Condition cond) { |
| 3276 Instr instr = Assembler::instr_at(masm_.pc_); | 3276 Instr instr = Assembler::instr_at(masm_.pc_); |
| 3277 instr = (instr & ~kCondMask) | cond; | 3277 instr = (instr & ~kCondMask) | cond; |
| 3278 masm_.emit(instr); | 3278 masm_.emit(instr); |
| 3279 } | 3279 } |
| 3280 | 3280 |
| 3281 | 3281 |
| 3282 } } // namespace v8::internal | 3282 } } // namespace v8::internal |
| 3283 | 3283 |
| 3284 #endif // V8_TARGET_ARCH_ARM | 3284 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |