Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: src/arm64/macro-assembler-arm64.cc

Issue 1517993003: [heap] Black is encoded with 11, grey with 10. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 4158 matching lines...) Expand 10 before | Expand all | Expand 10 after
4169 GetMarkBits(object, bitmap_scratch, shift_scratch); 4169 GetMarkBits(object, bitmap_scratch, shift_scratch);
4170 Ldr(bitmap_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); 4170 Ldr(bitmap_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize));
4171 // Shift the bitmap down to get the color of the object in bits [1:0]. 4171 // Shift the bitmap down to get the color of the object in bits [1:0].
4172 Lsr(bitmap_scratch, bitmap_scratch, shift_scratch); 4172 Lsr(bitmap_scratch, bitmap_scratch, shift_scratch);
4173 4173
4174 AssertHasValidColor(bitmap_scratch); 4174 AssertHasValidColor(bitmap_scratch);
4175 4175
4176 // These bit sequences are backwards. The first character in the string 4176 // These bit sequences are backwards. The first character in the string
4177 // represents the least significant bit. 4177 // represents the least significant bit.
4178 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); 4178 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0);
4179 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); 4179 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0);
4180 DCHECK(strcmp(Marking::kGreyBitPattern, "11") == 0); 4180 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0);
4181 4181
4182 // Check for the color. 4182 // Check for the color.
4183 if (first_bit == 0) { 4183 if (first_bit == 0) {
4184 // Checking for white. 4184 // Checking for white.
4185 DCHECK(second_bit == 0); 4185 DCHECK(second_bit == 0);
4186 // We only need to test the first bit. 4186 // We only need to test the first bit.
4187 Tbz(bitmap_scratch, 0, has_color); 4187 Tbz(bitmap_scratch, 0, has_color);
4188 } else { 4188 } else {
4189 Label other_color; 4189 Label other_color;
4190 // Checking for grey or black. 4190 // Checking for grey or black.
4191 Tbz(bitmap_scratch, 0, &other_color); 4191 Tbz(bitmap_scratch, 0, &other_color);
4192 if (second_bit == 0) { 4192 if (second_bit == 0) {
4193 Tbz(bitmap_scratch, 1, has_color); 4193 Tbz(bitmap_scratch, 1, has_color);
4194 } else { 4194 } else {
4195 Tbnz(bitmap_scratch, 1, has_color); 4195 Tbnz(bitmap_scratch, 1, has_color);
4196 } 4196 }
4197 Bind(&other_color); 4197 Bind(&other_color);
4198 } 4198 }
4199 4199
4200 // Fall through if it does not have the right color. 4200 // Fall through if it does not have the right color.
4201 } 4201 }
4202 4202
4203 4203
4204 void MacroAssembler::JumpIfBlack(Register object, 4204 void MacroAssembler::JumpIfBlack(Register object,
4205 Register scratch0, 4205 Register scratch0,
4206 Register scratch1, 4206 Register scratch1,
4207 Label* on_black) { 4207 Label* on_black) {
4208 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); 4208 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0);
4209 HasColor(object, scratch0, scratch1, on_black, 1, 0); // kBlackBitPattern. 4209 HasColor(object, scratch0, scratch1, on_black, 1, 1); // kBlackBitPattern.
4210 } 4210 }
4211 4211
4212 4212
4213 void MacroAssembler::JumpIfDictionaryInPrototypeChain( 4213 void MacroAssembler::JumpIfDictionaryInPrototypeChain(
4214 Register object, 4214 Register object,
4215 Register scratch0, 4215 Register scratch0,
4216 Register scratch1, 4216 Register scratch1,
4217 Label* found) { 4217 Label* found) {
4218 DCHECK(!AreAliased(object, scratch0, scratch1)); 4218 DCHECK(!AreAliased(object, scratch0, scratch1));
4219 Register current = scratch0; 4219 Register current = scratch0;
(...skipping 25 matching lines...) Expand all
4245 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch, 4245 void MacroAssembler::JumpIfWhite(Register value, Register bitmap_scratch,
4246 Register shift_scratch, Register load_scratch, 4246 Register shift_scratch, Register load_scratch,
4247 Register length_scratch, 4247 Register length_scratch,
4248 Label* value_is_white) { 4248 Label* value_is_white) {
4249 DCHECK(!AreAliased( 4249 DCHECK(!AreAliased(
4250 value, bitmap_scratch, shift_scratch, load_scratch, length_scratch)); 4250 value, bitmap_scratch, shift_scratch, load_scratch, length_scratch));
4251 4251
4252 // These bit sequences are backwards. The first character in the string 4252 // These bit sequences are backwards. The first character in the string
4253 // represents the least significant bit. 4253 // represents the least significant bit.
4254 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0); 4254 DCHECK(strcmp(Marking::kWhiteBitPattern, "00") == 0);
4255 DCHECK(strcmp(Marking::kBlackBitPattern, "10") == 0); 4255 DCHECK(strcmp(Marking::kBlackBitPattern, "11") == 0);
4256 DCHECK(strcmp(Marking::kGreyBitPattern, "11") == 0); 4256 DCHECK(strcmp(Marking::kGreyBitPattern, "10") == 0);
4257 4257
4258 GetMarkBits(value, bitmap_scratch, shift_scratch); 4258 GetMarkBits(value, bitmap_scratch, shift_scratch);
4259 Ldr(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize)); 4259 Ldr(load_scratch, MemOperand(bitmap_scratch, MemoryChunk::kHeaderSize));
4260 Lsr(load_scratch, load_scratch, shift_scratch); 4260 Lsr(load_scratch, load_scratch, shift_scratch);
4261 4261
4262 AssertHasValidColor(load_scratch); 4262 AssertHasValidColor(load_scratch);
4263 4263
4264 // If the value is black or grey we don't need to do anything. 4264 // If the value is black or grey we don't need to do anything.
4265 // Since both black and grey have a 1 in the first position and white does 4265 // Since both black and grey have a 1 in the first position and white does
4266 // not have a 1 there we only need to check one bit. 4266 // not have a 1 there we only need to check one bit.
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
4865 } 4865 }
4866 4866
4867 4867
4868 #undef __ 4868 #undef __
4869 4869
4870 4870
4871 } // namespace internal 4871 } // namespace internal
4872 } // namespace v8 4872 } // namespace v8
4873 4873
4874 #endif // V8_TARGET_ARCH_ARM64 4874 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698