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.

4. Experimentation Platform<br />

Another reason for its choice are the experiments that were performed in<br />

addition to the work on this dissertation. Examples are the implementation<br />

of a pauseless garbage collector [Click et al., 2005] to avoid stop-the-world<br />

garbage collection pauses, 5 as well as a work-stealing scheduler to improve<br />

the performance of fine-grained parallelism. 6 Especially relevant for the work<br />

presented <strong>here</strong> was an experiment to use operating system processes instead<br />

of threads as the un<strong>de</strong>rlying abstraction to use multiple cores (cf. Sec. 4.4.3). 7<br />

These extensions to the RoarVM promise to be a good foundation to experiment<br />

with different optimizations (cf. Sec. 9.5.3).<br />

4.4.1. Execution Mo<strong>de</strong>l, Primitives, and Byteco<strong>de</strong>s<br />

This section discusses technical <strong>de</strong>tails that are relevant for the implementation<br />

of the OMOP and its performance evaluation.<br />

Execution Stack Representation Similarly to the execution mo<strong>de</strong>l of SOM,<br />

the RoarVM uses the classic Smalltalk-80 mo<strong>de</strong>l of context objects that represent<br />

stack frames. Each frame, i. e., context object is a standard Smalltalk<br />

object allocated on the heap and subject to garbage collection. They represent<br />

the method activation, the operand stack, and temporary variables. A context<br />

object also encapsulates the corresponding instruction and stack pointer. To<br />

reduce the pressure on the garbage collector (GC), context objects are cached<br />

and reused if possible, instead of leaving them for the GC.<br />

While using objects to represent the execution state enables for instance<br />

metaprogramming, it comes with a performance cost. To reduce that cost by<br />

avoiding frequent indirections on the context objects, part of the execution<br />

state such as instruction pointer and stack pointer are replicated in the interpreter<br />

object and maintained t<strong>here</strong>. The context object is only updated with<br />

the execution state when necessary. Thus, the execution state is written to the<br />

actual context object before garbage collection starts, before scheduling operations,<br />

such as resuming a processes or yielding execution, might change the<br />

currently active context, and before a message send activates the new context<br />

for its execution.<br />

Primitives and Quick Methods Primitives are used to implement functionality<br />

that cannot be implemented directly in Smalltalk or for functionality<br />

5 https://github.com/smarr/RoarVM/tree/features/parallel-garbage-collection<br />

6 https://github.com/smarr/RoarVM/tree/features/scheduler-per-interpreter<br />

7 https://github.com/smarr/RoarVM/tree/features/processes-on-x86<br />

102

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

Saved successfully!

Ooh no, something went wrong!