| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include <utility> | 48 #include <utility> |
| 49 #endif | 49 #endif |
| 50 | 50 |
| 51 #if OS(POSIX) | 51 #if OS(POSIX) |
| 52 #include <sys/mman.h> | 52 #include <sys/mman.h> |
| 53 #include <unistd.h> | 53 #include <unistd.h> |
| 54 #elif OS(WIN) | 54 #elif OS(WIN) |
| 55 #include <windows.h> | 55 #include <windows.h> |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 namespace WebCore { | 58 namespace blink { |
| 59 | 59 |
| 60 #if ENABLE(GC_TRACING) | 60 #if ENABLE(GC_TRACING) |
| 61 static String classOf(const void* object) | 61 static String classOf(const void* object) |
| 62 { | 62 { |
| 63 const GCInfo* gcInfo = Heap::findGCInfo(reinterpret_cast<Address>(const_cast
<void*>(object))); | 63 const GCInfo* gcInfo = Heap::findGCInfo(reinterpret_cast<Address>(const_cast
<void*>(object))); |
| 64 if (gcInfo) | 64 if (gcInfo) |
| 65 return gcInfo->m_className; | 65 return gcInfo->m_className; |
| 66 | 66 |
| 67 return "unknown"; | 67 return "unknown"; |
| 68 } | 68 } |
| (...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 FOR_EACH_TYPED_HEAP(DEFINE_VISITOR_METHODS) | 1746 FOR_EACH_TYPED_HEAP(DEFINE_VISITOR_METHODS) |
| 1747 #undef DEFINE_VISITOR_METHODS | 1747 #undef DEFINE_VISITOR_METHODS |
| 1748 | 1748 |
| 1749 #if ENABLE(GC_TRACING) | 1749 #if ENABLE(GC_TRACING) |
| 1750 void reportStats() | 1750 void reportStats() |
| 1751 { | 1751 { |
| 1752 fprintf(stderr, "\n---------- AFTER MARKING -------------------\n"); | 1752 fprintf(stderr, "\n---------- AFTER MARKING -------------------\n"); |
| 1753 for (LiveObjectMap::iterator it = currentlyLive().begin(), end = current
lyLive().end(); it != end; ++it) { | 1753 for (LiveObjectMap::iterator it = currentlyLive().begin(), end = current
lyLive().end(); it != end; ++it) { |
| 1754 fprintf(stderr, "%s %u", it->key.ascii().data(), it->value.size()); | 1754 fprintf(stderr, "%s %u", it->key.ascii().data(), it->value.size()); |
| 1755 | 1755 |
| 1756 if (it->key == "WebCore::Document") | 1756 if (it->key == "blink::Document") |
| 1757 reportStillAlive(it->value, previouslyLive().get(it->key)); | 1757 reportStillAlive(it->value, previouslyLive().get(it->key)); |
| 1758 | 1758 |
| 1759 fprintf(stderr, "\n"); | 1759 fprintf(stderr, "\n"); |
| 1760 } | 1760 } |
| 1761 | 1761 |
| 1762 previouslyLive().swap(currentlyLive()); | 1762 previouslyLive().swap(currentlyLive()); |
| 1763 currentlyLive().clear(); | 1763 currentlyLive().clear(); |
| 1764 | 1764 |
| 1765 for (HashSet<uintptr_t>::iterator it = objectsToFindPath().begin(), end
= objectsToFindPath().end(); it != end; ++it) { | 1765 for (HashSet<uintptr_t>::iterator it = objectsToFindPath().begin(), end
= objectsToFindPath().end(); it != end; ++it) { |
| 1766 dumpPathToObjectFromObjectGraph(objectGraph(), *it); | 1766 dumpPathToObjectFromObjectGraph(objectGraph(), *it); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 int framesToShow = 3; | 1953 int framesToShow = 3; |
| 1954 int stackFrameSize = 16; | 1954 int stackFrameSize = 16; |
| 1955 ASSERT(stackFrameSize >= framesToShow); | 1955 ASSERT(stackFrameSize >= framesToShow); |
| 1956 typedef void* FramePointer; | 1956 typedef void* FramePointer; |
| 1957 FramePointer* stackFrame = static_cast<FramePointer*>(alloca(sizeof(FramePoi
nter) * stackFrameSize)); | 1957 FramePointer* stackFrame = static_cast<FramePointer*>(alloca(sizeof(FramePoi
nter) * stackFrameSize)); |
| 1958 WTFGetBacktrace(stackFrame, &stackFrameSize); | 1958 WTFGetBacktrace(stackFrame, &stackFrameSize); |
| 1959 | 1959 |
| 1960 StringBuilder builder; | 1960 StringBuilder builder; |
| 1961 builder.append("Persistent"); | 1961 builder.append("Persistent"); |
| 1962 bool didAppendFirstName = false; | 1962 bool didAppendFirstName = false; |
| 1963 // Skip frames before/including "WebCore::Persistent". | 1963 // Skip frames before/including "blink::Persistent". |
| 1964 bool didSeePersistent = false; | 1964 bool didSeePersistent = false; |
| 1965 for (int i = 0; i < stackFrameSize && framesToShow > 0; ++i) { | 1965 for (int i = 0; i < stackFrameSize && framesToShow > 0; ++i) { |
| 1966 FrameToNameScope frameToName(stackFrame[i]); | 1966 FrameToNameScope frameToName(stackFrame[i]); |
| 1967 if (!frameToName.nullableName()) | 1967 if (!frameToName.nullableName()) |
| 1968 continue; | 1968 continue; |
| 1969 if (strstr(frameToName.nullableName(), "WebCore::Persistent")) { | 1969 if (strstr(frameToName.nullableName(), "blink::Persistent")) { |
| 1970 didSeePersistent = true; | 1970 didSeePersistent = true; |
| 1971 continue; | 1971 continue; |
| 1972 } | 1972 } |
| 1973 if (!didSeePersistent) | 1973 if (!didSeePersistent) |
| 1974 continue; | 1974 continue; |
| 1975 if (!didAppendFirstName) { | 1975 if (!didAppendFirstName) { |
| 1976 didAppendFirstName = true; | 1976 didAppendFirstName = true; |
| 1977 builder.append(" ... Backtrace:"); | 1977 builder.append(" ... Backtrace:"); |
| 1978 } | 1978 } |
| 1979 builder.append("\n\t"); | 1979 builder.append("\n\t"); |
| 1980 builder.append(frameToName.nullableName()); | 1980 builder.append(frameToName.nullableName()); |
| 1981 --framesToShow; | 1981 --framesToShow; |
| 1982 } | 1982 } |
| 1983 return builder.toString().replace("WebCore::", ""); | 1983 return builder.toString().replace("blink::", ""); |
| 1984 } | 1984 } |
| 1985 #endif | 1985 #endif |
| 1986 | 1986 |
| 1987 void Heap::pushTraceCallback(void* object, TraceCallback callback) | 1987 void Heap::pushTraceCallback(void* object, TraceCallback callback) |
| 1988 { | 1988 { |
| 1989 ASSERT(Heap::containedInHeapOrOrphanedPage(object)); | 1989 ASSERT(Heap::containedInHeapOrOrphanedPage(object)); |
| 1990 CallbackStack::Item* slot = s_markingStack->allocateEntry(&s_markingStack); | 1990 CallbackStack::Item* slot = s_markingStack->allocateEntry(&s_markingStack); |
| 1991 *slot = CallbackStack::Item(object, callback); | 1991 *slot = CallbackStack::Item(object, callback); |
| 1992 } | 1992 } |
| 1993 | 1993 |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2242 Visitor* Heap::s_markingVisitor; | 2242 Visitor* Heap::s_markingVisitor; |
| 2243 CallbackStack* Heap::s_markingStack; | 2243 CallbackStack* Heap::s_markingStack; |
| 2244 CallbackStack* Heap::s_weakCallbackStack; | 2244 CallbackStack* Heap::s_weakCallbackStack; |
| 2245 CallbackStack* Heap::s_ephemeronStack; | 2245 CallbackStack* Heap::s_ephemeronStack; |
| 2246 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; | 2246 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; |
| 2247 bool Heap::s_shutdownCalled = false; | 2247 bool Heap::s_shutdownCalled = false; |
| 2248 bool Heap::s_lastGCWasConservative = false; | 2248 bool Heap::s_lastGCWasConservative = false; |
| 2249 FreePagePool* Heap::s_freePagePool; | 2249 FreePagePool* Heap::s_freePagePool; |
| 2250 OrphanedPagePool* Heap::s_orphanedPagePool; | 2250 OrphanedPagePool* Heap::s_orphanedPagePool; |
| 2251 } | 2251 } |
| OLD | NEW |