| 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 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 3035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4973 | 4973 |
| 4974 static volatile IntWrapper* s_workerObjectPointer; | 4974 static volatile IntWrapper* s_workerObjectPointer; |
| 4975 }; | 4975 }; |
| 4976 | 4976 |
| 4977 TEST(HeapTest, RecursiveMutex) | 4977 TEST(HeapTest, RecursiveMutex) |
| 4978 { | 4978 { |
| 4979 RecursiveLockingTester::test(); | 4979 RecursiveLockingTester::test(); |
| 4980 } | 4980 } |
| 4981 | 4981 |
| 4982 } // namespace blink | 4982 } // namespace blink |
| OLD | NEW |