FACTOID # 113: In Denmark, more than 50% of the tax collected is personal income tax. In the Netherlands, personal income tax makes up less than 15%.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Dynamic recompilation

In computer science, dynamic recompilation (sometimes abbreviated to dynarec) 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 perhaps produce more efficient code by exploiting information that is not available to a traditional static compiler. Computer science, or computing science, is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. ... An emulator reproducing a console games playable atmosphere on a Windows computer. ... In computer science, a virtual machine is software that creates a virtualized environment between the computer platform and its operating system, so that the end user can operate software on an abstract machine. ... It has been suggested that this article or section be merged with Compile (software company). ... A computer program is a collection of instructions that describe a task, or set of tasks, to be carried out by a computer. ... In communications, a code is a rule for converting a piece of information (for example, a letter, word, or phrase) into another form or representation, not necessarily of the same type. ... This article is about the computing term. ...


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, Corn or CLR bytecodes. Full-speed debuggers could also utilize it to reduce the space overhead incurred in most Deoptimization techniques, and many other features such as dynamic thread migration. Adaptive optimization is a technique in computer science that performs dynamic recompilation of portions of a program based on the current execution profile. ... Java is an object-oriented programming language developed by Sun Microsystems in the early 1990s. ... The Common Language Runtime (CLR) is the virtual machine component of Microsofts . ...

Example

Suppose a program is being run in an emulator and needs to copy a null-terminated string.
The program is compiled originally for a very simple processor. This processor can only copy a byte at a time, and must do so by first reading it from the source string into a register, then writing it from that register into the destination string.
The original program might look something like this: In various branches of mathematics and computer science, strings are sequences of various simple objects (symbols, tokens, characters, etc. ... In computer science a byte is a ubiquitous unit of storage measurement. ... In computer architecture, a processor register is a small amount of very fast computer memory used to speed the execution of computer programs by providing quick access to commonly used values—typically, the values being in the midst of a calculation at a given point in time. ...

 beginning: mov A,[first string pointer] ;Put location of first character of source string ;in register A mov B,[second string pointer] ;Put location of first character of destination string ;in register B loop: mov C,[A] ;Copy byte at address in register A to register C mov [B],C ;Copy byte in register C to the address in register B cmp C,#0 ;Compare the data we just copied to 0 (string end marker) inc A ;Increment the address in register A to point to ;the next byte inc B ;Increment the address in register B to point to ;the next byte jnz loop ;If it wasn't 0 then we have more to copy, so go back ;and copy the next byte end: ;If we didn't loop then we must have finished, ;so carry on with something else. 

The emulator might be running on a processor which is similar, but extremely good at copying strings, and the emulator knows it can take advantage of this.


It might recognize the string copy sequence of instructions and decide to rewrite them more efficiently just before execution, to speed up the emulation.


Say there is an instruction on our new processor called movs, specifically designed to copy strings efficiently. Our theoretical movs instruction copies 16 bytes at a time, without having to load them into register C in between, but will stop if it copies a 0 byte (which marks the end of a string) and set the zero flag. It also knows that the addresses of the strings will be in registers A and B, so it increments A and B by 16 every time it executes, ready for the next copy. Our new recompiled code might look something like this:

 beginning: mov A,[first string pointer] ;Put location of first character of source string ;in register A mov B,[second string pointer] ;Put location of first character of destination string ;in register B loop: movs [B],[A] ;Copy 16 bytes at address in register A to address ;in register B, then increment A and B by 16 jnz loop ;If the zero flag isn't set then we haven't reached ;the end of the string, so go back and copy some more. end: ;If we didn't loop then we must have finished, ;so carry on with something else. 

There is an immediate speed benefit simply because the processor doesn't have to load so many instructions to do the same task, but also because the movs instruction is likely to be optimized by the processor designer to be more efficient than the sequence used in the first example (for example it may make better use of parallel execution in the processor to increment A and B while it is still copying bytes). Parallel computing is the simultaneous execution of the same task (split up and specially adapted) on multiple processors in order to obtain results faster. ...


In an ironic twist in real world usage, the first sequence of instructions (RISC) is generally preferred over the next (CISC). The reasons provided are slow CISC processor execution, prevention of pipeline stalls, and lower hardware overheads. Reduced Instruction Set Computer (RISC), is a microprocessor CPU design philosophy that favors a smaller and simpler set of instructions that all take about the same amount of time to execute. ... A Complex Instruction Set Computer (CISC) is an instruction set architecture (ISA) in which each instruction can indicate several low-level operations, such as a load from memory, an arithmetic operation, and a memory store, all in a single instruction. ...


Products using dynamic recompilation

  • Many Java virtual machines feature dynamic recompilation.
  • Apple's new Rosetta for Mac OS X on x86, allows PowerPC code to be run on the x86 architecture.
  • The emulator used in Mac OS to run 680x0 code on the PowerPC hardware.
  • Psyco, a specializing compiler for Python.
  • The HP Dynamo project, an example of a transparent binary dynamic optimizer.
  • The VX32 virtual machine employs dynamic recompilation to create OS-independent x86-architecture sandboxes for safe application plug-ins.
  • Virtual PC for Mac, used to run x86 code on PowerPC.
  • QEMU, an open-source full system emulator.
  • The backwards compatibility functionality of the Xbox 360 (i.e. running games written for the original Xbox) is widely assumed to use dynamic recompilation.
  • DGD, an LPC server for muds and beyond, supports dynamic recompilation of objects, thereby allowing fully persistent systems to evolve over time.

A Java Virtual Machine (JVM), originally developed by Sun Microsystems, is a virtual machine that executes Java bytecode. ... Rosetta is a lightweight dynamic translation emulator for Mac OS X distributed by Apple. ... The Mac 68K emulator was a software emulator built into all versions of the Mac OS for PowerPC. This emulator permitted the running of applications and system code that were originally written for the 680x0 based Macintosh models. ... This article or section does not cite its references or sources. ... The Motorola 680x0, 0x0, m68k, or 68k family of CISC microprocessor CPU chips were 32_bit from the start, and were the primary competition for the Intel x86 family of chips. ... IBM PowerPC 601 Microprocessor PowerPC is a RISC microprocessor architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM. Originally intended for personal computers, PowerPC CPUs have since become popular embedded and high-performance processors as well. ... Psyco is a specializing compiler / just-in-time compiler for Python. ... In computer science, run-time algorithm specialisation is a methodology for creating efficient algorithms for costly computation tasks of certain kinds. ... Python is a programming language created by Guido van Rossum in 1990. ... Look up optimization in Wiktionary, the free dictionary. ... The VX32 virtual extension environment is an application-level virtual machine implemented as an ordinary user-mode library and designed to run native x86 code. ... An operating system (OS) is a computer program that manages the hardware and software resources of a computer. ... x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ... A plugin (or plug-in) is a computer program that interacts with a main (or host) application (a web browser or an email program, for example) to provide a certain, usually very specific, function on-demand. ... Virtual PC is a virtualization suite for Apple Mac OS X and Microsoft Windows operating systems, originally created by Connectix, subsequently acquired by Microsoft. ... x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ... It has been suggested that Qemu-Launcher be merged into this article or section. ... The Xbox 360 is the successor to Microsofts Xbox video game console, developed in cooperation with IBM, ATI, Samsung and SiS. Information on the console first came through viral marketing campaigns and it was officially unveiled on MTV on May 12, 2005, with detailed launch and game information divulged... Xbox is a sixth generation era video game console produced by Microsoft Corporation. ... DGD (Dworkins Game Driver) is an object-oriented programmable MUD engine which is primarily used together with a mudlib to host online roleplaying games. ... The LPC programming language is an object-oriented programming language derived from C and developed by Lars Pensjö to facilitate MUD building on LPMuds. ...

External links

  • [1] HP Labs' technical report on Dynamo

  Results from FactBites:
 
Dynamic recompilation - Wikipedia, the free encyclopedia (259 words)
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.
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, Corn or CLR bytecodes.
The emulator used in Mac OS to run 680x0 code on the PowerPC hardware was a dynamically recompiling emulator.
Binary translation (258 words)
Alternatively, dynamic translation looks at a short sequence of code, typically on the order of a single basic block, translates it and caches the resulting sequence.
Dynamic binary translation differs from simple emulation by eliminating the emulator's main read-decode-execute loop (a major performance bottleneck), paying for this by large overhead during translation time.
More advanced dynamic translators employ dynamic recompilation: the translated code is instrumented to find out what portions are executed a large number of time, and these portions are optimized aggressively.
  More results at FactBites »


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 0825, t