| OLD | NEW |
| 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } \ | 228 } \ |
| 229 virtual bool isMarked(const Type*) override { return false; } \ | 229 virtual bool isMarked(const Type*) override { return false; } \ |
| 230 virtual bool ensureMarked(const Type* objectPointer) override \ | 230 virtual bool ensureMarked(const Type* objectPointer) override \ |
| 231 { \ | 231 { \ |
| 232 return ensureMarked(objectPointer); \ | 232 return ensureMarked(objectPointer); \ |
| 233 } | 233 } |
| 234 | 234 |
| 235 class CountingVisitor : public Visitor { | 235 class CountingVisitor : public Visitor { |
| 236 public: | 236 public: |
| 237 CountingVisitor() | 237 CountingVisitor() |
| 238 : m_count(0) | 238 : Visitor(Visitor::GenericVisitorType) |
| 239 , m_count(0) |
| 239 { | 240 { |
| 240 } | 241 } |
| 241 | 242 |
| 242 virtual void mark(const void* object, TraceCallback) override | 243 virtual void mark(const void* object, TraceCallback) override |
| 243 { | 244 { |
| 244 if (object) | 245 if (object) |
| 245 m_count++; | 246 m_count++; |
| 246 } | 247 } |
| 247 | 248 |
| 248 virtual void mark(HeapObjectHeader* header, TraceCallback callback) override | 249 virtual void mark(HeapObjectHeader* header, TraceCallback callback) override |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 | 876 |
| 876 #define DEFINE_VISITOR_METHODS(Type) \ | 877 #define DEFINE_VISITOR_METHODS(Type) \ |
| 877 virtual void mark(const Type* object, TraceCallback callback) override \ | 878 virtual void mark(const Type* object, TraceCallback callback) override \ |
| 878 { \ | 879 { \ |
| 879 mark(object); \ | 880 mark(object); \ |
| 880 } \ | 881 } \ |
| 881 | 882 |
| 882 class RefCountedGarbageCollectedVisitor : public CountingVisitor { | 883 class RefCountedGarbageCollectedVisitor : public CountingVisitor { |
| 883 public: | 884 public: |
| 884 RefCountedGarbageCollectedVisitor(int expected, void** objects) | 885 RefCountedGarbageCollectedVisitor(int expected, void** objects) |
| 885 : m_count(0) | 886 : Visitor(Visitor::GenericVisitorType) |
| 887 , m_count(0) |
| 886 , m_expectedCount(expected) | 888 , m_expectedCount(expected) |
| 887 , m_expectedObjects(objects) | 889 , m_expectedObjects(objects) |
| 888 { | 890 { |
| 889 } | 891 } |
| 890 | 892 |
| 891 void mark(const void* ptr) { markNoTrace(ptr); } | 893 void mark(const void* ptr) { markNoTrace(ptr); } |
| 892 | 894 |
| 893 virtual void markNoTrace(const void* ptr) | 895 virtual void markNoTrace(const void* ptr) |
| 894 { | 896 { |
| 895 if (!ptr) | 897 if (!ptr) |
| (...skipping 4444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5340 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); | 5342 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); |
| 5341 | 5343 |
| 5342 // Verify that the DeepEagerly chain isn't completely unravelled | 5344 // Verify that the DeepEagerly chain isn't completely unravelled |
| 5343 // by performing eager trace() calls, but the explicit mark | 5345 // by performing eager trace() calls, but the explicit mark |
| 5344 // stack is switched once some nesting limit is exceeded. | 5346 // stack is switched once some nesting limit is exceeded. |
| 5345 EXPECT_GT(DeepEagerly::sTraceLazy, 2); | 5347 EXPECT_GT(DeepEagerly::sTraceLazy, 2); |
| 5346 #endif | 5348 #endif |
| 5347 } | 5349 } |
| 5348 | 5350 |
| 5349 } // namespace blink | 5351 } // namespace blink |
| OLD | NEW |