Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP/POC AVM2 verifier #14563

Closed
wants to merge 12 commits into from

Conversation

Lord-McSweeney
Copy link
Collaborator

@Lord-McSweeney Lord-McSweeney commented Dec 31, 2023

This is based off @adrian17's original work on his peephole optimizer branch (see #7920 and a newer branch)

This results in noticeable performance increases on #10560 (6-7% decrease in startup time and even more, clearly noticeable improvements in gameplay) and in #12303.

This supersedes the main part of #14496, the opcode reading optimizations.

TODO:

  • Something in try..catch blocks is broken (I keep losing working reproductions, but FP is throwing verify errors where Ruffle is not)
    • Also only verify exception target if there are any potentially error-throwing opcodes present in the from..to
    • All error-throwing opcodes in the from..to should act as a potential jump to the exception target (just like iftrue, iffalse, etc)- example: verify.zip
  • More brokenness
  • Add many tests
  • Store parsed_code on the method itself rather than in AbcMethodBody
  • Add a custom Op type in AVM2 that stores already-resolved constant pool entries
  • Storing an entire verified AbcMethodBody seems unnecessary, and is mostly leftover from Adrian's original work

This allows for further optimizations that actually modify the bytecode, such as #7920.

Lord-McSweeney and others added 9 commits December 31, 2023 13:42
…anch

Includes scope stack and local register verification.
…when inside a freestanding function; implement VerifyError 1113

Implementing Error 1113 prevents a panic when using `newactivation` within a method that does not `NEED_ACTIVATION`
@Lord-McSweeney Lord-McSweeney marked this pull request as draft December 31, 2023 10:53
@evilpie
Copy link
Collaborator

evilpie commented Dec 31, 2023

Nice. I imagine shrinking the Opcode size would improve this even more.

@Lord-McSweeney
Copy link
Collaborator Author

Closing in favor of #14631.

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.

2 participants