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

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

Issue 818253005: Oilpan: Query stack frame register instead of manual bookkeeping (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: move preGC Created 5 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 | « 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 { \ 232 { \
233 return ensureMarked(objectPointer); \ 233 return ensureMarked(objectPointer); \
234 } 234 }
235 235
236 class CountingVisitor : public Visitor { 236 class CountingVisitor : public Visitor {
237 public: 237 public:
238 CountingVisitor() 238 CountingVisitor()
239 : Visitor(Visitor::GenericVisitorType) 239 : Visitor(Visitor::GenericVisitorType)
240 , m_count(0) 240 , m_count(0)
241 { 241 {
242 configureEagerTraceLimit();
242 } 243 }
243 244
244 virtual void mark(const void* object, TraceCallback) override 245 virtual void mark(const void* object, TraceCallback) override
245 { 246 {
246 if (object) 247 if (object)
247 m_count++; 248 m_count++;
248 } 249 }
249 250
250 virtual void markHeader(HeapObjectHeader* header, TraceCallback callback) ov erride 251 virtual void markHeader(HeapObjectHeader* header, TraceCallback callback) ov erride
251 { 252 {
(...skipping 5213 matching lines...) Expand 10 before | Expand all | Expand 10 after
5465 static int sTraceLazy; 5466 static int sTraceLazy;
5466 }; 5467 };
5467 5468
5468 int DeepEagerly::sTraceCalls = 0; 5469 int DeepEagerly::sTraceCalls = 0;
5469 int DeepEagerly::sTraceLazy = 0; 5470 int DeepEagerly::sTraceLazy = 0;
5470 5471
5471 TEST(HeapTest, TraceDeepEagerly) 5472 TEST(HeapTest, TraceDeepEagerly)
5472 { 5473 {
5473 #if !ENABLE(ASSERT) 5474 #if !ENABLE(ASSERT)
5474 DeepEagerly* obj = nullptr; 5475 DeepEagerly* obj = nullptr;
5475 for (int i = 0; i < 2000; i++) 5476 for (int i = 0; i < 10000; i++)
5476 obj = new DeepEagerly(obj); 5477 obj = new DeepEagerly(obj);
5477 5478
5478 Persistent<DeepEagerly> persistent(obj); 5479 Persistent<DeepEagerly> persistent(obj);
5479 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack); 5480 Heap::collectGarbage(ThreadState::NoHeapPointersOnStack);
5480 5481
5481 // Verify that the DeepEagerly chain isn't completely unravelled 5482 // Verify that the DeepEagerly chain isn't completely unravelled
5482 // by performing eager trace() calls, but the explicit mark 5483 // by performing eager trace() calls, but the explicit mark
5483 // stack is switched once some nesting limit is exceeded. 5484 // stack is switched once some nesting limit is exceeded.
5484 EXPECT_GT(DeepEagerly::sTraceLazy, 2); 5485 EXPECT_GT(DeepEagerly::sTraceLazy, 2);
5485 #endif 5486 #endif
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
5528 // re-adjusting both start&end indices in terms of that expanded buffer. 5529 // re-adjusting both start&end indices in terms of that expanded buffer.
5529 EXPECT_EQ(80u, deque->size()); 5530 EXPECT_EQ(80u, deque->size());
5530 i = 0; 5531 i = 0;
5531 for (const auto& intWrapper : *deque) { 5532 for (const auto& intWrapper : *deque) {
5532 EXPECT_EQ(i + 50, intWrapper->value()); 5533 EXPECT_EQ(i + 50, intWrapper->value());
5533 i++; 5534 i++;
5534 } 5535 }
5535 } 5536 }
5536 5537
5537 } // namespace blink 5538 } // 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