05.08.2014 Views

here - Stefan-Marr.de

here - Stefan-Marr.de

here - Stefan-Marr.de

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7. Implementation Approaches<br />

method and its dynamic extent have to be executed in unenforced mo<strong>de</strong>. If<br />

the bit is not set, the execution mo<strong>de</strong> of enforced or unenforced execution<br />

remains unchanged on method activation.<br />

Table 7.1.: RoarVM+OMOP Method Hea<strong>de</strong>r: bit 30 is used to force unenforced<br />

method execution.<br />

UN P. #args #temporaries FS #literals Primitive 1<br />

31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0<br />

VM Interface Since part of the functionality is represented in the VM, and<br />

part is represented in the Smalltalk image, both have to agree on a common<br />

interface.<br />

Intercession Handlers To enable the VM to invoke the intercession handlers,<br />

it requires knowledge about the corresponding selectors. A common strategy<br />

for such a case in Smalltalk VMs is the use of the specialObjectsArray. All<br />

objects or classes the VM needs to be aware of are registered in this array<br />

at a pre<strong>de</strong>termined in<strong>de</strong>x. Similarly, the selectors for the intercession handlers<br />

are enco<strong>de</strong>d as an array that is referenced from a fixed in<strong>de</strong>x of this<br />

specialObjectsArray.<br />

The indices into the selector array are enco<strong>de</strong>d in a hea<strong>de</strong>r file of the VM.<br />

This hea<strong>de</strong>r file is generated by the image together with the array, but the VM<br />

needs to be recompiled whenever the hea<strong>de</strong>r and the array change.<br />

Customization Constant The generated VM hea<strong>de</strong>r file also enco<strong>de</strong>s the bit<br />

masks corresponding to the intercession points, which enable a <strong>de</strong>coding of<br />

the customization constant of a domain to <strong>de</strong>termine whether the domain<br />

requires the intercession point to be taken. The image itself uses a consistency<br />

check to verify that <strong>de</strong>coding of the customization is done correctly by both<br />

VM and image. The customization constant itself is enco<strong>de</strong>d in each domain<br />

object in the field: domainCustomizations.<br />

Initial Owner of Objects The domain objects have also a field to <strong>de</strong>note the<br />

initial owner for newly created objects (initialDomainForNewObjects). Thus,<br />

the VM can directly <strong>de</strong>termine the new owner without the need for executing<br />

196

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!