WIP
This commit is contained in:
@@ -686,3 +686,34 @@ pub fn u64_key(b: u32, a: u32) -> u64 {
|
||||
pub fn u128_key(d: u32, c: u32, b: u32, a: u32) -> u128 {
|
||||
a as u128 | (b as u128) << 32 | (c as u128) << 64 | (d as u128) << 96
|
||||
}
|
||||
|
||||
pub struct Bitmap {
|
||||
storage: SmallVec<[u64; 2]>,
|
||||
}
|
||||
|
||||
impl Bitmap {
|
||||
pub fn init(entry_count: usize) -> Self {
|
||||
let u64_count = (entry_count + 63) / 64;
|
||||
let mut storage = SmallVec::<[u64; 2]>::with_capacity(u64_count);
|
||||
storage.resize(u64_count, 0);
|
||||
Self { storage }
|
||||
}
|
||||
|
||||
pub fn set(&mut self, idx: usize) {
|
||||
let storage_idx = idx / 64;
|
||||
let bit = 1u64 << (idx % 64);
|
||||
self.storage[storage_idx] |= bit;
|
||||
}
|
||||
|
||||
pub fn un_set(&mut self, idx: usize) {
|
||||
let storage_idx = idx / 64;
|
||||
let bit = 1u64 << (idx % 64);
|
||||
self.storage[storage_idx] &= !bit;
|
||||
}
|
||||
|
||||
pub fn is_set(&mut self, idx: usize) -> bool {
|
||||
let storage_idx = idx / 64;
|
||||
let bit = 1u64 << (idx % 64);
|
||||
(self.storage[storage_idx] & bit) != 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ struct VRegData {
|
||||
|
||||
// use information
|
||||
pub cur_use_idx: u32,
|
||||
pub uses: SmallVec<[u32; 8]>,
|
||||
pub uses: SmallVec<[u32; 4]>,
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Copy)]
|
||||
@@ -38,6 +38,7 @@ struct PRegData {
|
||||
struct BlockData {
|
||||
pub reg_allocated: bool,
|
||||
pub params_allocated: bool,
|
||||
// pub livein_locations_idx: u32, // adding this is very expensive!!!
|
||||
}
|
||||
|
||||
struct ReadOnlyData {
|
||||
|
||||
1201
src/ion/fast_alloc2.rs
Normal file
1201
src/ion/fast_alloc2.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,7 @@ use process::*;
|
||||
use smallvec::smallvec;
|
||||
pub(crate) mod dump;
|
||||
mod fast_alloc;
|
||||
mod fast_alloc2;
|
||||
pub(crate) mod moves;
|
||||
pub(crate) mod spill;
|
||||
pub(crate) mod stackmap;
|
||||
|
||||
Reference in New Issue
Block a user