Store specialized variables of expect lookups in expect frames

This commit is contained in:
Ayaz Hafiz 2022-12-14 16:00:18 -06:00
parent 16209ef866
commit fe90355265
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
6 changed files with 101 additions and 36 deletions

View file

@ -46,12 +46,19 @@ pub fn get_values<'a>(
let app = arena.alloc(app);
for (i, variable) in variables.iter().enumerate() {
let start = app.memory.deref_usize(start_offset + i * 8);
let size_of_lookup_header = 8 /* pointer to value */ + 4 /* type variable */;
let start = app
.memory
.deref_usize(start_offset + i * size_of_lookup_header);
let variable = app.memory.deref_u32(
start_offset + i * size_of_lookup_header + 8, /* skip the pointer */
);
let variable = unsafe { Variable::from_index(variable) };
app.offset = start;
let expr = {
let variable = *variable;
// TODO: pass layout_cache to jit_to_ast directly
let mut layout_cache = LayoutCache::new(layout_interner.fork(), target_info);
let layout = layout_cache.from_var(arena, variable, subs).unwrap();