Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 7 developers from Canada and 18 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


ThyReaper

Member Since 16 Feb 2012
Offline Last Active Dec 02 2014 03:14 AM

Posts I've Made

In Topic: Yet another performance comparison (AS vs Small)

02 December 2014 - 02:46 AM

JIT

Regarding the Jit probably this is not the best place to ask, but I need some general information to understand if it can be applicable to my case.

Just a few questions if someone can give me a simple answer or redirect me to the available information ...

 

1) Does the JIT generate processor (x86 in my case) instructions, or it is some additional byte code optimization but still interpreted by a virtual machine?

 

2) In case real processor instructions are generated, I expect that they are first generated as data. So what is the method used to "jump" to the data? Nowadays processor normally disable data execution and only privileged instructions are allowed to change this.

 

3) Instead, in case only some internal optimization is done and not real processor instructions, what is the expected execution speed gain against the average script code?

 

1) It produces native x86 instructions with fallback to the VM under various conditions (some specific types of calls it can't handle natively, script exceptions, and any new ops that might be added since it was last updated).

 

2) The JIT requests a page from the OS which can be set to be executable. There is a rather simple class, CodePage, which is responsible for this allocation and can easily be changed. The JIT does expect that new code pages can be allocated dynamically, but a single large static page should be sufficient for most purposes. Jumping to the executable page is handled by the JIT instructions in the VM.

 

3) Native code runs between 2x and 10x faster depending on the exact code being executed and the architecture involved.


In Topic: Yet another performance comparison (AS vs Small)

28 November 2014 - 05:34 PM

That's my limited understanding as well, and I believe the JIT does satisfy that requirement as long as its allocator does as well (though that could be replaced with a suitable allocator if needed).


In Topic: Yet another performance comparison (AS vs Small)

27 November 2014 - 10:43 PM

If it would be possible for you to use our JIT, it would be fairly simple to add a custom line callback to it which caches the line number for each call. I'm not sure exactly what requirements exist for a real time program, but the JIT's behavior is simpler than most of what AngelScript's own compiler has to do.


In Topic: comparing handles via == and !=

13 November 2014 - 01:08 AM

Here's a brief explanation of the differences: 

Foo@ a, b;
Foo c;

//These compare the value of the referenced instances, typically via opCmp()
a == b;
a == c;
c == b;

//These compare handles (pointers) for equality
@a == @b;
a is b;
a is c;

In Topic: BMS JIT crashes during script compilation

27 October 2014 - 04:06 PM

Fixed.


PARTNERS