Presentation is loading. Please wait.

Presentation is loading. Please wait.

Extensible virtual machines Tim Harris. Extensible virtual machines Policy decisions can often be separated (safely) from implementation mechanisms Thread.

Similar presentations


Presentation on theme: "Extensible virtual machines Tim Harris. Extensible virtual machines Policy decisions can often be separated (safely) from implementation mechanisms Thread."— Presentation transcript:

1 Extensible virtual machines Tim Harris

2 Extensible virtual machines Policy decisions can often be separated (safely) from implementation mechanisms Thread scheduling Object representation Primitive operations Run-time code generation One size does not fit all

3 Motivating example Object placement in the heap Safety requires the objects are stored in correctly-sized blocks of memory that are not already in use May wish to control Where instances of different classes are stored Where instances allocated by different threads are stored Which free block is chosen, if there is a choice When the heap is expanded and when collection occurs

4 Prototype XVM design >>> < Operations available to application Machine A Machine B Machine C >> Instance of code module Interface

5 Ensuring safety At a coarse level, the selection of implementation machines and pre-defined modules available can be limited At a finer granularity, modules provide descriptions of their verification-time behavior in addition to their concrete implementation

6 Ensuring safety push arg(1)[1] ’enter dup add [2] ’push_key HAS_PARITY ’push_id 0 ’make_key 2 ’push_val PARITY, EVEN ’make_val 1 ’define Start RT: [] VT: [] RT: [1 ] VT: [] (HAS_TYPE, 1 )  (INT ) RT: [2 ] VT: [] (HAS_TYPE, 1 )  (INT ) (HAS_TYPE, 2 )  (INT ) (HAS_PARITY, 2 )  (EVEN )

7 Contact details tim.harris@cl.cam.ac.uk http://www.cl.cam.ac.uk/~tlh20

8 Machine definition.define_machine extended, core, {.load_modules combine, core-wrappers;.instantiate module (combine), magnitude;.instantiate module (core-wrappers), core-wrappers;.plumb provided (instance (core-wrappers), mul_binary_op), required (instance (magnitude), to_each);.plumb provided (instance (core-wrappers), add_binary_op), required (instance (magnitude), to_results);.alias_operation instance(magnitude), binary_op, op, mag; };

9 Interface definition.define_interface binary_op, {.specify_operation op, in_immediate (), in_stack (x, y), out_stack (z), in_condition (precisely (key (HAS_TYPE, x), val (cpo (PRIMITIVE_TYPE, INT)), core), precisely (key (HAS_TYPE, y), val (cpo (PRIMITIVE_TYPE, INT)), core)), out_condition (precisely (key (HAS_TYPE, z), val (cpo (PRIMITIVE_TYPE, INT)), core)); };

10 Module definition.define_module combine, machine (core), {.present_interface interface (binary_op), binary_op;.require_interface interface (binary_op), to_each;.require_interface interface (binary_op), to_results;.alias_operation port (to_each), op, each_op;.alias_operation port (to_results), op, combine_op;.define_operation port (binary_op), op, { dup; each_op; roll int(2), int(1); dup; each_op; combine_op; };


Download ppt "Extensible virtual machines Tim Harris. Extensible virtual machines Policy decisions can often be separated (safely) from implementation mechanisms Thread."

Similar presentations


Ads by Google