avm2: Add longer comment to logic to determine register types

This commit is contained in:
Lord-McSweeney 2024-01-08 18:30:02 -08:00 committed by Lord-McSweeney
parent dd35e4862f
commit 50b752c35b
1 changed files with 4 additions and 1 deletions

View File

@ -559,7 +559,10 @@ fn optimize<'gc>(
let mut local_types = vec![None; method.body().unwrap().num_locals as usize];
local_types[0] = this_class;
// Invalidate local types if they should be invalidated
// Logic to only allow for type-based optimizations on types that
// we're absolutely sure about- invalidate the local register's
// known type if any other register-modifying opcodes mention them
// anywhere else in the function.
for op in &*code {
match op {
Op::SetLocal { index }