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

Issue 341081: Begin using the top-level code generator for code that is inside... (Closed)

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

Description

Begin using the top-level code generator for code that is inside directly-applied function literals that are themselves compiled with the top-level code generator. The choice is guarded by a test that the function is anonymous (thus not expected to be recursive) and not in a loop. A compilation hint is set in the shared function info and used to make the choice.

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -46 lines) Patch
M src/arm/fast-codegen-arm.cc View 8 chunks +21 lines, -10 lines 4 comments Download
M src/ast.h View 3 chunks +6 lines, -1 line 2 comments Download
M src/codegen.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler.cc View 5 chunks +27 lines, -14 lines 0 comments Download
M src/fast-codegen.h View 3 chunks +9 lines, -0 lines 0 comments Download
M src/fast-codegen.cc View 6 chunks +7 lines, -0 lines 2 comments Download
M src/ia32/fast-codegen-ia32.cc View 9 chunks +22 lines, -10 lines 0 comments Download
M src/objects.h View 2 chunks +4 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 chunk +4 lines, -1 line 0 comments Download
M src/x64/fast-codegen-x64.cc View 8 chunks +21 lines, -10 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Kevin Millikin (Chromium)
11 years, 1 month ago (2009-11-03 13:32:11 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/341081/diff/1/11 File src/arm/fast-codegen-arm.cc (right): http://codereview.chromium.org/341081/diff/1/11#newcode830 Line 830: lit->mark_as_fast(); As this logic is duplicated in ...
11 years, 1 month ago (2009-11-03 13:57:47 UTC) #2
fschneider
LGTM. http://codereview.chromium.org/341081/diff/1/11 File src/arm/fast-codegen-arm.cc (right): http://codereview.chromium.org/341081/diff/1/11#newcode97 Line 97: ASSERT(loop_depth() == 0); Why this duplicate ASSERT? ...
11 years, 1 month ago (2009-11-03 14:10:13 UTC) #3
Kevin Millikin (Chromium)
11 years, 1 month ago (2009-11-03 14:16:09 UTC) #4
http://codereview.chromium.org/341081/diff/1/11
File src/arm/fast-codegen-arm.cc (right):

http://codereview.chromium.org/341081/diff/1/11#newcode97
Line 97: ASSERT(loop_depth() == 0);
On 2009/11/03 14:10:13, fschneider wrote:
> Why this duplicate ASSERT? (also on ia32, x64)

We should not be in a loop before we compile the body, and we should not be in a
loop afterward either.

http://codereview.chromium.org/341081/diff/1/11#newcode830
Line 830: lit->mark_as_fast();
On 2009/11/03 13:57:47, Søren Gjesse wrote:
> As this logic is duplicated in all three code generators how about moving it
to
> the FunctionLiteral passing the current loop_depth (or the
> FastCodeGenerator/CodeGenerator object)?

That's a good idea.  For now the check is pretty simple, so I'll leave it out of
the AST.

http://codereview.chromium.org/341081/diff/1/4
File src/ast.h (right):

http://codereview.chromium.org/341081/diff/1/4#newcode1350
Line 1350: bool is_marked_as_fast() { return try_fast_codegen_; }
On 2009/11/03 13:57:47, Søren Gjesse wrote:
> Why not just the standard accessor names?
> 
>   void set_try_fast_codegen(bool try_fast_codegen)
>   bool is_try_fast_codegen()
> 

I was being too cute.  I didn't see the need yet to change it back to false
since that's the default.  I'll just go with the standard accessor names, as you
suggest.

http://codereview.chromium.org/341081/diff/1/9
File src/fast-codegen.cc (right):

http://codereview.chromium.org/341081/diff/1/9#newcode359
Line 359: increment_loop_depth();
On 2009/11/03 13:57:47, Søren Gjesse wrote:
> How placing the increment_loop_depth()/decrement_loop_depth() in a stack
> allocated class to ensure they are paired. Maybe the other ASSERT in codegen
> will catch this anyway.

I thought about that, but it seemed too complicated for this.  I'll leave it
like this for now and reconsider when I do the other loops.

Powered by Google App Engine
This is Rietveld 408576698