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

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

Issue 1179763005: Oilpan: Fix compile of GC_PROFILING build, and remove object graph dumper. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add EagerSweepHeap. Created 5 years, 6 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 | « Source/platform/heap/Heap.cpp ('k') | 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 unsigned hash() { return IntHash<int>::hash(m_x); } 70 unsigned hash() { return IntHash<int>::hash(m_x); }
71 71
72 IntWrapper(int x) : m_x(x) { } 72 IntWrapper(int x) : m_x(x) { }
73 73
74 private: 74 private:
75 IntWrapper(); 75 IntWrapper();
76 int m_x; 76 int m_x;
77 }; 77 };
78 static_assert(WTF::NeedsTracing<IntWrapper>::value, "NeedsTracing macro failed t o recognize trace method."); 78 static_assert(WTF::NeedsTracing<IntWrapper>::value, "NeedsTracing macro failed t o recognize trace method.");
79 79
80 #if !ENABLE(GC_PROFILING)
80 struct SameSizeAsPersistent { 81 struct SameSizeAsPersistent {
81 void* m_pointer[4]; 82 void* m_pointer[4];
82 }; 83 };
83 84
84 static_assert(sizeof(Persistent<IntWrapper>) <= sizeof(SameSizeAsPersistent), "P ersistent handle should stay small"); 85 static_assert(sizeof(Persistent<IntWrapper>) <= sizeof(SameSizeAsPersistent), "P ersistent handle should stay small");
86 #endif
85 87
86 class ThreadMarker { 88 class ThreadMarker {
87 public: 89 public:
88 ThreadMarker() : m_creatingThread(reinterpret_cast<ThreadState*>(0)), m_num( 0) { } 90 ThreadMarker() : m_creatingThread(reinterpret_cast<ThreadState*>(0)), m_num( 0) { }
89 ThreadMarker(unsigned i) : m_creatingThread(ThreadState::current()), m_num(i ) { } 91 ThreadMarker(unsigned i) : m_creatingThread(ThreadState::current()), m_num(i ) { }
90 ThreadMarker(WTF::HashTableDeletedValueType deleted) : m_creatingThread(rein terpret_cast<ThreadState*>(-1)), m_num(0) { } 92 ThreadMarker(WTF::HashTableDeletedValueType deleted) : m_creatingThread(rein terpret_cast<ThreadState*>(-1)), m_num(0) { }
91 ~ThreadMarker() 93 ~ThreadMarker()
92 { 94 {
93 EXPECT_TRUE((m_creatingThread == ThreadState::current()) 95 EXPECT_TRUE((m_creatingThread == ThreadState::current())
94 || (m_creatingThread == reinterpret_cast<ThreadState*>(0)) 96 || (m_creatingThread == reinterpret_cast<ThreadState*>(0))
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 m_count++; 294 m_count++;
293 } 295 }
294 296
295 virtual void registerDelayedMarkNoTracing(const void*) override { } 297 virtual void registerDelayedMarkNoTracing(const void*) override { }
296 virtual void registerWeakMembers(const void*, const void*, WeakCallback) ove rride { } 298 virtual void registerWeakMembers(const void*, const void*, WeakCallback) ove rride { }
297 virtual void registerWeakTable(const void*, EphemeronCallback, EphemeronCall back) override { } 299 virtual void registerWeakTable(const void*, EphemeronCallback, EphemeronCall back) override { }
298 #if ENABLE(ASSERT) 300 #if ENABLE(ASSERT)
299 virtual bool weakTableRegistered(const void*) override { return false; } 301 virtual bool weakTableRegistered(const void*) override { return false; }
300 #endif 302 #endif
301 virtual void registerWeakCellWithCallback(void**, WeakCallback) override { } 303 virtual void registerWeakCellWithCallback(void**, WeakCallback) override { }
302 #if ENABLE(GC_PROFILING)
303 virtual void recordObjectGraphEdge(const void*) override { }
304 #endif
305 virtual bool ensureMarked(const void* objectPointer) override 304 virtual bool ensureMarked(const void* objectPointer) override
306 { 305 {
307 if (!objectPointer || HeapObjectHeader::fromPayload(objectPointer)->isMa rked()) 306 if (!objectPointer || HeapObjectHeader::fromPayload(objectPointer)->isMa rked())
308 return false; 307 return false;
309 markNoTracing(objectPointer); 308 markNoTracing(objectPointer);
310 return true; 309 return true;
311 } 310 }
312 311
313 size_t count() { return m_count; } 312 size_t count() { return m_count; }
314 void reset() { m_count = 0; } 313 void reset() { m_count = 0; }
(...skipping 5810 matching lines...) Expand 10 before | Expand all | Expand 10 after
6125 { 6124 {
6126 Persistent<ClassWithMember> object = ClassWithMember::create(); 6125 Persistent<ClassWithMember> object = ClassWithMember::create();
6127 EXPECT_EQ(0, object->traceCount()); 6126 EXPECT_EQ(0, object->traceCount());
6128 TestMixinAllocatingObject* mixin = TestMixinAllocatingObject::create(object. get()); 6127 TestMixinAllocatingObject* mixin = TestMixinAllocatingObject::create(object. get());
6129 EXPECT_TRUE(mixin); 6128 EXPECT_TRUE(mixin);
6130 EXPECT_GT(object->traceCount(), 0); 6129 EXPECT_GT(object->traceCount(), 0);
6131 EXPECT_GT(mixin->traceCount(), 0); 6130 EXPECT_GT(mixin->traceCount(), 0);
6132 } 6131 }
6133 6132
6134 } // namespace blink 6133 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/heap/Heap.cpp ('k') | Source/platform/heap/InlinedGlobalMarkingVisitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698