mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-01-15 00:18:06 -05:00
Extract constants later so that simplify has more information
This commit is contained in:
@@ -10,9 +10,13 @@ use super::simplify::simplify;
|
||||
|
||||
pub fn optimize(module: &mut Module, pointer_allocator: &mut NameAllocator) {
|
||||
collapse_pointers_of_pointers(module);
|
||||
extract_constants(module, pointer_allocator);
|
||||
shake_tree(module);
|
||||
simplify(module);
|
||||
remove_noops(module);
|
||||
remove_meta_lines(module);
|
||||
extract_constants(module, pointer_allocator);
|
||||
|
||||
// After possibly repeated optimization, this ensures that the pointers are ordered correctly.
|
||||
// TODO: Consider a dedicated step that's only about pointer ordering and not tree shaking.
|
||||
shake_tree(module);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user