Dynamic recompilation

Last updated

In computer science, dynamic recompilation is a feature of some emulators and virtual machines, where the system may recompile some part of a program during execution. By compiling during execution, the system can tailor the generated code to reflect the program's run-time environment, and potentially produce more efficient code by exploiting information that is not available to a traditional static compiler.

Contents

Uses

Most dynamic recompilers are used to convert machine code between architectures at runtime. This is a task often needed in the emulation of legacy gaming platforms. In other cases, a system may employ dynamic recompilation as part of an adaptive optimization strategy to execute a portable program representation such as Java or .NET Common Language Runtime bytecodes. Full-speed debuggers also utilize dynamic recompilation to reduce the space overhead incurred in most deoptimization techniques, and other features such as dynamic thread migration.

Tasks

The main tasks a dynamic recompiler has to perform are:

A dynamic recompiler may also perform some auxiliary tasks:

Applications

Emulators

See also

Related Research Articles

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

Bytecode is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references that encode the result of compiler parsing and performing semantic analysis of things like type, scope, and nesting depths of program objects.

In software engineering, porting is the process of adapting software for the purpose of achieving some form of execution in a computing environment that is different from the one that a given program was originally designed for. The term is also used when software/hardware is changed to make them usable in different environments.

In computing, binary translation is a form of binary recompilation where sequences of instructions are translated from a source instruction set to the target instruction set. In some cases such as instruction set simulation, the target instruction set may be the same as the source instruction set, providing testing and debugging features such as instruction trace, conditional breakpoints and hot spot detection.

In computing, just-in-time (JIT) compilation is compilation during execution of a program rather than before execution. This may consist of source code translation but is more commonly bytecode translation to machine code, which is then executed directly. A system implementing a JIT compiler typically continuously analyses the code being executed and identifies parts of the code where the speedup gained from compilation or recompilation would outweigh the overhead of compiling that code.

The Mac 68k emulator is a software emulator built into all versions of the classic Mac OS for PowerPC. This emulator enabled running applications and system code that were originally written for the 680x0-based Macintosh models. With a few exceptions, notably Connectix's RAM Doubler, the emulator ran all software with no noticeable impact other than lower performance relative to the same program when compiled for PowerPC.

A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on an Android smartphone is a cross compiler.

In software engineering, a compatibility layer is an interface that allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system calls for the host system. With some libraries for the foreign system, this will often be sufficient to run foreign binaries on the host system. A hardware compatibility layer consists of tools that allow hardware emulation.

Star Trek is the code name that was given to a secret prototype project, running a port of Macintosh System 7 and its applications on Intel-compatible x86 personal computers. The project, starting in February 1992, was conceived in collaboration between Apple Computer, who provided the majority of engineers, and Novell, who at the time was one of the leaders of cross-platform file-servers. The plan was that Novell would market the resulting OS as a challenge to Microsoft Windows, but the project was discontinued in 1993 and never released, although components were reused in other projects. The project was named after the Star Trek science fiction franchise with the slogan "To boldly go where no Mac has gone before".

A fat binary is a computer executable program or library which has been expanded with code native to multiple instruction sets which can consequently be run on multiple processor types. This results in a file larger than a normal one-architecture binary file, thus the name.

Dynamic compilation is a process used by some programming language implementations to gain performance during program execution. Although the technique originated in Smalltalk, the best-known language that uses this technique is Java. Since the machine code emitted by a dynamic compiler is constructed and optimized at program runtime, the use of dynamic compilation enables optimizations for efficiency not available to statically-compiled programs except through code duplication or metaprogramming.

<span class="mw-page-title-main">QEMU</span> Free virtualization and emulation software

QEMU is a free and open-source emulator. It emulates a computer's processor through dynamic binary translation and provides a set of different hardware and device models for the machine, enabling it to run a variety of guest operating systems. It can interoperate with Kernel-based Virtual Machine (KVM) to run virtual machines at near-native speed. QEMU can also do emulation for user-level processes, allowing applications compiled for one architecture to run on another.

<span class="mw-page-title-main">Rosetta (software)</span> Operating system component

Rosetta is a dynamic binary translator developed by Apple Inc. for macOS, an application compatibility layer between different instruction set architectures. It enables a transition to newer hardware, by automatically translating software. The name is a reference to the Rosetta Stone, the artifact which enabled translation of Egyptian hieroglyphs.

The following is a timeline of virtualization development. In computing, virtualization is the use of a computer to simulate another computer. Through virtualization, a host simulates a guest by exposing virtual hardware devices, which may be done through software or by allowing access to a physical device connected to the machine.

In the context of computer programming, instrumentation refers to the measure of a product's performance, in order to diagnose errors and to write trace information. Instrumentation can be of two types: source instrumentation and binary instrumentation.

PowerVM Lx86 was a binary translation layer for IBM's System p servers. It enabled 32-bit x86 Linux binaries to run unmodified on the Power ISA-based hardware. IBM used this feature to migrate x86 Linux servers to the PowerVM virtualized environment; it was supported on all POWER5 and POWER6 hardware as well as BladeCenter JS21 and JS22 systems.

<span class="mw-page-title-main">Object code optimizer</span> Aspect of software compilation

An object code optimizer, sometimes also known as a post pass optimizer or, for small sections of code, peephole optimizer, forms part of a software compiler. It takes the output from the source language compile step - the object code or binary file - and tries to replace identifiable sections of the code with replacement code that is more algorithmically efficient.

<span class="mw-page-title-main">PPSSPP</span> PSP emulator

PPSSPP is a free and open-source PSP emulator for Windows, macOS, Linux, iOS, Android, Nintendo WiiU, Nintendo Switch, BlackBerry 10, MeeGo, Pandora, Xbox Series X/S and Symbian with an increased focus on speed and portability. It was first released to the public on November 1, 2012, licensed under the GNU GPLv2 or later. The PPSSPP project was created by Henrik Rydgård, one of the co-founders of the Dolphin emulator.

References

  1. "HP Labs' technical report on Dynamo". Archived from the original on 2008-07-07. Retrieved 2006-01-22.
  2. "DynamoRIO Dynamic Instrumentation Tool Platform". Archived from the original on 2019-09-05. Retrieved 2016-04-12.
  3. "DynamoRIO". GitHub . 2021-10-15.
  4. Paul, Matthias R.; Frinke, Axel C. (1997-10-13) [first published 1991], FreeKEYB - Enhanced DOS keyboard and console driver (User Manual) (v6.5 ed.)
  5. "PCSX 2". Archived from the original on 2005-10-29. Retrieved 2009-04-15.
  6. petebernert (2015-10-03). "GCemu". SourceForge.
  7. "Gameboy Emulator for MSX | The New Image". GEM. Retrieved 2014-01-12.
  8. "DeSmuME v0.9.9".
  9. Publicado por Carlos Ballesteros Velasco (2013-07-28). "Soywiz's PSP Emulator: Release : Soywiz's Psp Emulator 2013-07-28 (r525)". Pspemu.soywiz.com. Retrieved 2014-01-12.
  10. Mupen64Plus
  11. "SH2".
  12. "PPSSPP - PPSSPP - PSP emulator for Android, Windows, Linux, iOS, MacOSX". ppsspp.org. Retrieved 2021-11-17.