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

Issue 6691058: Restart AST node numbering when we enter a function. (Closed)

Created:
9 years, 8 months ago by William Hesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Restart AST node numbering when we enter a function. BUG= TEST= Committed: http://code.google.com/p/v8/source/detail?r=7543

Patch Set 1 #

Total comments: 1

Patch Set 2 : Moved AST ID reset to LexicalScope. Found missing use of function->id() for inlined functions. #

Patch Set 3 : Remove stray changes #

Patch Set 4 : Add AstNode::kRootAstId #

Patch Set 5 : Fix the typography, dammit. #

Patch Set 6 : Add remaining platforms to change. #

Total comments: 3

Patch Set 7 : Incorporate codereview suggestions. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -54 lines) Patch
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/ast.h View 1 2 3 4 5 6 5 chunks +2 lines, -5 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/parser.cc View 1 2 3 4 5 6 14 chunks +35 lines, -43 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
William Hesse
Not ready for commit yet. Some failures, and I want to create a scoped object ...
9 years, 8 months ago (2011-04-05 15:23:57 UTC) #1
Kevin Millikin (Chromium)
http://codereview.chromium.org/6691058/diff/1/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/6691058/diff/1/src/parser.cc#newcode3548 src/parser.cc:3548: Isolate* isolate = Isolate::Current(); You should probably call (the ...
9 years, 8 months ago (2011-04-05 15:56:11 UTC) #2
William Hesse
All comments addressed, moved into LexicalScope, and loop counting removed from parser and lexical scope.
9 years, 8 months ago (2011-04-07 12:27:09 UTC) #3
Kevin Millikin (Chromium)
9 years, 8 months ago (2011-04-07 13:42:51 UTC) #4
LGTM.  Suggestion to change the name of the constant.

http://codereview.chromium.org/6691058/diff/8005/src/arm/full-codegen-arm.cc
File src/arm/full-codegen-arm.cc (right):

http://codereview.chromium.org/6691058/diff/8005/src/arm/full-codegen-arm.cc#...
src/arm/full-codegen-arm.cc:248: PrepareForBailoutForId(AstNode::kRootAstId,
NO_REGISTERS);
How about something more like kFunctionEntryId?

http://codereview.chromium.org/6691058/diff/8005/src/ast.h
File src/ast.h (right):

http://codereview.chromium.org/6691058/diff/8005/src/ast.h#newcode137
src/ast.h:137: // The root of every AST, a FunctionLiteral node, has id
kRootAstId when
This comment is unnecessary and I think it confuses matters.  The function
literal does not have two different id_ values depending on the observer.  It
has one.  We don't (shouldn't) use it in the function itself.

There is a separate function entry id.  Call it something like kFunctionEntryId
and you probably don't even need a comment it's so obvious.

The fact that we used to use the literal's id because it wasn't used for
anything else is not important.

http://codereview.chromium.org/6691058/diff/8005/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/6691058/diff/8005/src/parser.cc#newcode3683
src/parser.cc:3683: FunctionLiteral* function_literal = new(zone())
FunctionLiteral(
I sort of prefer breaking at the lowest precedence operator, if it makes the
lines fit and I don't like the offsides look of the (.  In this case, it should
work to have:

FunctionLiteral* function_literal =
  new(zone()) FunctionLiteral(name,
                              top_scope_,
...

Powered by Google App Engine
This is Rietveld 408576698