Efficient and Language-Independent Mobile Programs
Notes by Zhiyuan Chen, April 13,98
Objective
The paper presents Omni-ware, a safe, efficient and language independent system for
executing mobile program. Previous approaches rely on language semantics or abstract
machine interpretation to achieve safety. But the former case is not language independent
and the latter case is not efficient. Omniware achieves the requirements by:
- Safety is achieved by software fault isolation, which uses only the semantics of the
underlying processor to determine safety.
- 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.
- To achieve language independence, source code is compiled to OmniVM instructions. Then
they are translated to host specific executable. Safety check is executed at the same
time.
- Efficiency is 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.
Choices
- RISC based VM instruction set. Advantages: simplify compiler implementation; give source
language compiler more opportunity for optimization because more information (such as data
layout) is known to the compiler. So, translator only needs to do straightforward code
generation and machine dependent optimizations.
- Defines the size of primitive data types in VM. Enables 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 impressive, only 21% overhead.
- Possible sources of overhead.
- Safety: 10%.
- Differences in VM and target instruction sets. Only 40 - 70% expansion of instructions.
- Global optimizations. To improve, add global optimizations in translation phase.
- Machine-dependent optimizations. To improve, add instruction shedding optimization and
global pointer in translation phase.
Discussion
- The author claims an order of performance improvement over abstract machine approach.
However, how much the improvement should be due to optimization? No performance comparison
to not optimized cases.
- Comparison with other VM approach? For example, Java.
- Convenience. Although author declares language independent property, user needs language
dependent compiler targeted to OmniVM. Script language is more convenient in many cases.
- It seems that all possible optimizations left should be implemented in translation
phase. So it is still a tradeoff.