Java Bytecode DUP
问题 I am wondering why the Exception in the following bytecode (used to throw an Exception) is duplicated. NEW java/lang/IllegalArgumentException DUP INVOKESPECIAL java/lang/IllegalArgumentException <init> ()V ATHROW 回答1: I'll analyze this line by line where [] = new stack after that op is used: NEW puts a new IllegalArgumentException onto the stack [SomeIllegalArgumentException] DUP duplicates it [SomeIllegalArgumentException, SomeIllegalArgumentException] INVOKESPECIAL pops off the top one and