Index: third_party/WebKit/Source/platform/heap/HeapTest.cpp |
diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp |
index 5570f70fb115788ddbc9fda0c0b7dc89217792d4..6016920bdd70b4cbfd46456bcf96833fb0837abd 100644 |
--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp |
+++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp |
@@ -332,7 +332,7 @@ class CountingVisitor : public Visitor { |
m_count++; |
} |
- void registerDelayedMarkNoTracing(const void*) override {} |
+ void registerDelayedMarkNoTracing(void**) override {} |
void registerWeakMembers(const void*, const void*, WeakCallback) override {} |
void registerWeakTable(const void*, |
EphemeronCallback, |
@@ -349,6 +349,12 @@ class CountingVisitor : public Visitor { |
return true; |
} |
+ void registerMovingObjectReference(MovableReference*) override {} |
+ |
+ void registerMovingObjectCallback(MovableReference, |
+ MovingObjectCallback, |
+ void*) override {} |
+ |
size_t count() { return m_count; } |
void reset() { m_count = 0; } |
@@ -3765,6 +3771,7 @@ TEST(HeapTest, RefCountedGarbageCollectedWithStackPointers) { |
pointer1 = object1.get(); |
pointer2 = object2.get(); |
void* objects[2] = {object1.get(), object2.get()}; |
+ ThreadState::GCForbiddenScope gcScope(ThreadState::current()); |
haraken
2016/12/09 07:25:56
Would you help me understand why these GCForbidden
sof
2016/12/09 21:44:04
As long as there's a DCHECK() in the Visitor const
haraken
2016/12/12 01:25:10
Makes sense. I'm wondering if we can/should unify
|
RefCountedGarbageCollectedVisitor visitor(ThreadState::current(), 2, |
objects); |
ThreadState::current()->visitPersistents(&visitor); |
@@ -3782,6 +3789,7 @@ TEST(HeapTest, RefCountedGarbageCollectedWithStackPointers) { |
// At this point, the reference counts of object1 and object2 are 0. |
// Only pointer1 and pointer2 keep references to object1 and object2. |
void* objects[] = {0}; |
+ ThreadState::GCForbiddenScope gcScope(ThreadState::current()); |
RefCountedGarbageCollectedVisitor visitor(ThreadState::current(), 0, |
objects); |
ThreadState::current()->visitPersistents(&visitor); |
@@ -3792,6 +3800,7 @@ TEST(HeapTest, RefCountedGarbageCollectedWithStackPointers) { |
Persistent<RefCountedAndGarbageCollected> object1(pointer1); |
Persistent<RefCountedAndGarbageCollected2> object2(pointer2); |
void* objects[2] = {object1.get(), object2.get()}; |
+ ThreadState::GCForbiddenScope gcScope(ThreadState::current()); |
RefCountedGarbageCollectedVisitor visitor(ThreadState::current(), 2, |
objects); |
ThreadState::current()->visitPersistents(&visitor); |
@@ -3955,6 +3964,7 @@ TEST(HeapTest, CheckAndMarkPointer) { |
// checkAndMarkPointer tests. |
{ |
TestGCScope scope(BlinkGC::HeapPointersOnStack); |
+ ThreadState::GCForbiddenScope gcScope(ThreadState::current()); |
CountingVisitor visitor(ThreadState::current()); |
EXPECT_TRUE(scope.allThreadsParked()); // Fail the test if we could not |
// park all threads. |
@@ -3976,6 +3986,7 @@ TEST(HeapTest, CheckAndMarkPointer) { |
clearOutOldGarbage(); |
{ |
TestGCScope scope(BlinkGC::HeapPointersOnStack); |
+ ThreadState::GCForbiddenScope gcScope(ThreadState::current()); |
CountingVisitor visitor(ThreadState::current()); |
EXPECT_TRUE(scope.allThreadsParked()); |
heap.flushHeapDoesNotContainCache(); |
@@ -5874,6 +5885,7 @@ class PartObject { |
}; |
TEST(HeapTest, TraceIfNeeded) { |
+ ThreadState::GCForbiddenScope scope(ThreadState::current()); |
CountingVisitor visitor(ThreadState::current()); |
{ |