View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Case Final Project Summer 2007

Sum02 Final Exam Review: Virtual Machines

Edit Sum02 Final Exam Review: Virtual Machines here.

a. give three reasons why it may make sense to use a virtual machine instead of native code in an application or device.

portability: code on a vm on one device can be easily transported to a vm on another device. reuse: the common functionality in software would have to be written k times for k different devices, and this is unproductive. debugging: code on a vm can be tested rigorously without having to run on the device. this is especially important if the device is say, a satellite. one would like to run the code on a vm that sits on a simulator of the device, so that catastrophic errors don't result in even more catastrophic costs. alan fay
I would also mention memory protection through automatic allocationa and garbage collection. luke

in addition I submit
(1)for every new platform it's easier to port–you only have to rewrite the bytecode->assembly translator, instead of the whole compiler.
(2)separation from the machine means that your system is more secure.
(3)"easier to create reflexive programs" whatever that means.
(4)Often can be more memory efficient, depending on application. Batman



Good. There are more. Barbara Ericson

More? above is the sum total of what was in my notes and on the lecture slides I do hope we won't be expected to know all of those. . . Batman


b. identify two features of the Java HotSpot and Squeak virtual machines that are common between them, and two other features that are different.

Java and Squeak share similar garbage collection techniques. They are also both stack-based. However, Java is faster than Squeak, and has types (Squeak does not) - Jim McPherson

c. what takes up the majority of code (and probably execution time) in a primitive written for a virtual machine?

Translation of code-specific primitives to machine-specific terminology. Especially with Squeak, where there is no type assignment; the VM must translate the primitive based on context, a time consuming process no matter how ya slice it. Nigel O'Rear

Not quite, I was thinking more like boxing and unboxing. Barbara Ericson

Links to this Page