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 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1846 | 1846 |
1847 TEST(HeapTest, LargeObjects) | 1847 TEST(HeapTest, LargeObjects) |
1848 { | 1848 { |
1849 HeapStats initialHeapSize; | 1849 HeapStats initialHeapSize; |
1850 clearOutOldGarbage(&initialHeapSize); | 1850 clearOutOldGarbage(&initialHeapSize); |
1851 IntWrapper::s_destructorCalls = 0; | 1851 IntWrapper::s_destructorCalls = 0; |
1852 LargeObject::s_destructorCalls = 0; | 1852 LargeObject::s_destructorCalls = 0; |
1853 { | 1853 { |
1854 int slack = 8; // LargeObject points to an IntWrapper that is also alloc
ated. | 1854 int slack = 8; // LargeObject points to an IntWrapper that is also alloc
ated. |
1855 Persistent<LargeObject> object = LargeObject::create(); | 1855 Persistent<LargeObject> object = LargeObject::create(); |
| 1856 EXPECT_TRUE(ThreadState::current()->contains(object)); |
| 1857 EXPECT_TRUE(ThreadState::current()->contains(reinterpret_cast<char*>(obj
ect.get()) + sizeof(LargeObject) - 1)); |
| 1858 #if ENABLE(GC_TRACING) |
| 1859 const GCInfo* info = ThreadState::current()->findGCInfo(reinterpret_cast
<Address>(object.get())); |
| 1860 EXPECT_NE(reinterpret_cast<const GCInfo*>(0), info); |
| 1861 EXPECT_EQ(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr
ess>(object.get()) + sizeof(LargeObject) - 1)); |
| 1862 EXPECT_NE(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr
ess>(object.get()) + sizeof(LargeObject))); |
| 1863 EXPECT_NE(info, ThreadState::current()->findGCInfo(reinterpret_cast<Addr
ess>(object.get()) - 1)); |
| 1864 #endif |
1856 HeapStats afterAllocation; | 1865 HeapStats afterAllocation; |
1857 clearOutOldGarbage(&afterAllocation); | 1866 clearOutOldGarbage(&afterAllocation); |
1858 { | 1867 { |
1859 object->set(0, 'a'); | 1868 object->set(0, 'a'); |
1860 EXPECT_EQ('a', object->get(0)); | 1869 EXPECT_EQ('a', object->get(0)); |
1861 object->set(object->length() - 1, 'b'); | 1870 object->set(object->length() - 1, 'b'); |
1862 EXPECT_EQ('b', object->get(object->length() - 1)); | 1871 EXPECT_EQ('b', object->get(object->length() - 1)); |
1863 size_t expectedObjectSpace = sizeof(LargeObject) + sizeof(IntWrapper
); | 1872 size_t expectedObjectSpace = sizeof(LargeObject) + sizeof(IntWrapper
); |
1864 size_t actualObjectSpace = | 1873 size_t actualObjectSpace = |
1865 afterAllocation.totalObjectSpace() - initialHeapSize.totalObject
Space(); | 1874 afterAllocation.totalObjectSpace() - initialHeapSize.totalObject
Space(); |
(...skipping 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3948 | 3957 |
3949 volatile bool GCParkingThreadTester::s_sleeperRunning = false; | 3958 volatile bool GCParkingThreadTester::s_sleeperRunning = false; |
3950 volatile bool GCParkingThreadTester::s_sleeperDone = false; | 3959 volatile bool GCParkingThreadTester::s_sleeperDone = false; |
3951 | 3960 |
3952 TEST(HeapTest, GCParkingTimeout) | 3961 TEST(HeapTest, GCParkingTimeout) |
3953 { | 3962 { |
3954 GCParkingThreadTester::test(); | 3963 GCParkingThreadTester::test(); |
3955 } | 3964 } |
3956 | 3965 |
3957 } // WebCore namespace | 3966 } // WebCore namespace |
OLD | NEW |