Skip to content

Commit 8619ae7

Browse files
committed
Revert "Fix bit packing of bundle params (#192)"
This reverts commit d251c8e.
1 parent 4c2a954 commit 8619ae7

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/ion/data_structures.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@ impl LiveBundle {
241241
self.spill_weight_and_props & (1 << 29) != 0
242242
}
243243

244+
#[inline(always)]
245+
pub fn cached_stack(&self) -> bool {
246+
self.spill_weight_and_props & (1 << 28) != 0
247+
}
248+
244249
#[inline(always)]
245250
pub fn set_cached_fixed(&mut self) {
246251
self.spill_weight_and_props |= 1 << 30;
@@ -251,9 +256,14 @@ impl LiveBundle {
251256
self.spill_weight_and_props |= 1 << 29;
252257
}
253258

259+
#[inline(always)]
260+
pub fn set_cached_stack(&mut self) {
261+
self.spill_weight_and_props |= 1 << 28;
262+
}
263+
254264
#[inline(always)]
255265
pub fn cached_spill_weight(&self) -> u32 {
256-
self.spill_weight_and_props & BUNDLE_MAX_SPILL_WEIGHT
266+
self.spill_weight_and_props & ((1 << 28) - 1)
257267
}
258268
}
259269

src/ion/merge.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ impl<'a, F: Function> Env<'a, F> {
112112
}
113113

114114
// Check for a requirements conflict.
115-
if self.bundles[from].cached_fixed() || self.bundles[to].cached_fixed() {
115+
if self.bundles[from].cached_stack()
116+
|| self.bundles[from].cached_fixed()
117+
|| self.bundles[to].cached_stack()
118+
|| self.bundles[to].cached_fixed()
119+
{
116120
if self.merge_bundle_requirements(from, to).is_err() {
117121
trace!(" -> conflicting requirements; aborting merge");
118122
return false;
@@ -154,6 +158,9 @@ impl<'a, F: Function> Env<'a, F> {
154158
}
155159
self.bundles[to].ranges = list;
156160

161+
if self.bundles[from].cached_stack() {
162+
self.bundles[to].set_cached_stack();
163+
}
157164
if self.bundles[from].cached_fixed() {
158165
self.bundles[to].set_cached_fixed();
159166
}
@@ -236,6 +243,9 @@ impl<'a, F: Function> Env<'a, F> {
236243
*to_range = to_range.join(from_range);
237244
}
238245

246+
if self.bundles[from].cached_stack() {
247+
self.bundles[to].set_cached_stack();
248+
}
239249
if self.bundles[from].cached_fixed() {
240250
self.bundles[to].set_cached_fixed();
241251
}

0 commit comments

Comments
 (0)