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

Side by Side Diff: src/heap/marking.h

Issue 2147693004: [heap] ObjectStats: Fix accounting for fixed array subtypes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More fixed array types Created 4 years, 5 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/heap/mark-compact.cc ('k') | src/heap/object-stats.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #ifndef V8_MARKING_H 5 #ifndef V8_MARKING_H
6 #define V8_MARKING_H 6 #define V8_MARKING_H
7 7
8 #include "src/utils.h" 8 #include "src/utils.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 INLINE(static void GreyToBlack(MarkBit markbit)) { 266 INLINE(static void GreyToBlack(MarkBit markbit)) {
267 DCHECK(IsGrey(markbit)); 267 DCHECK(IsGrey(markbit));
268 markbit.Next().Set(); 268 markbit.Next().Set();
269 } 269 }
270 270
271 INLINE(static void AnyToGrey(MarkBit markbit)) { 271 INLINE(static void AnyToGrey(MarkBit markbit)) {
272 markbit.Set(); 272 markbit.Set();
273 markbit.Next().Clear(); 273 markbit.Next().Clear();
274 } 274 }
275 275
276 #ifdef DEBUG
277 enum ObjectColor { 276 enum ObjectColor {
278 BLACK_OBJECT, 277 BLACK_OBJECT,
279 WHITE_OBJECT, 278 WHITE_OBJECT,
280 GREY_OBJECT, 279 GREY_OBJECT,
281 IMPOSSIBLE_COLOR 280 IMPOSSIBLE_COLOR
282 }; 281 };
283 282
284 static const char* ColorName(ObjectColor color) { 283 static const char* ColorName(ObjectColor color) {
285 switch (color) { 284 switch (color) {
286 case BLACK_OBJECT: 285 case BLACK_OBJECT:
287 return "black"; 286 return "black";
288 case WHITE_OBJECT: 287 case WHITE_OBJECT:
289 return "white"; 288 return "white";
290 case GREY_OBJECT: 289 case GREY_OBJECT:
291 return "grey"; 290 return "grey";
292 case IMPOSSIBLE_COLOR: 291 case IMPOSSIBLE_COLOR:
293 return "impossible"; 292 return "impossible";
294 } 293 }
295 return "error"; 294 return "error";
296 } 295 }
297 296
298 static ObjectColor Color(MarkBit mark_bit) { 297 static ObjectColor Color(MarkBit mark_bit) {
299 if (IsBlack(mark_bit)) return BLACK_OBJECT; 298 if (IsBlack(mark_bit)) return BLACK_OBJECT;
300 if (IsWhite(mark_bit)) return WHITE_OBJECT; 299 if (IsWhite(mark_bit)) return WHITE_OBJECT;
301 if (IsGrey(mark_bit)) return GREY_OBJECT; 300 if (IsGrey(mark_bit)) return GREY_OBJECT;
302 UNREACHABLE(); 301 UNREACHABLE();
303 return IMPOSSIBLE_COLOR; 302 return IMPOSSIBLE_COLOR;
304 } 303 }
305 #endif
306 304
307 private: 305 private:
308 DISALLOW_IMPLICIT_CONSTRUCTORS(Marking); 306 DISALLOW_IMPLICIT_CONSTRUCTORS(Marking);
309 }; 307 };
310 308
311 } // namespace internal 309 } // namespace internal
312 } // namespace v8 310 } // namespace v8
313 311
314 #endif // V8_MARKING_H_ 312 #endif // V8_MARKING_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/object-stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698