2121
2222#ifdef  RECYCLER_WRITE_BARRIER
2323#if  ENABLE_DEBUG_CONFIG_OPTIONS
24- namespace  Memory   
24+ namespace  Memory 
2525{
2626    FN_VerifyIsNotBarrierAddress* g_verifyIsNotBarrierAddress = nullptr ;
2727}
@@ -377,11 +377,11 @@ RecyclerWriteBarrierManager::IsBarrierAddress(void * address)
377377bool 
378378RecyclerWriteBarrierManager::IsBarrierAddress (uintptr_t  index)
379379{
380-     return  cardTable[index] & WRITE_BARRIER_PAGE_BIT;
380+     return  ( cardTable[index] & WRITE_BARRIER_PAGE_BIT) ==  WRITE_BARRIER_PAGE_BIT;
381381}
382382
383- //  TODO: SWB, looks we didn't initialize card table for heap allocation.  
384- //  we didn't hit such issue because we are not allocating write barrier  
383+ //  TODO: SWB, looks we didn't initialize card table for heap allocation.
384+ //  we didn't hit such issue because we are not allocating write barrier
385385//  annotated struct with heap today.
386386//  after SWB is widely enabled and if an annotated structure can be allocated
387387//  with both Heap and Recycler/Arena we'll capture the issue
@@ -406,10 +406,10 @@ RecyclerWriteBarrierManager::VerifyIsBarrierAddress(void * address, size_t bytes
406406        uintptr_t  startIndex = GetCardTableIndex (address);
407407        char  * endAddress = (char  *)Math::Align<INT_PTR>((INT_PTR)((char  *)address + bytes), s_WriteBarrierPageSize);
408408        uintptr_t  endIndex = GetCardTableIndex (endAddress);
409-         do   
409+         do 
410410        {
411411            //  no need to check if cardTable is commited or not, if it's not commited it'll AV instead of assertion
412-             if  (!IsBarrierAddress (startIndex))  
412+             if  (!IsBarrierAddress (startIndex))
413413            {
414414                Js::Throw::FatalInternalError ();
415415            }
@@ -425,11 +425,11 @@ RecyclerWriteBarrierManager::VerifyIsNotBarrierAddress(void * address, size_t by
425425        uintptr_t  startIndex = GetCardTableIndex (address);
426426        char  * endAddress = (char  *)Math::Align<INT_PTR>((INT_PTR)((char  *)address + bytes), s_WriteBarrierPageSize);
427427        uintptr_t  endIndex = GetCardTableIndex (endAddress);
428-         do   
428+         do 
429429        {
430430            if (IsCardTableCommited (startIndex))
431431            {
432-                 if  (IsBarrierAddress (startIndex))  
432+                 if  (IsBarrierAddress (startIndex))
433433                {
434434                    Js::Throw::FatalInternalError ();
435435                }
@@ -439,13 +439,13 @@ RecyclerWriteBarrierManager::VerifyIsNotBarrierAddress(void * address, size_t by
439439    }
440440}
441441
442- bool   
442+ bool 
443443RecyclerWriteBarrierManager::Initialize ()
444444{
445445    g_verifyIsNotBarrierAddress = RecyclerWriteBarrierManager::VerifyIsNotBarrierAddress;
446446    return  true ;
447447}
448- #endif   
448+ #endif 
449449
450450uintptr_t 
451451RecyclerWriteBarrierManager::GetCardTableIndex (void  *address)
0 commit comments