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

Issue 1889: Remove some of the state-dependent behavior from the code generator.... (Closed)

Created:
12 years, 3 months ago by Kevin Millikin (Chromium)
Modified:
9 years, 7 months ago
Reviewers:
iposva, Kasper Lund
CC:
v8-dev
Visibility:
Public.

Description

Remove some of the state-dependent behavior from the code generator. Simplify the code generator by eliminating the access types STORE and INIT_CONST and delegating code generation for stores to the appropriate AST nodes. Committed: http://code.google.com/p/v8/source/detail?r=265

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+567 lines, -416 lines) Patch
M src/ast.h View 5 chunks +38 lines, -0 lines 2 comments Download
M src/codegen-arm.cc View 15 chunks +265 lines, -211 lines 4 comments Download
M src/codegen-ia32.cc View 15 chunks +264 lines, -205 lines 4 comments Download

Messages

Total messages: 3 (0 generated)
Kevin Millikin (Chromium)
12 years, 3 months ago (2008-09-10 07:59:26 UTC) #1
iposva
Kevin, For now it is OK to have the GenerateStoreCode methods take a scope parameter. ...
12 years, 3 months ago (2008-09-10 18:01:44 UTC) #2
Kevin Millikin (Chromium)
12 years, 3 months ago (2008-09-11 07:15:51 UTC) #3
http://codereview.chromium.org/1889/diff/1/2
File src/ast.h (right):

http://codereview.chromium.org/1889/diff/1/2#newcode164
Line 164: bool is_const_init) {
On 2008/09/10 18:01:44, iposva wrote:
> Can you please use an enum for the is_const_init to improve the readability at
> the caller sites?

Done.  InitState with values CONST_INIT and NOT_CONST_INIT defined in ast.h for
now, but will move to a more logical place as the codegen state evolves.

http://codereview.chromium.org/1889/diff/1/3
File src/codegen-arm.cc (right):

http://codereview.chromium.org/1889/diff/1/3#newcode2033
Line 2033: ASSERT(!ref->is_illegal());
On 2008/09/10 18:01:44, iposva wrote:
> Nit: Don't you want to assert before accessing any fields of ref?

Changed.  Illegal references have a type, so it's safe to access it.  But it
*is* clearer to read the preconditions earlier in the function.

http://codereview.chromium.org/1889/diff/1/3#newcode3295
Line 3295: // CodeGenState::LOAD_TYPEOF_EXPR.
On 2008/09/10 18:01:44, iposva wrote:
> Please assert that the CodeGenState is LOAD_TYPEOF_EXPR. That way you ensure
> that you are not entering here with UNDEFINED or a newly added state.

Done.  Earlier assert already ruled out UNDEFINED, but the point about new
states is valid.

http://codereview.chromium.org/1889/diff/1/4
File src/codegen-ia32.cc (right):

http://codereview.chromium.org/1889/diff/1/4#newcode1141
Line 1141: ASSERT(!ref()->is_illegal());
On 2008/09/10 18:01:44, iposva wrote:
> Same nit as on ARM: Don't you want to assert before accessing ref?

Done.

http://codereview.chromium.org/1889/diff/1/4#newcode3496
Line 3496: // CodeGenState::LOAD_TYPEOF_EXPR.
On 2008/09/10 18:01:44, iposva wrote:
> Same comment as on ARM: Please assert that the CodeGenState is
LOAD_TYPEOF_EXPR.
> That way you ensure that you are not entering here with UNDEFINED or a newly
> added state.

Done.

Powered by Google App Engine
This is Rietveld 408576698