作者kdok123 (小天)
看板java
标题[问题] java byte code问题
时间Sun Dec 28 22:53:35 2014
http://en.wikipedia.org/wiki/Java_bytecode_instruction_listings
连结为java bytecode instruction listings
有个三个疑问想问:
getstatic :
get a static field value of a class, where the field is identified by field
reference in the constant pool index (index1 << 8 + index2)
後面括号index1 << 8 + index2 是什麽意思?
invokespecial :
invoke instance method on object objectref, where the method is identified by
method reference index in constant pool (indexbyte1 << 8 + indexbyte2)
这边的objectref 是什麽意思?
每次只要new的时候都会有这行,是什麽原因?(跟instance method的关系?)
invokevirtual:
invoke virtual method on object objectref, where the method is identified by
method reference index in constant pool (indexbyte1 << 8 + indexbyte2)
每次call method的时候也会产生这行,连自定义的method也是(自定义的method跟
virtual method有什麽关系?)
请教大家了
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 1.34.79.220
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/java/M.1419778417.A.2EF.html