Skip to content

Instantly share code, notes, and snippets.

@rednaxelafx
Created June 8, 2016 02:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rednaxelafx/2d30bbbf3e97327f26de9cdde7b68cc6 to your computer and use it in GitHub Desktop.
Save rednaxelafx/2d30bbbf3e97327f26de9cdde7b68cc6 to your computer and use it in GitHub Desktop.
HotSpot C1 doesn't compile this "monitorenter with Phi input", fails with "invalid parsing"
.class public Demo
.super java/lang/Object
.field public static dummy I
.method public static foo(Ljava/lang/Object;Ljava/lang/Object;Z)V
.limit stack 2
.limit locals 3
iload_2
ifeq Label_lock_other
aload_0
goto Label_do_lock
Label_lock_other:
aload_1
Label_do_lock:
monitorenter
getstatic Demo/dummy I
iconst_1
iadd
putstatic Demo/dummy I
iload_2
ifeq Label_unlock_other
aload_0
goto Label_do_unlock
Label_unlock_other:
aload_1
Label_do_unlock:
monitorexit
return
.end method
@rednaxelafx
Copy link
Author

To compile, download Jasmin and run java -jar jasmin.jar Demo.j.

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