Go to file
kmillikin@chromium.org f74e723599 Initial infrastructure for fast compilation of top-level code. The
fast code generator is optimized for compilation time and code size.

Currently it is only implemented on IA32.  It is potentially triggered
for any code in the global scope (including code eval'd in the global
scope).  It performs a syntactic check and chooses to compile in fast
mode if the AST contains only supported constructs and matches some
other constraints.

Initially supported constructs are

* ExpressionStatement,
* ReturnStatement,
* VariableProxy (variable references) to parameters and
    stack-allocated locals,
* Assignment with lhs a parameter or stack-allocated local, and
* Literal

This allows compilation of literals at the top level and not much
else.

All intermediate values are allocated to temporaries and the stack is
used for all temporaries.  The extra memory traffic is a known issue.

The code generated for 'true' is:

 0  push ebp
 1  mov ebp,esp
 3  push esi
 4  push edi
 5  push 0xf5cca135             ;; object: 0xf5cca135 <undefined>
10  cmp esp,[0x8277efc]
16  jnc 27  (0xf5cbbb1b)
22  call 0xf5cac960             ;; code: STUB, StackCheck, minor: 0
27  push 0xf5cca161             ;; object: 0xf5cca161 <true>
32  mov eax,[esp]
35  mov [ebp+0xf4],eax
38  pop eax
39  mov eax,[ebp+0xf4]
42  mov esp,ebp                 ;; js return
44  pop ebp
45  ret 0x4
48  mov eax,0xf5cca135          ;; object: 0xf5cca135 <undefined>
53  mov esp,ebp                 ;; js return
55  pop ebp
56  ret 0x4

Review URL: http://codereview.chromium.org/273050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-14 19:30:50 +00:00
benchmarks Remove svn:executable flag from run.html and style.css and change the mime-type of style.css to text/css. 2009-07-15 10:37:10 +00:00
include - Add String::Concat(Handle<String> left, Handle<String> right) to the V8 API. 2009-10-14 15:26:38 +00:00
samples Add a "read" extension to the shell programs. This global function 2009-04-17 21:04:34 +00:00
src Initial infrastructure for fast compilation of top-level code. The 2009-10-14 19:30:50 +00:00
test - Add String::Concat(Handle<String> left, Handle<String> right) to the V8 API. 2009-10-14 15:26:38 +00:00
tools Initial infrastructure for fast compilation of top-level code. The 2009-10-14 19:30:50 +00:00
.gitignore X64: Fix bugs affecting Win64. 2009-10-13 10:56:13 +00:00
AUTHORS Land change by Jan de Mooij to change the toString behavior of 2009-09-17 11:11:01 +00:00
ChangeLog Prepare push to trunk. Now working on version 1.3.16. 2009-10-07 13:42:24 +00:00
LICENSE Get rid of duplicate LICENSE entry for the Valgrind 2009-09-27 09:33:11 +00:00
SConstruct X64: Fix bugs affecting Win64. 2009-10-13 10:56:13 +00:00