Dalvik+virtual+machine

[|Dalvik (software)][|From Wikipedia, the free encyclopedia]

Jump to: navigation, search Dalvik||~ Original author(s)
 * Dan Bornstein ||
 * ~ Operating system || Linux kernel ||
 * ~ Platform || Android ||
 * ~ Type || Virtual machine ||
 * ~ License || Apache License 2.0 ||
 * ~ Website || [|code.google.com/p/dalvik] ||

Dalvik Executable||~ Filename extension Dalvik is open-source software. It was originally written by Dan Bornstein, who named it after the fishing village of Dalvík in Eyjafjörður, Iceland, where some of his ancestors lived.[
 * .dex ||
 * Dalvik** is the process virtual machine (VM) in Google's Android operating system. It is the software that runs the apps on Android devices. Dalvik is thus an integral part of Android, which is typically used on mobile devices such as mobile phones and tablet computers. Programs are commonly written in Java and compiled to bytecode. They are then converted from Java Virtual Machine-compatible .class files to Dalvik-compatible .dex (Dalvik Executable) files before installation on a device. The compact Dalvik Executable format is designed to be suitable for systems that are constrained in terms of memory and processor speed.

Architecture Architecture Diagram Unlike Java VMs, which are stack machines, the Dalvik VM is a register-based architecture. A tool called **dx** is used to convert some (but not all) Java .class files into the .dex format. Multiple classes are included in a single .dex file. Duplicate strings and other constants used in multiple class files are included only once in the .dex output to conserve space. Java bytecode is also converted into an alternative instruction set used by the Dalvik VM. An uncompressed .dex file is typically a few percent smaller in size than a compressed .jar (Java Archive) derived from the same .class files.[3home] The Dalvik executables may be modified again when installed onto a mobile device. In order to gain further optimizations, byte order may be swapped in certain data, simple data structures and function libraries may be linked inline, and empty class objects may be short-circuited, for example. As of Android 2.2, Dalvik has a just-in-time compiler.[4home] Being optimized for low memory requirements, Dalvik has some specific characteristics that differentiate it from other standard VMs:[5home] Moreover, according to Google, Dalvik has been designed so that a device can run multiple instances of the VM efficiently.[
 * The VM was slimmed down to use less space
 * The constant pool has been modified to use only 32-bit indices to simplify the interpreter
 * Standard Java bytecode executes 8-bit stack instructions. Local variables must be copied to or from the operand stack by separate instructions. Dalvik instead uses its own 16-bit instruction set that works directly on local variables. The local variable is commonly picked by a 4-bit 'virtual register' field. This lowers Dalvik's instruction count and raises its interpreter speed.