1 / 10

Extensible virtual machines Tim Harris

Extensible virtual machines Tim Harris. 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. Motivating example.

oren
Download Presentation

Extensible virtual machines Tim Harris

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Extensible virtual machinesTim 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 > > Machine A Machine B Interface Instance of code module Operations available to application < Machine C > > >

  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 Start RT: [] VT: [] push arg(1) [1]’enter <Op-0x805fe38> RT: [1] VT: [] (HAS_TYPE, 1)  (INT) dup add [2] ’push_key HAS_PARITY ’push_id 0 ’make_key 2 ’push_val PARITY, EVEN ’make_val 1 ’define 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; }; };

More Related