Details

Izdelava JIT prevajalnika za navidezni stroj Pins25
ID Belič, Denis (Author), ID Slivnik, Boštjan (Mentor) More about this mentor... This link opens in a new window

.pdfPDF - Presentation file, Download (407,72 KB)
MD5: 11CCA456500767A7EBEAD788D415B188

Abstract
Tolmačenje vmesne kode omogoča izvajanje istega programa na različnih računalniških sistemih, vendar vsak izvedeni ukaz spremlja strošek tolmaške zanke. V diplomskem delu smo zato za skladovni navidezni stroj Pins25 izdelali preprost sprotni prevajalnik (angl. just-in-time compiler). Obstoječi prevajalnik in navidezni stroj Pins25 sta napisana v Javi. Prevajalnik smo razširili tako, da vmesno kodo in podatke zapiše v binarno objektno datoteko, za njeno izvajanje pa smo v jeziku C implementirali nalagalnik, tolmač ter infrastrukturo za profiliranje in izvajanje strojne kode. Izvajalno okolje pri vsakem klicu funkcije beleži število klicev, med izvajanjem funkcije pa tudi število vzvratnih skokov. Ko eden od števcev doseže izbrani prag, izvajalno okolje funkcijo analizira in njene ukaze neposredno prevede v strojne ukaze x86-64. Tolmačene in prevedene funkcije uporabljajo isti pomnilnik, sklad in obliko klicnih zapisov, zato se lahko med seboj kličejo tudi rekurzivno. Prototip podpira celoten nabor ukazov Pins25. Ovrednotenje pokaže, da sprotno prevajanje koristi predvsem daljšim programom, pri kratkih pa stroški profiliranja in prevajanja večinoma izničijo pridobljeno pohitritev. Na učinkovitost poleg trajanja vplivajo tudi vzorec klicev, krmilni tok in prehodi v izvajalno okolje.

Language:Slovenian
Keywords:navidezni stroj, tolmač, sprotno prevajanje, dinamično profiliranje, x86-64
Work type:Bachelor thesis/paper
Organization:FRI - Faculty of Computer and Information Science
Year:2026
PID:20.500.12556/RUL-187356 This link opens in a new window
Publication date in RUL:10.09.2026
Views:84
Downloads:14
Metadata:XML DC-XML DC-RDF
:
Copy citation
Share:Bookmark and Share

Secondary language

Language:English
Title:Implementation of a JIT Compiler for the Pins25 Virtual Machine
Abstract:
Interpreting intermediate code allows the same program to run on different computer systems, but every executed instruction incurs the overhead of the interpreter loop. In this thesis, we developed a simple just-in-time compiler for the stack-based Pins25 virtual machine. The existing Pins25 compiler and virtual machine are implemented in Java. We extended the compiler to store intermediate code and data in a binary object file, and implemented a loader, interpreter, profiling infrastructure, and runtime support for generated machine code in C. On every function call, the runtime records the call count and, during function execution, the number of backward jumps. When either counter reaches a selected threshold, the runtime analyses the function and directly translates its instructions into x86-64 machine code. Interpreted and compiled functions share the same memory, stack, and call-frame representation, allowing arbitrary and recursive calls between both execution modes. The prototype supports the complete Pins25 instruction set. The evaluation shows that just-in-time compilation primarily benefits longer-running programs, whereas for short programs the profiling and compilation overhead largely offsets the resulting speedup. Performance also depends on call patterns, control flow, and transitions into the runtime.

Keywords:virtual machine, interpreter, just-in-time compilation, JIT, x86-64

Similar documents

Similar works from RUL:
Similar works from other Slovenian collections:

Back