| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "wtf/Threading.h" | 42 #include "wtf/Threading.h" |
| 43 #include "wtf/ThreadingPrimitives.h" | 43 #include "wtf/ThreadingPrimitives.h" |
| 44 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
| 45 | 45 |
| 46 namespace v8 { | 46 namespace v8 { |
| 47 class Isolate; | 47 class Isolate; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 namespace blink { | 50 namespace blink { |
| 51 | 51 |
| 52 class BaseHeap; | |
| 53 class BaseHeapPage; | 52 class BaseHeapPage; |
| 54 class CallbackStack; | 53 class CallbackStack; |
| 55 struct GCInfo; | 54 struct GCInfo; |
| 56 class HeapObjectHeader; | 55 class HeapObjectHeader; |
| 57 class PageMemoryRegion; | 56 class PageMemoryRegion; |
| 58 class PageMemory; | 57 class PageMemory; |
| 59 class PersistentNode; | 58 class PersistentNode; |
| 60 class SafePointBarrier; | 59 class SafePointBarrier; |
| 61 class SafePointAwareMutexLocker; | 60 class SafePointAwareMutexLocker; |
| 62 class ThreadHeap; | 61 class ThreadHeap; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 H(CSSValue) | 177 H(CSSValue) |
| 179 | 178 |
| 180 #define TypedHeapEnumName(Type) Type##Heap, | 179 #define TypedHeapEnumName(Type) Type##Heap, |
| 181 | 180 |
| 182 enum TypedHeaps { | 181 enum TypedHeaps { |
| 183 GeneralHeap = 0, | 182 GeneralHeap = 0, |
| 184 VectorBackingHeap, | 183 VectorBackingHeap, |
| 185 InlineVectorBackingHeap, | 184 InlineVectorBackingHeap, |
| 186 HashTableBackingHeap, | 185 HashTableBackingHeap, |
| 187 FOR_EACH_TYPED_HEAP(TypedHeapEnumName) | 186 FOR_EACH_TYPED_HEAP(TypedHeapEnumName) |
| 187 LargeObjectHeap, |
| 188 // Values used for iteration of heap segments. | 188 // Values used for iteration of heap segments. |
| 189 NumberOfHeaps, | 189 NumberOfHeaps, |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 class PLATFORM_EXPORT ThreadState { | 192 class PLATFORM_EXPORT ThreadState { |
| 193 WTF_MAKE_NONCOPYABLE(ThreadState); | 193 WTF_MAKE_NONCOPYABLE(ThreadState); |
| 194 public: | 194 public: |
| 195 // When garbage collecting we need to know whether or not there | 195 // When garbage collecting we need to know whether or not there |
| 196 // can be pointers to Blink GC managed objects on the stack for | 196 // can be pointers to Blink GC managed objects on the stack for |
| 197 // each thread. When threads reach a safe point they record | 197 // each thread. When threads reach a safe point they record |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 456 |
| 457 void recordStackEnd(intptr_t* endOfStack) | 457 void recordStackEnd(intptr_t* endOfStack) |
| 458 { | 458 { |
| 459 m_endOfStack = endOfStack; | 459 m_endOfStack = endOfStack; |
| 460 } | 460 } |
| 461 | 461 |
| 462 // Get one of the heap structures for this thread. | 462 // Get one of the heap structures for this thread. |
| 463 // | 463 // |
| 464 // The heap is split into multiple heap parts based on object | 464 // The heap is split into multiple heap parts based on object |
| 465 // types. To get the index for a given type, use | 465 // types. To get the index for a given type, use |
| 466 // HeapTypeTrait<Type>::index. | 466 // HeapIndexTrait<Type>::index. |
| 467 ThreadHeap* heap(int index) const { return m_heaps[index]; } | 467 ThreadHeap* heap(int heapIndex) const { return m_heaps[heapIndex]; } |
| 468 | 468 |
| 469 #if ENABLE(ASSERT) || ENABLE(GC_PROFILE_MARKING) | 469 #if ENABLE(ASSERT) || ENABLE(GC_PROFILE_MARKING) |
| 470 // Infrastructure to determine if an address is within one of the | 470 // Infrastructure to determine if an address is within one of the |
| 471 // address ranges for the Blink heap. If the address is in the Blink | 471 // address ranges for the Blink heap. If the address is in the Blink |
| 472 // heap the containing heap page is returned. | 472 // heap the containing heap page is returned. |
| 473 BaseHeapPage* findPageFromAddress(Address); | 473 BaseHeapPage* findPageFromAddress(Address); |
| 474 BaseHeapPage* findPageFromAddress(void* pointer) { return findPageFromAddres
s(reinterpret_cast<Address>(pointer)); } | 474 BaseHeapPage* findPageFromAddress(void* pointer) { return findPageFromAddres
s(reinterpret_cast<Address>(pointer)); } |
| 475 #endif | 475 #endif |
| 476 | 476 |
| 477 // List of persistent roots allocated on the given thread. | 477 // List of persistent roots allocated on the given thread. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 m_locked = false; | 725 m_locked = false; |
| 726 } | 726 } |
| 727 | 727 |
| 728 MutexBase& m_mutex; | 728 MutexBase& m_mutex; |
| 729 bool m_locked; | 729 bool m_locked; |
| 730 }; | 730 }; |
| 731 | 731 |
| 732 } // namespace blink | 732 } // namespace blink |
| 733 | 733 |
| 734 #endif // ThreadState_h | 734 #endif // ThreadState_h |
| OLD | NEW |