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

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapTest.cpp

Issue 2625363002: Simplify visitor marking mode tracking. (Closed)
Patch Set: HeapTest compilation fix Created 3 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 | « no previous file | third_party/WebKit/Source/platform/heap/InlinedGlobalMarkingVisitor.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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 m_count++; \ 311 m_count++; \
312 } \ 312 } \
313 bool isMarked(const Type*) override { return false; } \ 313 bool isMarked(const Type*) override { return false; } \
314 bool ensureMarked(const Type* objectPointer) override { \ 314 bool ensureMarked(const Type* objectPointer) override { \
315 return ensureMarked(objectPointer); \ 315 return ensureMarked(objectPointer); \
316 } 316 }
317 317
318 class CountingVisitor : public Visitor { 318 class CountingVisitor : public Visitor {
319 public: 319 public:
320 explicit CountingVisitor(ThreadState* state) 320 explicit CountingVisitor(ThreadState* state)
321 : Visitor(state, Visitor::ThreadLocalMarking), 321 : Visitor(state, VisitorMarkingMode::ThreadLocalMarking),
322 m_scope(&state->heap().stackFrameDepth()), 322 m_scope(&state->heap().stackFrameDepth()),
323 m_count(0) {} 323 m_count(0) {}
324 324
325 void mark(const void* object, TraceCallback) override { 325 void mark(const void* object, TraceCallback) override {
326 if (object) 326 if (object)
327 m_count++; 327 m_count++;
328 } 328 }
329 329
330 void markHeader(HeapObjectHeader* header, TraceCallback callback) override { 330 void markHeader(HeapObjectHeader* header, TraceCallback callback) override {
331 ASSERT(header->payload()); 331 ASSERT(header->payload());
(...skipping 6235 matching lines...) Expand 10 before | Expand all | Expand 10 after
6567 "HeapVector"); 6567 "HeapVector");
6568 static_assert( 6568 static_assert(
6569 WTF::IsGarbageCollectedType<HeapDeque<Member<IntWrapper>>>::value, 6569 WTF::IsGarbageCollectedType<HeapDeque<Member<IntWrapper>>>::value,
6570 "HeapDeque"); 6570 "HeapDeque");
6571 static_assert(WTF::IsGarbageCollectedType< 6571 static_assert(WTF::IsGarbageCollectedType<
6572 HeapTerminatedArray<Member<IntWrapper>>>::value, 6572 HeapTerminatedArray<Member<IntWrapper>>>::value,
6573 "HeapTerminatedArray"); 6573 "HeapTerminatedArray");
6574 } 6574 }
6575 6575
6576 } // namespace blink 6576 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/InlinedGlobalMarkingVisitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698