here - Stefan-Marr.de
here - Stefan-Marr.de
here - Stefan-Marr.de
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
7.3. Summary<br />
the RoarVM, primitives are executed on the current context object, which<br />
is different from normal method activations, which are done in their own<br />
context object. When primitive execution is intercepted by the domain, the<br />
RoarVM+OMOP cannot provi<strong>de</strong> the same semantics. An intercession handler<br />
executes in its own context object, i. e., stack frame, and consequently if it<br />
invokes the primitive, it executes on the handler’s stack frame instead of the<br />
stack frame it has originally been invoked in. One example w<strong>here</strong> that matters<br />
is a primitive that implements loops in SOM. It resets the instruction<br />
pointer in the context object to achieve looping. In the RoarVM+OMOP, this<br />
is not possible. However, while this <strong>de</strong>sign restricts what primitives can implement,<br />
it is not a practical issue for the RoarVM co<strong>de</strong>base. The co<strong>de</strong>base<br />
does not contain primitives that use the context objects in problematic ways,<br />
even though the co<strong>de</strong>base inclu<strong>de</strong>s the plugins reused from Squeak and the<br />
CogVM (cf. Sec. 4.4). The primitives merely work on the parameters provi<strong>de</strong>d<br />
to them and restrict access to the context object to the corresponding stack<br />
operations. Thus, the RoarVM+OMOP did not need to solve this limitation<br />
and it is assumed that it does not pose a problem in practice.<br />
7.3. Summary<br />
This chapter presented two implementation approaches for the OMOP. It <strong>de</strong>tails<br />
for each of the approaches how the mechanisms of the OMOP are realized<br />
and how the requirements are fulfilled.<br />
The AST-OMOP is based on AST transformation and operates on top of the<br />
VM without requiring changes to it. The transformations add the necessary<br />
operations to trigger the OMOP’s intercession handlers, e. g., on method execution,<br />
access to object fields or globals, or to intercept primitives. The AST-<br />
OMOP was the first prototype to investigate the i<strong>de</strong>as of using a metaobject<br />
protocol and to build the case studies on top, i. e., the AmbientTalkST and the<br />
LRSTM implementation. Thus, the AST-OMOP facilitated the evaluation of<br />
part of the thesis statement without requiring changes to the VM.<br />
The RoarVM+OMOP is the implementation that is used to evaluate the<br />
performance part of the thesis statement. It adapts a byteco<strong>de</strong> interpreter to<br />
directly support the OMOP. The byteco<strong>de</strong> and primitive implementations are<br />
changed to trigger the OMOP’s intercession handlers instead of performing<br />
their original operations if execution is performed enforced, and if the corresponding<br />
intercession handler has been customized. The check whether the<br />
intercession handler is customized is a simple optimization that facilitates<br />
<strong>de</strong>bugging.<br />
199