Skip to content

[wasm-split] Support Table::init#8818

Open
aheejin wants to merge 1 commit into
WebAssembly:mainfrom
aheejin:wasm_split_table_init
Open

[wasm-split] Support Table::init#8818
aheejin wants to merge 1 commit into
WebAssembly:mainfrom
aheejin:wasm_split_table_init

Conversation

@aheejin

@aheejin aheejin commented Jun 9, 2026

Copy link
Copy Markdown
Member

This adds support for Table::init expressions.

This adds support for `Table::init` expressions.
@aheejin aheejin requested a review from tlively June 9, 2026 05:36
@aheejin aheejin requested a review from a team as a code owner June 9, 2026 05:36
Comment on lines +765 to +787
// We shouldn't use collector.walkModuleCode here, because we don't want to
// walk global initializers. At this point, all globals are still in the
// primary module, so if we walk global initializers here, other globals
// appearing in their initializers will all be marked as used in the primary
// module, which is not what we want.
//
// For example, we have (global $a i32 (global.get $b)). Because $a is at
// this point still in the primary module, $b will be marked as "used" in
// the primary module. But $a can be moved to a secondary module later if it
// is used exclusively by that module. Then $b can be also moved, in case it
// doesn't have other uses. But if it is marked as "used" in the primary
// module, it can't.
walkSegments(collector, &module);
for (auto& segment : module.dataSegments) {
if (segment->isActive()) {
used.memories.insert(segment->memory);
}
}
for (auto& segment : module.elementSegments) {
if (segment->isActive()) {
used.tables.insert(segment->table);
}
}

@aheejin aheejin Jun 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part was just moved, because I felt this was tidier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant