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

MONITOR_EXIT instruction has slightly unusual throwing semantics #14

Closed
brazdil opened this issue Aug 15, 2013 · 1 comment
Closed

MONITOR_EXIT instruction has slightly unusual throwing semantics #14

brazdil opened this issue Aug 15, 2013 · 1 comment

Comments

@brazdil
Copy link
Owner

brazdil commented Aug 15, 2013

Description of MONITOR_EXIT:

Release the monitor for the indicated object.
Note: If this instruction needs to throw an exception, it must do so as if the pc has already advanced past the instruction. It may be useful to think of this as the instruction successfully executing (in a sense), and the exception getting thrown after the instruction but before the next one gets a chance to run. This definition makes it possible for a method to use a monitor cleanup catch-all (e.g., finally) block as the monitor cleanup for that block itself, as a way to handle the arbitrary exceptions that might get thrown due to the historical implementation of Thread.stop(), while still managing to have proper monitor hygiene.

(from http://www.netmite.com/android/mydroid/dalvik/docs/dalvik-bytecode.html)

@brazdil
Copy link
Owner Author

brazdil commented Aug 15, 2013

Shouldn't be a problem considering the instruction only references the register

@brazdil brazdil closed this as completed Aug 15, 2013
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

No branches or pull requests

1 participant