„Dalvik“: Munur á milli breytinga

Efni eytt Efni bætt við
Ásgeir IV. (spjall | framlög)
Ný síða: {{Hugbúnaður |nafn = Dalvik |lógó = |skjáskot = |myndatexti = |höfundur = |hönnuður = Dan Bornstein |útgáfudagur = |nýjasta útgáfa = |nýjasti útgáfudagur = |nýjasta for...
(Enginn munur)

Útgáfa síðunnar 26. september 2010 kl. 18:10

Dalvik er heiti sýndarvélar Android-stýrikerfisins frá Google. Dalvik er innbyggður hluti Android, sem er aðallega notað í meðbærum tækjum svo sem farsímum, töflutölvum og netfartölvum. Áður en Android-forrit eru keyrð, er þeim breytt yfir á hið samþjappaða Dalvik Executable (.dex)-snið, sem er hannað fyrir kerfi með takmarkað vinnsluminni og örgjörvahraða.

Dalvik
HönnuðurDan Bornstein
StýrikerfiLinux
VerkvangurAndroid
Notkun Sýndarvél
LeyfiApache License 2.0
Vefsíða

Dalvik-sýndarvélin er, eins og Android að öðru leyti, opinn hugbúnaður. Upprunalegur höfundur hennar er Dan Bornstein, sem nefndi hana eftir bænum Dalvík þaðan sem hann er ættaður að langfeðgatali.[1][2]

Bygging

Unlike most virtual machines and true Java VMs which are stack machines, the Dalvik VM is a register-based architecture.

Ólíkt flestum sýndarvélum og sönnum Java-sýndarvélum sem eru staflavélar, er Dalvik-sýndarvélin skráarvél.

The relative merits of stack machines vs. register-based approaches is a subject of ongoing debate.

Skiptar skoðanir eru um hvor gerðin, staflavélar eða skráarvélar, hefur fleiri kosti[3] Generally, 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. This difference is primarily of importance to VM interpreters for whom opcode dispatch tends to be expensive along with other factors similarly relevant to JIT compilation.

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 alternate 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.[4]

The Dalvik executables may be modified again when they get 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[5].

Being optimized for low memory requirements, Dalvik has some specific characteristics that differentiate it from other standard VMs:[6]

Moreover, Dalvik has been designed so that a device can run multiple instances of the VM efficiently.[7]

Tilvísanir

  1. Dagbókarfærsla sem tilgreinir tilkomu heitisins
  2. „Google Calling: Inside Android, the gPhone SDK“. onlamp.com. Sótt 5. febrúar 2008.
  3. Shi, Yunhe; Gregg, David; Beatty, Andrew; Ertl, M. Anton (11. júní 2005). „Virtual Machine Showdown: Stack Versus Registers“ (PDF). Sótt 22. desember 2009.
  4. Bornstein, Dan (29. maí 2008). „Presentation of Dalvik VM Internals“ (PDF). Google. bls. 22. Sótt 16. ágúst 2010.
  5. „Nexus One Is Running Android 2.2 Froyo. How Fast Is It Compared To 2.1? Oh, Only About 450% Faster“. 13. maí 2010. Sótt 21. maí 2010.
  6. Rose, John (31. maí 2008). „with Android and Dalvik at Google I/O“. Sótt 8. júní 2008.
  7. Google (13. apríl 2009). „What is Android?“. Sótt 19. apríl 2009.