Changeset 266250 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Aug 27, 2020, 1:01:04 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r266242 r266250 1 2020-08-27 Yusuke Suzuki <[email protected]> 2 3 [JSC] Use auxiliary memory for JSBigInt storage 4 https://bugs.webkit.org/show_bug.cgi?id=215876 5 6 Reviewed by Mark Lam. 7 8 This makes JSBigInt non-destructible cell. And it makes allocating JSBigInt from JIT easy. 9 10 * runtime/JSBigInt.cpp: 11 (JSC::JSBigInt::JSBigInt): 12 (JSC::JSBigInt::visitChildren): 13 (JSC::JSBigInt::createWithLength): 14 (JSC::JSBigInt::destroy): Deleted. 15 * runtime/JSBigInt.h: 16 * runtime/VM.cpp: 17 (JSC::VM::VM): 18 1 19 2020-08-27 Keith Miller <[email protected]> 2 20 -
trunk/Source/JavaScriptCore/runtime/JSBigInt.cpp
r264346 r266250 64 64 : Base(vm, structure) 65 65 , m_length(length) 66 , m_data( data, length)66 , m_data(vm, this, data, length) 67 67 { } 68 68 69 void JSBigInt::destroy(JSCell* thisCell) 70 { 71 static_cast<JSBigInt*>(thisCell)->~JSBigInt(); 69 void JSBigInt::visitChildren(JSCell* cell, SlotVisitor& visitor) 70 { 71 auto* thisObject = jsCast<JSBigInt*>(cell); 72 ASSERT_GC_OBJECT_INHERITS(thisObject, info()); 73 Base::visitChildren(thisObject, visitor); 74 if (auto* data = thisObject->m_data.getUnsafe()) 75 visitor.markAuxiliary(data); 72 76 } 73 77 … … 109 113 110 114 ASSERT(length <= maxLength); 111 void* data = Gigacage::tryMalloc(Gigacage::Primitive, length * sizeof(Digit));115 void* data = vm.primitiveGigacageAuxiliarySpace.allocateNonVirtual(vm, length * sizeof(Digit), nullptr, AllocationFailureMode::ReturnNull); 112 116 if (UNLIKELY(!data)) { 113 117 if (nullOrGlobalObjectForOOM) { -
trunk/Source/JavaScriptCore/runtime/JSBigInt.h
r262342 r266250 51 51 friend class CachedBigInt; 52 52 53 static constexpr bool needsDestruction = true; 54 static void destroy(JSCell*); 53 static void visitChildren(JSCell*, SlotVisitor&); 55 54 56 55 template<typename CellType, SubspaceAccess> … … 577 576 const unsigned m_length; 578 577 bool m_sign { false }; 579 Caged UniquePtr<Gigacage::Primitive, Digit> m_data;578 CagedBarrierPtr<Gigacage::Primitive, Digit> m_data; 580 579 }; 581 580 -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r266032 r266250 338 338 , destructibleObjectSpace("JSDestructibleObject", heap, destructibleObjectHeapCellType.get(), fastMallocAllocator.get()) // Hash:0x4f5ed7a9 339 339 , arraySpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSArray) 340 , bigIntSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), JSBigInt)340 , bigIntSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSBigInt) 341 341 , calleeSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSCallee) 342 342 , clonedArgumentsSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), ClonedArguments)
Note:
See TracChangeset
for help on using the changeset viewer.