Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building v8 without JIT

Tags:

javascript

jit

v8

I would like to run some tests on v8 with and without JIT to compare performances. I know JIT will improve my average speed performance, but it would be nice for me to have some actual more detailed tests results as I want to work with mobile platforms.

I haven't found how to enable or disable JIT like it exists on Squirrelfish (cf. ENABLE_JIT in JavaScriptCore/wtf/Platform.h).

Does somebody knows how to do that with v8?

Thanks.

Alexandre

like image 644
rames Avatar asked Aug 18 '09 20:08

rames


People also ask

Does V8 use JIT?

Unlike other languages, The V8 engine uses both a compiler and an interpreter and follows Just in Time(JIT) Compilation for improved performance. Just in Time(JIT) Compilation: The V8 engine initially uses an interpreter, to interpret the code.

What is Jitless?

--jitless disables all runtime allocation of executable memory.

Does V8 optimize?

The V8 engine uses hidden classes to optimize property access time. Traditionally properties are accessed via a dictionary lookup by the JavaScript runtime environment. Since objects can change their type dynamically over time, this is a rather time consuming way to retrieve object properties.


2 Answers

For those who may be interested I got the following answer from Søren Gjesse on v8-users google groups.


Hi, It is not possible to disable dynamically generated code in V8. Unlike other JavaScript engines V8 does not have an interpreter mode - it always generates native code.

One exception is the RegExp engine which have an interpreter and native code version. The compile time define V8_NATIVE_REGEXP enables generating native code for RegExp processing.

Regards, Søren


like image 115
rames Avatar answered Oct 12 '22 22:10

rames


On a 32 bit little endian platform you can build with the ARM simulator. This is a testing feature and performance will be terrible, but it does work and involves no direct execution of JITed code. Use the --simulator=arm option on the scons or test.py command line.

like image 28
Erik Corry Avatar answered Oct 12 '22 23:10

Erik Corry