Skip to content

Commit 6076561

Browse files
author
Meghana Gupta
committed
On 64bit targets, increase the size of data a BVSparseNode can hold from
32-bit to 64-bit.
1 parent 3c82d73 commit 6076561

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

lib/Common/DataStructures/SparseBitVector.h

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
//-------------------------------------------------------------------------------------------------------
55
#pragma once
66

7-
#if defined(_M_ARM64) || defined(_M_X64)
8-
typedef BVUnit32 SparseBVUnit;
9-
#else
107
typedef BVUnit64 SparseBVUnit;
11-
#endif
128

139
#define FOREACH_BITSET_IN_SPARSEBV(index, bv) \
1410
{ \
@@ -64,15 +60,8 @@ typedef BVUnit64 SparseBVUnit;
6460
struct BVSparseNode
6561
{
6662
BVIndex startIndex;
67-
#if defined(_M_ARM64) || defined(_M_X64)
68-
//64-bit: the order is changed to make sure it fits in 16 bytes
69-
SparseBVUnit data;
70-
BVSparseNode * next;
71-
#else //_M_IX86 and _M_ARM32
7263
BVSparseNode * next;
7364
SparseBVUnit data;
74-
#endif
75-
7665

7766
BVSparseNode(BVIndex beginIndex, BVSparseNode * nextNode);
7867

@@ -91,7 +80,11 @@ struct BVSparseNode
9180
#endif
9281
};
9382

94-
CompileAssert(sizeof(BVSparseNode) == 16); // Performance assert, BVSparseNode is heavily used in the backend, do perf measurement before changing this.
83+
#if defined(_M_X64)
84+
CompileAssert(sizeof(BVSparseNode) == 24); // Performance assert, BVSparseNode is heavily used in the backend, do perf measurement before changing this.
85+
#else
86+
CompileAssert(sizeof(BVSparseNode) == 16);
87+
#endif
9588

9689
template <class TAllocator>
9790
class BVSparse

lib/Common/Memory/ArenaAllocator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ ArenaAllocatorBase<TFreeListPolicy, ObjectAlignmentBitShiftArg, RequireObjectAli
166166
RealAllocInlined(size_t nbytes)
167167
{
168168
Assert(nbytes != 0);
169-
Assert((nbytes & (ObjectAlignment - 1)) == 0);
170169

171170
#ifdef ARENA_MEMORY_VERIFY
172171
if (Js::Configuration::Global.flags.ArenaUseHeapAlloc)

lib/Common/Memory/ArenaAllocator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ class JitArenaAllocator : public ArenaAllocator
458458
// Fast path
459459
if (sizeof(BVSparseNode) == requestedBytes)
460460
{
461-
AssertMsg(Math::Align(requestedBytes, ArenaAllocatorBase::ObjectAlignment) == requestedBytes, "Assert for Perf, T should always be aligned");
462461
// Fast path for BVSparseNode allocation
463462
if (bvFreeList)
464463
{

0 commit comments

Comments
 (0)