java字节码 new 后面的dup有什么用?

Because INVOKESPECIAL will consume value created by NEW from the operand stack, but you may need to actually use this value, so the reference is duplicated in advance.

方法调用指令invoke之类, 把栈顶的几个操作数当作参数的, 调用时都要pop

 

http://stackoverflow.com/questions/7282585/why-do-dup-when-creating-new-instance

posted on 2015-07-27 11:49  reddit  阅读(1172)  评论(0)    收藏  举报

导航