What is the difference between DVM and JVM?(DVM和JVM有什么区别?)
问题描述
Java虚拟机和Dalvik虚拟机有什么区别?
What is difference between Java Virtual Machine and Dalvik Virtual Machine?
推荐答案
DVM 是基于寄存器的,设计用于在低内存上运行,使用自己的字节码并运行 .Dex 文件
DVM is Register based which is designed to run on low memory, uses its own byte code and runs .Dex file
JVM 是基于堆栈的,它使用 java 字节码并运行具有 JIT 的 .class 文件.
JVM is Stack based which uses java byte code and runs .class file having JIT.
Java 源代码由 Java 编译器编译成 .class 文件.然后 dx (dexer) 工具,Android SDK 的一部分,将 .class 文件处理成包含 Dalvik 字节码的称为 DEX 的文件格式.dx 工具消除了类中存在的所有冗余信息.在 DEX 中,应用程序的所有类都打包到一个文件中.DVM 的设计使设备可以高效地运行 VM 的多个实例.
Java source code is compiled by the Java compiler into .class files. Then the dx (dexer) tool, part of the Android SDK processes the .class files into a file format called DEX that contains Dalvik bytecode. The dx tool eliminate all the redundant information that is present in the classes. In DEX all the classes of the application are packed into one file. DVM has been designed so that a device can run multiple instances of the VM efficiently.
基于堆栈的机器必须使用指令将数据加载到堆栈上并操作该数据,因此需要比寄存器机器更多的指令来实现相同的高级代码,但寄存器机器中的指令必须对源代码进行编码和目标寄存器,因此往往更大.
stack-based machines must use instructions to load data on the stack and manipulate that data, and, thus, require more instructions than register machines to implement the same high level code, but the instructions in a register machine must encode the source and destination registers and, therefore, tend to be larger.
这篇关于DVM和JVM有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:DVM和JVM有什么区别?
基础教程推荐
- 降序排序:Java Map 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01