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

Issue 7776009: Introduce local function declarations in Crankshaft and fix issue 1647. (Closed)

Created:
9 years, 3 months ago by fschneider
Modified:
9 years, 3 months ago
CC:
v8-dev
Visibility:
Public.

Description

Introduce local function declarations in Crankshaft and fix issue 1647. We have to emit code for declarations later into the body block (and not into the start block) so that the environment contains the correct values. In order to capture the environment effect of the declarations that generate code (function declarations) I inserted a separate AST id and a HSimulate after the declarations are visited. Also fixes handling deopt in named function expressions: BUG=v8:1647 TEST=test/mjsunit/regress/regress-fundecl.js, test/mjsunit/regress/regress-1647.js Committed: http://code.google.com/p/v8/source/detail?r=9083

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 2

Patch Set 5 : '' #

Patch Set 6 : added other platforms #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -10 lines) Patch
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M src/ast.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 3 chunks +22 lines, -5 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M src/mips/full-codegen-mips.cc View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M src/parser.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
A test/mjsunit/regress/regress-1647.js View 1 2 3 4 1 chunk +43 lines, -0 lines 0 comments Download
A test/mjsunit/regress/regress-fundecl.js View 1 2 3 1 chunk +44 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
fschneider
9 years, 3 months ago (2011-08-29 11:54:27 UTC) #1
fschneider
New attempt. Added a separate ast id for declarations and emit code for declarations after ...
9 years, 3 months ago (2011-08-30 07:56:19 UTC) #2
Kevin Millikin (Chromium)
It needs the change we discussed (below). After that, LGTM. http://codereview.chromium.org/7776009/diff/10001/src/hydrogen.cc File src/hydrogen.cc (right): http://codereview.chromium.org/7776009/diff/10001/src/hydrogen.cc#newcode2298 ...
9 years, 3 months ago (2011-08-31 11:44:27 UTC) #3
fschneider
9 years, 3 months ago (2011-08-31 12:09:40 UTC) #4
http://codereview.chromium.org/7776009/diff/10001/src/hydrogen.cc
File src/hydrogen.cc (right):

http://codereview.chromium.org/7776009/diff/10001/src/hydrogen.cc#newcode2298
src/hydrogen.cc:2298: VisitDeclarations(scope->declarations());
On 2011/08/31 11:44:27, Kevin Millikin wrote:
> There's an implicit declaration of the function name as a const, so you need
> something like:
> 
> if (scope()->is_function_scope() && scope()->function() != NULL) {
>   environmnent()->Bind(scope()->function(), <the hole value>);
> }
> 
> before VisitDeclarations.

Done.

Powered by Google App Engine
This is Rietveld 408576698