[問題] java byte code問題

看板java作者 (小天)時間10年前 (2014/12/28 22:53), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
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://www.ptt.cc/bbs/java/M.1419778417.A.2EF.html
文章代碼(AID): #1Ke1bnBl (java)
討論串 (同標題文章)
文章代碼(AID): #1Ke1bnBl (java)