Efficient and Language-Independent Mobile Programs
Notes by Zhiyuan Chen, April 13,98
Minor Modifications by Vicky Weissman, April 1999
Objective
The paper presents Omni-ware, a safe, language independent system for
executing mobile program. Previous approaches rely on language semantics or abstract
machine interpretation to achieve safety. The former direction, however, is not language independent
and the latter case is not efficient. Omniware achieves both efficiency and language independence in
the following manner:
- General Strategy: An Omniware virtual machine implements virtual instructions, virtual memory management,
and a virtual exception model. It has a segmented address space and enforces host-imposed
permissions on access to this address space and delivers an access violation exception to
the module whenever it makes an unauthorized attempt to access a memory segment.
- Safety: Achieved by software fault isolation. This technique uses only the semantics of the
underlying processor to determine safety.
- Efficiency: Achieved by the doing most work before loading. OmniVM implements a
RISC-based instruction set, which ennobles a lot of machine-independent optimization being
executed at compile time. Further optimization is executed after translation phase.
- Language Independence: Source code is compiled to OmniVM instructions. Then
it is translated to a host specific executable. (At the same time, safety check is executed.)
Design Decisions
- RISC based VM instruction set. This choice simplifies compiler implementation, while giving the source
language compiler more opportunity for optimization. Since more information (such as data
layout) is known to the compiler, the optimizations are good without requiring the translator to do more than
straightforward code generation and machine dependent optimizations.
- Size of primitive data types defined in VM. This enables the compiler to know the data layout
and generate address arithmetic code.
- Generalizes memory access (32 bit immediate offsets) and compare-and-branch
instructions so that less host instructions need to generated for each VM instruction.
Performance
- Overall performance is approx. the same as native code generated by gcc and is roughly 20%
slower than native code generated from cc compilers.
- Main sources of overhead.
- Safety: 10%.
- Differences in VM and target instruction sets. (40 - 70% expansion of instructions)
- Global optimizations in translation phase still need to be done.
- Machine-dependent optimizations sill need to be done.
Discussion
- The author claims an order of performance improvement over abstract machine approach.
How much of the improvement is be due to optimization? Paper does not provide any performance
comparison to non-optimized cases.
- Comparison with other VM approachs?
- Convenience. Although author declares language independent property, user needs language
dependent compiler targeted to OmniVM. Script language is more convenient in many cases.
- All remaining optimizations should be implemented in the translation
phase. This is a tradeoff.