pracio / dex2jar

Automatically exported from code.google.com/p/dex2jar
0 stars 0 forks source link

关于synchronized的指令优化 #115

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
synchronized (this) {
  //code
}

//仅限于synchronized (this)
//原翻译结果   ->  jad和jd-gui翻译正常的结果
aload_0          aload_0
                 dup
             ->  astore_x(x=0也可以)
monitorenter     monitorenter
.
//code
.
aload_0          aload_x
monitorexit  ->  monitorexit
...
//synchronized对应的catch区段[ 不限于synchronized (this) ]
astore_y
aload_0          aload_x
monitorexit  ->  monitorexit
aload_y
athrow           athrow

Original issue reported on code.google.com by yyjdel...@gmail.com on 24 Mar 2012 at 9:05