| ... | ... | @@ -366,7 +366,7 @@ pub const OutputFunctionIndex = enum(u32) { |
| 366 | 366 | const zcu = wasm.base.comp.zcu.?; |
| 367 | 367 | const ip = &zcu.intern_pool; |
| 368 | 368 | const nav = ip.getNav(nav_index); |
| 369 | | return fromIpIndex(wasm, nav.status.resolved.val); |
| 369 | return fromIpIndex(wasm, nav.status.fully_resolved.val); |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | pub fn fromTagNameType(wasm: *const Wasm, tag_type: InternPool.Index) OutputFunctionIndex { |
| ... | ... | @@ -758,9 +758,9 @@ const ZcuDataStarts = struct { |
| 758 | 758 | while (true) { |
| 759 | 759 | while (navs_i < wasm.navs_obj.entries.len) : (navs_i += 1) { |
| 760 | 760 | const elem_nav = ip.getNav(wasm.navs_obj.keys()[navs_i]); |
| 761 | | const elem_nav_init = switch (ip.indexToKey(elem_nav.status.resolved.val)) { |
| 761 | const elem_nav_init = switch (ip.indexToKey(elem_nav.status.fully_resolved.val)) { |
| 762 | 762 | .variable => |variable| variable.init, |
| 763 | | else => elem_nav.status.resolved.val, |
| 763 | else => elem_nav.status.fully_resolved.val, |
| 764 | 764 | }; |
| 765 | 765 | // Call to `lowerZcuData` here possibly creates more entries in these tables. |
| 766 | 766 | wasm.navs_obj.values()[navs_i] = try lowerZcuData(wasm, pt, elem_nav_init); |
| ... | ... | @@ -781,9 +781,9 @@ const ZcuDataStarts = struct { |
| 781 | 781 | while (true) { |
| 782 | 782 | while (navs_i < wasm.navs_exe.entries.len) : (navs_i += 1) { |
| 783 | 783 | const elem_nav = ip.getNav(wasm.navs_exe.keys()[navs_i]); |
| 784 | | const elem_nav_init = switch (ip.indexToKey(elem_nav.status.resolved.val)) { |
| 784 | const elem_nav_init = switch (ip.indexToKey(elem_nav.status.fully_resolved.val)) { |
| 785 | 785 | .variable => |variable| variable.init, |
| 786 | | else => elem_nav.status.resolved.val, |
| 786 | else => elem_nav.status.fully_resolved.val, |
| 787 | 787 | }; |
| 788 | 788 | // Call to `lowerZcuData` here possibly creates more entries in these tables. |
| 789 | 789 | const zcu_data = try lowerZcuData(wasm, pt, elem_nav_init); |
| ... | ... | @@ -930,7 +930,7 @@ pub const FunctionImport = extern struct { |
| 930 | 930 | pub fn fromIpNav(wasm: *const Wasm, nav_index: InternPool.Nav.Index) Resolution { |
| 931 | 931 | const zcu = wasm.base.comp.zcu.?; |
| 932 | 932 | const ip = &zcu.intern_pool; |
| 933 | | return fromIpIndex(wasm, ip.getNav(nav_index).status.resolved.val); |
| 933 | return fromIpIndex(wasm, ip.getNav(nav_index).status.fully_resolved.val); |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | pub fn fromIpIndex(wasm: *const Wasm, ip_index: InternPool.Index) Resolution { |
| ... | ... | @@ -1507,7 +1507,7 @@ pub const DataId = enum(u32) { |
| 1507 | 1507 | const zcu = wasm.base.comp.zcu.?; |
| 1508 | 1508 | const ip = &zcu.intern_pool; |
| 1509 | 1509 | const nav = ip.getNav(i.key(wasm).*); |
| 1510 | | if (nav.isThreadLocal(ip)) return .tls; |
| 1510 | if (nav.isThreadlocal(ip)) return .tls; |
| 1511 | 1511 | const code = i.value(wasm).code; |
| 1512 | 1512 | return if (code.off == .none) .zero else .data; |
| 1513 | 1513 | }, |
| ... | ... | @@ -1523,7 +1523,7 @@ pub const DataId = enum(u32) { |
| 1523 | 1523 | const zcu = wasm.base.comp.zcu.?; |
| 1524 | 1524 | const ip = &zcu.intern_pool; |
| 1525 | 1525 | const nav = ip.getNav(i.key(wasm).*); |
| 1526 | | return nav.isThreadLocal(ip); |
| 1526 | return nav.isThreadlocal(ip); |
| 1527 | 1527 | }, |
| 1528 | 1528 | }; |
| 1529 | 1529 | } |
| ... | ... | @@ -1540,7 +1540,7 @@ pub const DataId = enum(u32) { |
| 1540 | 1540 | const zcu = wasm.base.comp.zcu.?; |
| 1541 | 1541 | const ip = &zcu.intern_pool; |
| 1542 | 1542 | const nav = ip.getNav(i.key(wasm).*); |
| 1543 | | return nav.status.resolved.@"linksection".toSlice(ip) orelse ".data"; |
| 1543 | return nav.getLinkSection().toSlice(ip) orelse ".data"; |
| 1544 | 1544 | }, |
| 1545 | 1545 | }; |
| 1546 | 1546 | } |
| ... | ... | @@ -1563,7 +1563,7 @@ pub const DataId = enum(u32) { |
| 1563 | 1563 | const zcu = wasm.base.comp.zcu.?; |
| 1564 | 1564 | const ip = &zcu.intern_pool; |
| 1565 | 1565 | const nav = ip.getNav(i.key(wasm).*); |
| 1566 | | const explicit = nav.status.resolved.alignment; |
| 1566 | const explicit = nav.getAlignment(); |
| 1567 | 1567 | if (explicit != .none) return explicit; |
| 1568 | 1568 | const ty: ZcuType = .fromInterned(nav.typeOf(ip)); |
| 1569 | 1569 | const result = ty.abiAlignment(zcu); |
| ... | ... | @@ -1820,11 +1820,7 @@ pub const ZcuImportIndex = enum(u32) { |
| 1820 | 1820 | const zcu = wasm.base.comp.zcu.?; |
| 1821 | 1821 | const ip = &zcu.intern_pool; |
| 1822 | 1822 | const nav_index = index.ptr(wasm).*; |
| 1823 | | const nav = ip.getNav(nav_index); |
| 1824 | | const ext = switch (ip.indexToKey(nav.status.resolved.val)) { |
| 1825 | | .@"extern" => |*ext| ext, |
| 1826 | | else => unreachable, |
| 1827 | | }; |
| 1823 | const ext = ip.getNav(nav_index).getResolvedExtern(ip).?; |
| 1828 | 1824 | const name_slice = ext.name.toSlice(ip); |
| 1829 | 1825 | return wasm.getExistingString(name_slice).?; |
| 1830 | 1826 | } |
| ... | ... | @@ -1833,11 +1829,7 @@ pub const ZcuImportIndex = enum(u32) { |
| 1833 | 1829 | const zcu = wasm.base.comp.zcu.?; |
| 1834 | 1830 | const ip = &zcu.intern_pool; |
| 1835 | 1831 | const nav_index = index.ptr(wasm).*; |
| 1836 | | const nav = ip.getNav(nav_index); |
| 1837 | | const ext = switch (ip.indexToKey(nav.status.resolved.val)) { |
| 1838 | | .@"extern" => |*ext| ext, |
| 1839 | | else => unreachable, |
| 1840 | | }; |
| 1832 | const ext = ip.getNav(nav_index).getResolvedExtern(ip).?; |
| 1841 | 1833 | const lib_name = ext.lib_name.toSlice(ip) orelse return .none; |
| 1842 | 1834 | return wasm.getExistingString(lib_name).?.toOptional(); |
| 1843 | 1835 | } |
| ... | ... | @@ -1848,11 +1840,7 @@ pub const ZcuImportIndex = enum(u32) { |
| 1848 | 1840 | const zcu = comp.zcu.?; |
| 1849 | 1841 | const ip = &zcu.intern_pool; |
| 1850 | 1842 | const nav_index = index.ptr(wasm).*; |
| 1851 | | const nav = ip.getNav(nav_index); |
| 1852 | | const ext = switch (ip.indexToKey(nav.status.resolved.val)) { |
| 1853 | | .@"extern" => |*ext| ext, |
| 1854 | | else => unreachable, |
| 1855 | | }; |
| 1843 | const ext = ip.getNav(nav_index).getResolvedExtern(ip).?; |
| 1856 | 1844 | const fn_info = zcu.typeToFunc(.fromInterned(ext.ty)).?; |
| 1857 | 1845 | return getExistingFunctionType(wasm, fn_info.cc, fn_info.param_types.get(ip), .fromInterned(fn_info.return_type), target).?; |
| 1858 | 1846 | } |
| ... | ... | @@ -1944,7 +1932,7 @@ pub const FunctionImportId = enum(u32) { |
| 1944 | 1932 | .zcu_import => |i| { |
| 1945 | 1933 | const zcu = wasm.base.comp.zcu.?; |
| 1946 | 1934 | const ip = &zcu.intern_pool; |
| 1947 | | const ext = ip.getNav(i.ptr(wasm).*).toExtern(ip).?; |
| 1935 | const ext = ip.getNav(i.ptr(wasm).*).getResolvedExtern(ip).?; |
| 1948 | 1936 | return !ext.is_weak_linkage and ext.lib_name != .none; |
| 1949 | 1937 | }, |
| 1950 | 1938 | }; |
| ... | ... | @@ -2588,7 +2576,7 @@ pub fn updateNav(wasm: *Wasm, pt: Zcu.PerThread, nav_index: InternPool.Nav.Index |
| 2588 | 2576 | const is_obj = comp.config.output_mode == .Obj; |
| 2589 | 2577 | const target = &comp.root_mod.resolved_target.result; |
| 2590 | 2578 | |
| 2591 | | const nav_init, const chased_nav_index = switch (ip.indexToKey(nav.status.resolved.val)) { |
| 2579 | const nav_init, const chased_nav_index = switch (ip.indexToKey(nav.status.fully_resolved.val)) { |
| 2592 | 2580 | .func => return, // global const which is a function alias |
| 2593 | 2581 | .@"extern" => |ext| { |
| 2594 | 2582 | if (is_obj) { |
| ... | ... | @@ -2612,7 +2600,7 @@ pub fn updateNav(wasm: *Wasm, pt: Zcu.PerThread, nav_index: InternPool.Nav.Index |
| 2612 | 2600 | return; |
| 2613 | 2601 | }, |
| 2614 | 2602 | .variable => |variable| .{ variable.init, variable.owner_nav }, |
| 2615 | | else => .{ nav.status.resolved.val, nav_index }, |
| 2603 | else => .{ nav.status.fully_resolved.val, nav_index }, |
| 2616 | 2604 | }; |
| 2617 | 2605 | //log.debug("updateNav {} {}", .{ nav.fqn.fmt(ip), chased_nav_index }); |
| 2618 | 2606 | assert(!wasm.imports.contains(chased_nav_index)); |