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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 | 133 |
134 ThreadState::~ThreadState() | 134 ThreadState::~ThreadState() |
135 { | 135 { |
136 ASSERT(checkThread()); | 136 ASSERT(checkThread()); |
137 delete m_threadLocalWeakCallbackStack; | 137 delete m_threadLocalWeakCallbackStack; |
138 m_threadLocalWeakCallbackStack = nullptr; | 138 m_threadLocalWeakCallbackStack = nullptr; |
139 for (int i = 0; i < NumberOfHeaps; ++i) | 139 for (int i = 0; i < NumberOfHeaps; ++i) |
140 delete m_heaps[i]; | 140 delete m_heaps[i]; |
141 | 141 |
142 for (Interruptor* interruptor : m_interruptors) | |
143 delete interruptor; | |
144 | |
145 **s_threadSpecific = nullptr; | 142 **s_threadSpecific = nullptr; |
146 if (isMainThread()) { | 143 if (isMainThread()) { |
147 s_mainThreadStackStart = 0; | 144 s_mainThreadStackStart = 0; |
148 s_mainThreadUnderestimatedStackSize = 0; | 145 s_mainThreadUnderestimatedStackSize = 0; |
149 } | 146 } |
150 } | 147 } |
151 | 148 |
152 void ThreadState::init() | 149 void ThreadState::init() |
153 { | 150 { |
154 s_threadSpecific = new WTF::ThreadSpecific<ThreadState*>(); | 151 s_threadSpecific = new WTF::ThreadSpecific<ThreadState*>(); |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 ASSERT(slotCount < 1024); | 1273 ASSERT(slotCount < 1024); |
1277 #endif | 1274 #endif |
1278 | 1275 |
1279 ASSERT(!m_safePointStackCopy.size()); | 1276 ASSERT(!m_safePointStackCopy.size()); |
1280 m_safePointStackCopy.resize(slotCount); | 1277 m_safePointStackCopy.resize(slotCount); |
1281 for (size_t i = 0; i < slotCount; ++i) { | 1278 for (size_t i = 0; i < slotCount; ++i) { |
1282 m_safePointStackCopy[i] = from[i]; | 1279 m_safePointStackCopy[i] = from[i]; |
1283 } | 1280 } |
1284 } | 1281 } |
1285 | 1282 |
1286 void ThreadState::addInterruptor(Interruptor* interruptor) | 1283 void ThreadState::addInterruptor(PassOwnPtr<Interruptor> interruptor) |
1287 { | 1284 { |
1288 ASSERT(checkThread()); | 1285 ASSERT(checkThread()); |
1289 SafePointScope scope(HeapPointersOnStack); | 1286 SafePointScope scope(HeapPointersOnStack); |
1290 { | 1287 { |
1291 MutexLocker locker(threadAttachMutex()); | 1288 MutexLocker locker(threadAttachMutex()); |
1292 m_interruptors.append(interruptor); | 1289 m_interruptors.append(interruptor); |
1293 } | 1290 } |
1294 } | 1291 } |
1295 | 1292 |
1296 void ThreadState::removeInterruptor(Interruptor* interruptor) | 1293 void ThreadState::removeInterruptor(Interruptor* interruptor) |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 json->beginArray(it->key.ascii().data()); | 1529 json->beginArray(it->key.ascii().data()); |
1533 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1530 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
1534 json->pushInteger(it->value.ages[age]); | 1531 json->pushInteger(it->value.ages[age]); |
1535 json->endArray(); | 1532 json->endArray(); |
1536 } | 1533 } |
1537 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); | 1534 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); |
1538 } | 1535 } |
1539 #endif | 1536 #endif |
1540 | 1537 |
1541 } // namespace blink | 1538 } // namespace blink |
OLD | NEW |