Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Issue 273050: Initial infrastructure for fast compilation of top-level code. The... (Closed)

Created:
11 years, 2 months ago by Kevin Millikin (Chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

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 Committed: http://code.google.com/p/v8/source/detail?r=3067

Patch Set 1 #

Total comments: 3

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+871 lines, -63 lines) Patch
M src/SConscript View 2 chunks +16 lines, -16 lines 0 comments Download
M src/arm/codegen-arm.h View 1 chunk +9 lines, -0 lines 0 comments Download
M src/codegen.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/codegen.cc View 2 chunks +46 lines, -42 lines 0 comments Download
M src/compiler.cc View 1 4 chunks +307 lines, -2 lines 0 comments Download
A src/fast-codegen.h View 1 chunk +67 lines, -0 lines 0 comments Download
A src/fast-codegen.cc View 1 1 chunk +236 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 1 chunk +5 lines, -1 line 0 comments Download
M src/ia32/codegen-ia32.h View 1 chunk +9 lines, -0 lines 0 comments Download
A src/ia32/fast-codegen-ia32.cc View 1 1 chunk +148 lines, -0 lines 0 comments Download
M src/v8-counters.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/x64/codegen-x64.h View 1 chunk +9 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 2 chunks +3 lines, -0 lines 0 comments Download
M tools/visual_studio/v8_base.vcproj View 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Kevin Millikin (Chromium)
11 years, 2 months ago (2009-10-14 13:37:49 UTC) #1
Kevin Millikin (Chromium)
http://codereview.chromium.org/273050/diff/1/7 File src/compiler.cc (right): http://codereview.chromium.org/273050/diff/1/7#newcode460 Line 460: CHECK(!(scope->is_global_scope() && scope->num_heap_slots() > 0)); Oops, this line ...
11 years, 2 months ago (2009-10-14 14:06:18 UTC) #2
fschneider
1 comment, otherwise LGTM. http://codereview.chromium.org/273050/diff/1/5 File src/flag-definitions.h (right): http://codereview.chromium.org/273050/diff/1/5#newcode147 Line 147: "print reasons for failing ...
11 years, 2 months ago (2009-10-14 14:15:13 UTC) #3
Kevin Millikin (Chromium)
On 2009/10/14 14:15:13, fschneider wrote: > 1 comment, otherwise LGTM. > > http://codereview.chromium.org/273050/diff/1/5 > File ...
11 years, 2 months ago (2009-10-14 14:25:10 UTC) #4
William Hesse
11 years, 2 months ago (2009-10-14 14:51:12 UTC) #5
LGTM.

http://codereview.chromium.org/273050/diff/1/3
File src/ia32/fast-codegen-ia32.cc (right):

http://codereview.chromium.org/273050/diff/1/3#newcode39
Line 39: void FastCodeGenerator::Generate(FunctionLiteral* fun) {
Either here, or in the declaration of the function, I would like to see the
information about the expected state when the generated function is called, and
the stack frame set up by this function.

Powered by Google App Engine
This is Rietveld 408576698