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

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

Issue 383743002: Oilpan: GC profiling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TracedValue update Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/heap/Heap.cpp ('k') | Source/platform/heap/ThreadState.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 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1917 { 1917 {
1918 HeapStats initialHeapSize; 1918 HeapStats initialHeapSize;
1919 clearOutOldGarbage(&initialHeapSize); 1919 clearOutOldGarbage(&initialHeapSize);
1920 IntWrapper::s_destructorCalls = 0; 1920 IntWrapper::s_destructorCalls = 0;
1921 LargeObject::s_destructorCalls = 0; 1921 LargeObject::s_destructorCalls = 0;
1922 { 1922 {
1923 int slack = 8; // LargeObject points to an IntWrapper that is also alloc ated. 1923 int slack = 8; // LargeObject points to an IntWrapper that is also alloc ated.
1924 Persistent<LargeObject> object = LargeObject::create(); 1924 Persistent<LargeObject> object = LargeObject::create();
1925 EXPECT_TRUE(ThreadState::current()->contains(object)); 1925 EXPECT_TRUE(ThreadState::current()->contains(object));
1926 EXPECT_TRUE(ThreadState::current()->contains(reinterpret_cast<char*>(obj ect.get()) + sizeof(LargeObject) - 1)); 1926 EXPECT_TRUE(ThreadState::current()->contains(reinterpret_cast<char*>(obj ect.get()) + sizeof(LargeObject) - 1));
1927 #if ENABLE(GC_TRACING) 1927 #if ENABLE(GC_PROFILE_MARKING)
1928 const GCInfo* info = ThreadState::current()->findGCInfo(reinterpret_cast <Address>(object.get())); 1928 const GCInfo* info = ThreadState::current()->findGCInfo(reinterpret_cast <Address>(object.get()));
1929 EXPECT_NE(reinterpret_cast<const GCInfo*>(0), info); 1929 EXPECT_NE(reinterpret_cast<const GCInfo*>(0), info);
1930 EXPECT_EQ(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr ess>(object.get()) + sizeof(LargeObject) - 1)); 1930 EXPECT_EQ(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr ess>(object.get()) + sizeof(LargeObject) - 1));
1931 EXPECT_NE(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr ess>(object.get()) + sizeof(LargeObject))); 1931 EXPECT_NE(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr ess>(object.get()) + sizeof(LargeObject)));
1932 EXPECT_NE(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr ess>(object.get()) - 1)); 1932 EXPECT_NE(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr ess>(object.get()) - 1));
1933 #endif 1933 #endif
1934 HeapStats afterAllocation; 1934 HeapStats afterAllocation;
1935 clearOutOldGarbage(&afterAllocation); 1935 clearOutOldGarbage(&afterAllocation);
1936 { 1936 {
1937 object->set(0, 'a'); 1937 object->set(0, 'a');
(...skipping 3105 matching lines...) Expand 10 before | Expand all | Expand 10 after
5043 { 5043 {
5044 TraceIfNeededTester<HeapVector<Member<SimpleObject> > >* m_vec = TraceIf NeededTester<HeapVector<Member<SimpleObject> > >::create(); 5044 TraceIfNeededTester<HeapVector<Member<SimpleObject> > >* m_vec = TraceIf NeededTester<HeapVector<Member<SimpleObject> > >::create();
5045 m_vec->obj().append(SimpleObject::create()); 5045 m_vec->obj().append(SimpleObject::create());
5046 visitor.reset(); 5046 visitor.reset();
5047 m_vec->trace(&visitor); 5047 m_vec->trace(&visitor);
5048 EXPECT_EQ(2u, visitor.count()); 5048 EXPECT_EQ(2u, visitor.count());
5049 } 5049 }
5050 } 5050 }
5051 5051
5052 } // namespace blink 5052 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/heap/Heap.cpp ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698