@@ -52,7 +52,7 @@ namespace JSC {
5252inline JSCell::JSCell (CreatingEarlyCellTag)
5353 : m_cellState(CellState::DefinitelyWhite)
5454{
55- ASSERT (!isCompilationThread ());
55+ RELEASE_ASSERT (!isCompilationThread ());
5656}
5757
5858inline JSCell::JSCell (VM&, Structure* structure)
@@ -62,7 +62,7 @@ inline JSCell::JSCell(VM&, Structure* structure)
6262 , m_flags(structure->typeInfo ().inlineTypeFlags())
6363 , m_cellState(CellState::DefinitelyWhite)
6464{
65- ASSERT (!isCompilationThread ());
65+ RELEASE_ASSERT (!isCompilationThread ());
6666
6767 // Note that in the constructor initializer list above, we are only using values
6868 // inside structure but not necessarily the structure pointer itself. All these
@@ -84,18 +84,18 @@ inline void JSCell::finishCreation(VM& vm)
8484 // to make sure that none of our stores sink below here.
8585 vm.mutatorFence ();
8686#if ENABLE(GC_VALIDATION)
87- ASSERT (vm.isInitializingObject ());
87+ RELEASE_ASSERT (vm.isInitializingObject ());
8888 vm.setInitializingObjectClass (0 );
8989#else
9090 UNUSED_PARAM (vm);
9191#endif
92- ASSERT (m_structureID);
92+ RELEASE_ASSERT (m_structureID);
9393}
9494
9595inline void JSCell::finishCreation (VM& vm, Structure* structure, CreatingEarlyCellTag)
9696{
9797#if ENABLE(GC_VALIDATION)
98- ASSERT (vm.isInitializingObject ());
98+ RELEASE_ASSERT (vm.isInitializingObject ());
9999 vm.setInitializingObjectClass (0 );
100100 if (structure) {
101101#endif
@@ -109,7 +109,7 @@ inline void JSCell::finishCreation(VM& vm, Structure* structure, CreatingEarlyCe
109109 UNUSED_PARAM (vm);
110110#endif
111111 // Very first set of allocations won't have a real structure.
112- ASSERT (m_structureID || !vm.structureStructure );
112+ RELEASE_ASSERT (m_structureID || !vm.structureStructure );
113113}
114114
115115inline JSType JSCell::type () const
@@ -170,15 +170,15 @@ inline Allocator allocatorForConcurrently(VM& vm, size_t allocationSize, Allocat
170170template <typename T, AllocationFailureMode failureMode>
171171ALWAYS_INLINE void * tryAllocateCellHelper (VM& vm, size_t size, GCDeferralContext* deferralContext)
172172{
173- ASSERT (deferralContext || vm.heap .isDeferred () || !DisallowGC::isInEffectOnCurrentThread ());
174- ASSERT (size >= sizeof (T));
173+ RELEASE_ASSERT (deferralContext || vm.heap .isDeferred () || !DisallowGC::isInEffectOnCurrentThread ());
174+ RELEASE_ASSERT (size >= sizeof (T));
175175 JSCell* result = static_cast <JSCell*>(subspaceFor<T>(vm)->allocate (vm, size, deferralContext, failureMode));
176176 if constexpr (failureMode == AllocationFailureMode::ReturnNull) {
177177 if (!result)
178178 return nullptr ;
179179 }
180180#if ENABLE(GC_VALIDATION)
181- ASSERT (!vm.isInitializingObject ());
181+ RELEASE_ASSERT (!vm.isInitializingObject ());
182182 vm.setInitializingObjectClass (T::info ());
183183#endif
184184 result->clearStructure ();
@@ -298,16 +298,16 @@ inline bool JSCell::isAPIValueWrapper() const
298298
299299ALWAYS_INLINE void JSCell::setStructure (VM& vm, Structure* structure)
300300{
301- ASSERT (structure->classInfoForCells () == this ->structure ()->classInfoForCells ());
302- ASSERT (!this ->structure ()
301+ RELEASE_ASSERT (structure->classInfoForCells () == this ->structure ()->classInfoForCells ());
302+ RELEASE_ASSERT (!this ->structure ()
303303 || this ->structure ()->transitionWatchpointSetHasBeenInvalidated ()
304304 || structure->id ().decode () == structure);
305305 m_structureID = structure->id ();
306306 m_flags = TypeInfo::mergeInlineTypeFlags (structure->typeInfo ().inlineTypeFlags (), m_flags);
307307 m_type = structure->typeInfo ().type ();
308308 IndexingType newIndexingType = structure->indexingModeIncludingHistory ();
309309 if (m_indexingTypeAndMisc != newIndexingType) {
310- ASSERT (!(newIndexingType & ~AllArrayTypesAndHistory));
310+ RELEASE_ASSERT (!(newIndexingType & ~AllArrayTypesAndHistory));
311311 for (;;) {
312312 IndexingType oldValue = m_indexingTypeAndMisc;
313313 IndexingType newValue = (oldValue & ~AllArrayTypesAndHistory) | structure->indexingModeIncludingHistory ();
@@ -321,10 +321,8 @@ ALWAYS_INLINE void JSCell::setStructure(VM& vm, Structure* structure)
321321inline const MethodTable* JSCell::methodTable () const
322322{
323323 Structure* structure = this ->structure ();
324- #if ASSERT_ENABLED
325324 if (Structure* rootStructure = structure->structure ())
326- ASSERT (rootStructure == rootStructure->structure ());
327- #endif
325+ RELEASE_ASSERT (rootStructure == rootStructure->structure ());
328326 return &structure->classInfoForCells ()->methodTable ;
329327}
330328
@@ -362,7 +360,7 @@ ALWAYS_INLINE const ClassInfo* JSCell::classInfo() const
362360 // destructing the object. The GC thread or JIT threads, unlike the mutator thread, are able to access classInfo
363361 // independent of whether the mutator thread is sweeping or not. Hence, we also check for !currentThreadIsHoldingAPILock()
364362 // to allow the GC thread or JIT threads to pass this assertion.
365- ASSERT (vm ().heap .mutatorState () != MutatorState::Sweeping || !vm ().currentThreadIsHoldingAPILock ());
363+ RELEASE_ASSERT (vm ().heap .mutatorState () != MutatorState::Sweeping || !vm ().currentThreadIsHoldingAPILock ());
366364 return structure ()->classInfoForCells ();
367365}
368366
0 commit comments