diff options
Diffstat (limited to 'src/jit/bitsetasshortlong.h')
-rw-r--r-- | src/jit/bitsetasshortlong.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/jit/bitsetasshortlong.h b/src/jit/bitsetasshortlong.h index 163cb366cb..962a8bb374 100644 --- a/src/jit/bitsetasshortlong.h +++ b/src/jit/bitsetasshortlong.h @@ -43,6 +43,7 @@ private: static void DiffDLong(Env env, BitSetShortLongRep& bs1, BitSetShortLongRep bs2); static void AddElemDLong(Env env, BitSetShortLongRep& bs, unsigned i); static void RemoveElemDLong(Env env, BitSetShortLongRep& bs, unsigned i); + static void OldStyleClearDLong(Env env, BitSetShortLongRep& bs); static void ClearDLong(Env env, BitSetShortLongRep& bs); static BitSetShortLongRep MakeUninitArrayBits(Env env); static BitSetShortLongRep MakeEmptyArrayBits(Env env); @@ -122,6 +123,19 @@ public: lhs = rhs; } + static void OldStyleClearD(Env env, BitSetShortLongRep& bs) + { + if (IsShort(env)) + { + bs = (BitSetShortLongRep) nullptr; + } + else + { + assert(bs != UninitVal()); + OldStyleClearDLong(env, bs); + } + } + static void ClearD(Env env, BitSetShortLongRep& bs) { if (IsShort(env)) @@ -661,15 +675,29 @@ template <typename Env, typename BitSetTraits> void BitSetOps</*BitSetType*/ BitSetShortLongRep, /*Brand*/ BSShortLong, /*Env*/ Env, - /*BitSetTraits*/ BitSetTraits>::ClearDLong(Env env, BitSetShortLongRep& bs) + /*BitSetTraits*/ BitSetTraits>::OldStyleClearDLong(Env env, BitSetShortLongRep& bs) { assert(!IsShort(env)); - // Recall that ClearD does *not* require "bs" to be of the current epoch. + // Recall that OldStyleClearD does *not* require "bs" to be of the current epoch. // Therefore, we must allocate a new representation. bs = MakeEmptyArrayBits(env); } template <typename Env, typename BitSetTraits> +void BitSetOps</*BitSetType*/ BitSetShortLongRep, + /*Brand*/ BSShortLong, + /*Env*/ Env, + /*BitSetTraits*/ BitSetTraits>::ClearDLong(Env env, BitSetShortLongRep& bs) +{ + assert(!IsShort(env)); + unsigned len = BitSetTraits::GetArrSize(env, sizeof(size_t)); + for (unsigned i = 0; i < len; i++) + { + bs[i] = 0; + } +} + +template <typename Env, typename BitSetTraits> BitSetShortLongRep BitSetOps</*BitSetType*/ BitSetShortLongRep, /*Brand*/ BSShortLong, /*Env*/ Env, |