ImageVerifierCode 换一换
格式:PPT , 页数:27 ,大小:177KB ,
资源ID:372956      下载积分:2000 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝扫码支付 微信扫码支付   
注意:如需开发票,请勿充值!
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.mydoc123.com/d-372956.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Java and the JVM.ppt)为本站会员(lawfemale396)主动上传,麦多课文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文库(发送邮件至master@mydoc123.com或直接QQ联系客服),我们立即给予删除!

Java and the JVM.ppt

1、Java and the JVM,Martin Schberl,Java and the JVM,2,Overview,History and Java features Java technology The Java language A first look into the JVM Disassembling of .class files,Java and the JVM,3,History of a Young Java,1992 Oak for a PDA on a SPARC (*7) 1995 Official release as Java Internet 1997 pi

2、coJava Suns Java processor 1998 RTSJ specification start as JSR-01 1999 split into J2SE and J2EE 2000 J2ME 2002 RTSJ final release 2002 first version of JOP ;-),Java and the JVM,4,Java features,Simple and object oriented Look and feel of C Simplified object model with single inheritance Portability

3、Java compiler generates bytecodes Runtime systems for various platforms Size and behavior of basic data types defined Write once, run/debug anywhere,Java and the JVM,5,Java features cont.,Availability Windows, Linux, Solaris, Embedded systems Compiler and runtime are free Free IDEs: Eclipse, Netbean

4、s Library Rich class library Part of the definition Standard GUI toolkit,Java and the JVM,6,Java features cont.,Built-in model for concurrency Threads at the language level Synchronization Libraries are thread-safe Safety No Pointer! Extensive compile-time checking Runtime checking Automatic memory

5、management GC,Java and the JVM,7,Java system overview,Java and the JVM,8,Java Technology,The Java programming language The library (JDK) The Java virtual machine (JVM) Instruction set Binary format Verification,Java and the JVM,9,Java Primitive Data Types,Java and the JVM,10,Objects,Everything belon

6、gs to an object (or a class) No global variables Namespace for objects Single inheritance Interfaces Allocated on the heap Shared among threads No free() garbage collector,Java and the JVM,11,What is a Virtual Machine?,A virtual machine (VM) is an abstract computer architecture Software on top of a

7、real hardware Can run the same application on different machines where the VM is available,Java and the JVM,12,The Java Virtual Machine,An abstract computing machine that executes bytecode programs An instruction set and the meaning of those instructions the bytecodes A binary format the class file

8、format An algorithm to verify the class file,Java and the JVM,13,JVM cont.,Runtime environment for Java Implementation NOT defined Runs Java .class files Has to conform to Suns specification,Java and the JVM,14,Implementations of the JVM,Interpreter Simple, compact Slow Just-in-time compilation Stat

9、e-of-the-art for desktop/server Too resource consuming in embedded systems Batch compilation Hardware implementation Our topic!,Java and the JVM,15,JVM Data Types,No boolean, char, byte, and short types Stack contains only 32-bit and 64-bit data Conversion instructions,Java and the JVM,16,Memory Are

10、as for the JVM,Method area Class description Code Constant pool Heap Objects and Arrays Shared by all threads Garbage collected,Java and the JVM,17,Memory Areas for the JVM,Stack Thread private Logical stack that contains: Invocation frame Local variable area Operand stack Not necessary a single sta

11、ck Local variables and operand stack are accessed frequently,Java and the JVM,18,JVM Instruction Set,32 (64) bit stack machine Variable length instruction set Simple to very complex instructions Symbolic references Only relative branches,Java and the JVM,19,JVM Instruction Set,Load and store Arithme

12、tic Type conversion Object creation and manipulation Operand stack manipulation Control transfer Method invocation and return,Java and the JVM,20,Dissassembling Java,Compile javac Hello.java Run java Hello Dissassemble javap -c Hello,Java and the JVM,21,A Bytecode Example,public class X public stati

13、c voidmain(String args) add(1, 2);public static intadd(int a, int b) return a+b; ,public static void main(java.lang.String);Code:0: iconst_11: iconst_2/Method add:(II)I2: invokestatic #2; 5: pop6: returnpublic static int add(int,int);Code:0: iload_01: iload_12: iadd3: ireturn,Java and the JVM,22,Cod

14、ing: Avoiding garbage,System.out.println(“Result = “+i);getstatic #3; / Field System.out:Ljava/io/PrintStream; new #4; / class StringBuffer dup invokespecial #5; / StringBuffer.“:()V ldc #6; / String Result = invokevirtual #7; / StringBuffer.append:(LString;)LStringBuffer iload_1 invokevirtual #8; /

15、 StringBuffer.append:(I)LStringBuffer; invokevirtual #9; / StringBuffer.toString:()LString; invokevirtual #10;/ PrintStream.println:(LString;)V,Java and the JVM,23,Coding: Avoiding garbage,System.out.print(“Result = “); System.out.println(i);getstatic #3; /Field System.out:Ljava/io/PrintStream; ldc

16、#4; /String Result = invokevirtual #5; /Method PrintStream.print:(LString;)V getstatic #3; /Field System.out:LPrintStream; iload_1 invokevirtual #6; /Method PrintStream.println:(I)V,Java and the JVM,24,Java for Embedded Systems?,+ Simpler than C/C+ + Safer than C/C+ + Threads are part of the languag

17、e - Interpreting JVM is slow - JIT needs a lot of memory - GC and real-time?,Java and the JVM,25,Summary Java/JVM,Java language definition Class library The Java virtual machine (JVM) An instruction set the bytecodes A binary format the class file An algorithm to verify the class file,Java and the J

18、VM,26,Summary Java Features,Safe OO Language No pointers Type-safety Garbage Collection Built in model for concurrency Platform independent Very rich standard library,Java and the JVM,27,More Information,Java James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. The Java Language Specification, Addison-Wesley, 2000, JavaSpec. JVM Tim Lindholm and Frank Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1999, JVMSpec.,

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1