Changeset 253423 in webkit for trunk/Source/JavaScriptCore/heap
- Timestamp:
- Dec 12, 2019, 1:36:13 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore/heap
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/heap/IsoHeapCellType.cpp
r253422 r253423 1 1 /* 2 * Copyright (C) 201 7 Apple Inc.All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 #i fndef JSHeapFinalizerPrivate_h27 # define JSHeapFinalizerPrivate_h26 #include "config.h" 27 #include "IsoHeapCellType.h" 28 28 29 #include <JavaScriptCore/JSContextRef.h>30 #include <stdbool.h>29 #include "JSCInlines.h" 30 #include "MarkedBlockInlines.h" 31 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 32 namespace JSC { 35 33 36 typedef void (*JSHeapFinalizer)(JSContextGroupRef, void *userData); 34 void IsoHeapCellType::finishSweep(MarkedBlock::Handle& handle, FreeList* freeList) 35 { 36 handle.finishSweepKnowingHeapCellType(freeList, *this); 37 } 37 38 38 JS_EXPORT void JSContextGroupAddHeapFinalizer(JSContextGroupRef, JSHeapFinalizer, void *userData); 39 JS_EXPORT void JSContextGroupRemoveHeapFinalizer(JSContextGroupRef, JSHeapFinalizer, void *userData); 39 void IsoHeapCellType::destroy(VM&, JSCell* cell) 40 { 41 m_destroy(cell); 42 } 40 43 41 #ifdef __cplusplus 42 } 43 #endif 44 } // namespace JSC 44 45 45 #endif // JSHeapFinalizerPrivate_h46 -
trunk/Source/JavaScriptCore/heap/IsoHeapCellType.h
r252843 r253423 29 29 namespace JSC { 30 30 31 template<typename CellType>32 31 class IsoHeapCellType final : public HeapCellType { 33 32 public: 34 IsoHeapCellType() 35 : HeapCellType(CellAttributes(CellType::needsDestruction ? NeedsDestruction : DoesNotNeedDestruction, HeapCell::JSCell)) 33 using DestroyFunctionPtr = void (*)(JSCell*); 34 35 IsoHeapCellType(DestructionMode destructionMode, DestroyFunctionPtr destroyFunction) 36 : HeapCellType(CellAttributes(destructionMode, HeapCell::JSCell)) 37 , m_destroy(destroyFunction) 36 38 { 37 39 } 38 40 39 struct DestroyFunc { 40 ALWAYS_INLINE void operator()(VM&, JSCell* cell) const 41 { 42 CellType::destroy(cell); 43 } 44 }; 45 46 void finishSweep(MarkedBlock::Handle& handle, FreeList* freeList) override 41 template<typename CellType> 42 static std::unique_ptr<IsoHeapCellType> create() 47 43 { 48 handle.finishSweepKnowingHeapCellType(freeList, DestroyFunc());44 return makeUnique<IsoHeapCellType>(CellType::needsDestruction ? NeedsDestruction : DoesNotNeedDestruction, &CellType::destroy); 49 45 } 50 46 51 void destroy(VM&, JSCell* cell) override 47 void finishSweep(MarkedBlock::Handle&, FreeList*) override; 48 void destroy(VM&, JSCell*) override; 49 50 ALWAYS_INLINE void operator()(VM&, JSCell* cell) const 52 51 { 53 CellType::destroy(cell);52 m_destroy(cell); 54 53 } 54 55 private: 56 DestroyFunctionPtr WTF_VTBL_FUNCPTR_PTRAUTH_STR("IsoHeapCellType.destroy") m_destroy; 55 57 }; 56 58 57 59 } // namespace JSC 58 -
trunk/Source/JavaScriptCore/heap/IsoInlinedHeapCellType.h
r253422 r253423 30 30 31 31 template<typename CellType> 32 class Iso HeapCellType final : public HeapCellType {32 class IsoInlinedHeapCellType final : public HeapCellType { 33 33 public: 34 Iso HeapCellType()34 IsoInlinedHeapCellType() 35 35 : HeapCellType(CellAttributes(CellType::needsDestruction ? NeedsDestruction : DoesNotNeedDestruction, HeapCell::JSCell)) 36 36 { -
trunk/Source/JavaScriptCore/heap/MutatorState.cpp
r212778 r253423 29 29 #include <wtf/PrintStream.h> 30 30 31 namespace WTF { 32 31 33 using namespace JSC; 32 33 namespace WTF {34 34 35 35 void printInternal(PrintStream& out, MutatorState state) -
trunk/Source/JavaScriptCore/heap/Synchronousness.cpp
r216218 r253423 29 29 #include <wtf/PrintStream.h> 30 30 31 namespace WTF { 32 31 33 using namespace JSC; 32 33 namespace WTF {34 34 35 35 void printInternal(PrintStream& out, Synchronousness synchronousness)
Note:
See TracChangeset
for help on using the changeset viewer.