Re: [webkit-dev] Webkit JavaScript question

2009-05-27 Thread Gavin Barraclough
Hi Zoltan, I don't think so. It is not worth to do it on a desktop pc since interpreter is always slower than JIT. However, the story is different for embedded systems, when they enter low-memory mode. Whilst it is certainly true that this would likely be of most benefit on embedded

Re: [webkit-dev] Webkit JavaScript question

2009-05-22 Thread Lucius Fox
Thanks. Can you please help me understand why SquirellFish needs to generate squirellFish byte code first before compile it to machine code? For v8, it compiles JavaScript source code directly into machine code when it is first executed. There are no intermediate byte codes, no interpreter.

Re: [webkit-dev] Webkit JavaScript question

2009-05-22 Thread tonikitoo (Antonio Gomes)
The last step depends on the architecture (supported or not) and C++ compiler directives. If JIT is enabled (see wtf/Platform.h), it always generates machine code. Otherwise an interpreter executes the byte code. A mixed environment (both jit and interpreter) is not yet supported. Are there

Re: [webkit-dev] Webkit JavaScript question

2009-05-22 Thread Zoltan Herczeg
Hi, Historical reasons. SF byte code had been implemented a year ago than jit. SF byte code (interpreter) will never go away, since not all devices support jit, and it is easier to generate JIT code from SF byte code than from Abstract Syntax Tree. Perhaps the authors can tell you more about this

Re: [webkit-dev] Webkit JavaScript question

2009-05-22 Thread Darin Adler
Some of the rationale is in this blog post too http://webkit.org/blog/214/introducing-squirrelfish-extreme/ . For example: “We also think we can get a lot more speedups out of the JIT through techniques such as type specialization, better register allocation and liveness analysis. [...]

Re: [webkit-dev] Webkit JavaScript question

2009-05-22 Thread Zoltan Herczeg
Hi, I don't think so. It is not worth to do it on a desktop pc since interpreter is always slower than JIT. However, the story is different for embedded systems, when they enter low-memory mode. We made some experiments before, and it seems possible to switch between jit and interpreter, but I am

[webkit-dev] Webkit JavaScript question

2009-05-21 Thread Lucius Fox
Hi, Can you please tell me what is the difference between ByteCodeGenerator.h and JIT.h? I assume ByteCodeGenerator is convert a raw .js file into JavaScript VM opecode and will be executed by Webkit JavaScript VM. and JIT convert a raw .js file into native machine code and will be executed by

Re: [webkit-dev] Webkit JavaScript question

2009-05-21 Thread Zoltan Herczeg
Hi, The JavaScript engine does 3 steps: 1) Parse JS files 2) Generate SquirellFish byte code (ByteCodeGenerator.h is part of it) 3) Compile SF byte code to machine code by its JIT compiler (optional) The last step depends on the architecture (supported or not) and C++ compiler directives. If JIT