public AllocationContext(StackAllocator stackAlloc, RegisterMasks masks, int intervalsCount) { StackAlloc = stackAlloc; Masks = masks; Active = new BitMap(Allocators.Default, intervalsCount); Inactive = new BitMap(Allocators.Default, intervalsCount); PopulateFreePositions(RegisterType.Integer, out _intFreePositions, out _intFreePositionsCount); PopulateFreePositions(RegisterType.Vector, out _vecFreePositions, out _vecFreePositionsCount); void PopulateFreePositions(RegisterType type, out int[] positions, out int count) { positions = new int[RegistersCount]; count = BitOperations.PopCount((uint)masks.GetAvailableRegisters(type)); int mask = masks.GetAvailableRegisters(type); for (int i = 0; i < positions.Length; i++) { if ((mask & (1 << i)) != 0) { positions[i] = int.MaxValue; } } } }
public AllocationContext(StackAllocator stackAlloc, RegisterMasks masks, int intervalsCount) { StackAlloc = stackAlloc; Masks = masks; Active = new BitMap(intervalsCount); Inactive = new BitMap(intervalsCount); }
public AllocationContext(StackAllocator stackAlloc, RegisterMasks masks, int intervalsCount) { StackAlloc = stackAlloc; Masks = masks; BitMapPool.PrepareBitMapPool(); Active = BitMapPool.Allocate(intervalsCount); Inactive = BitMapPool.Allocate(intervalsCount); }