Welcome, Guest. Please login or register.

Author Topic: What excatly is JIT emulation?  (Read 1778 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline TheMagicMTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2857
    • Show only replies by TheMagicM
    • http://www.BartonekDragRacing.com
What excatly is JIT emulation?
« on: August 10, 2003, 12:38:27 AM »
Is it basically a way to speed up 68k code to run on the host machine? (take MOS 1.4 w/JIT or UAE w/JIT)..this isnt a way to emulate the custom chipset right?
PowerMac G5 dual 2.0ghz/128meg Radeon/500gb HD/2GB RAM, MorphOS 3.9 registered, user #1900
Powerbook G4 5,6 1.67ghz/2gb RAM, Radeon 9700/250gb hd, MorphOS 3.9 registered #3143
 

Offline T_Bone

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5124
    • Show only replies by T_Bone
    • http://www.amiga.org/userinfo.php?uid=1961
Re: What excatly is JIT emulation?
« Reply #1 on: August 10, 2003, 12:41:23 AM »
It's a special type of emulation, instead of emulating instruction-by-instruction, the code is pre-translated to native and then run, making it faster than one-by-one emulation.

Repetative tasks speed up considerably as the code only needs to be translated once, rather than emulated over and over

Something like that anyway :_P
this space for rent
 

Offline TheMagicMTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2857
    • Show only replies by TheMagicM
    • http://www.BartonekDragRacing.com
Re: What excatly is JIT emulation?
« Reply #2 on: August 10, 2003, 12:41:47 AM »
thats what I thought.. thanks!!
PowerMac G5 dual 2.0ghz/128meg Radeon/500gb HD/2GB RAM, MorphOS 3.9 registered, user #1900
Powerbook G4 5,6 1.67ghz/2gb RAM, Radeon 9700/250gb hd, MorphOS 3.9 registered #3143
 

Offline tonyw

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 553
    • Show only replies by tonyw
Re: What excatly is JIT emulation?
« Reply #3 on: August 10, 2003, 02:05:41 AM »
As T-Bone said, it's translated just once and the resulting translated code is stored in memory until it's needed again (like for subsequent calls to the same function). So next time that function is called, it'll be much faster.

Comparing interpreted code with JIT, a JIT is usually about ten times as fast. Certainly in the Kaffe Java virtual machine, the JIT is ten times as fast as the interpreter. What would be good then would be to write the translated code out to a sharable Amiga-like library, so that it doesn't have to be translated again. I don't think any one does this yet.

tony


 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: What excatly is JIT emulation?
« Reply #4 on: August 10, 2003, 02:20:50 AM »
@tony

As far as I know, the problem with saving off code is down to the nature in which it is transcripted.

Transcription generally works on a block granularity even smaller than individual functions in many cases.

Many addresses etc. are present in the transcripted code that depend on the current machine state and would be meaningless were the code saved and reloaded later.

Even during a single session, transcripted code occasionally becomes stale (much like an instruction cache in a real processor) requiring re transcription. Things like patching functions etc will change code that may have been transcripted already and require transcriptig again.

For pure vm systems like Java, the above issues are virtually non existant - its pretty much possible to trasncript java code in a class once (while it loads usually) since it never uses absolute addresses for anything and never modifies its own code etc..

Unfortunatley, JIT emulations of real CPU's such as the 68K are considerably more complex.
int p; // A