Reviewers: Kevin Millikin,

Message:
Ready for first round of review.

I tried to reduce the number of bit-vector copies by accumulating results over
statements and only computing the proper set of assigned variables for
expressions. However, it seems there is still a significant cost in compile
time.

Description:
Add an assigned variables analysis.

This change adds a pass over the AST that computes the
set of assigned variables for locals and parameters for each expression.

The result of this analysis is used to for two purposes:
1. Recognize variables that are trivial subexpressions. A left sub-expression
   of a binary operation is trivial if it is a local variable or a parameter
   and it is not assigned in the right sub-expression. In the case of a
   trivial left sub-expression we evaluate the right first.

2. Recogize certain simple for-loops with a constant trip count where the loop
   variable is always within smi range. If the loop count variable is not
   assigned in the body of the loop (except in the update expression the
   for-loop). This allows omitting smi checks on operation using the loop
   count variable.


Please review this at http://codereview.chromium.org/669155

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/ast.h
  M     src/ast.cc
  M     src/compiler.cc
  M     src/data-flow.h
  M     src/data-flow.cc
  M     src/ia32/codegen-ia32.cc
  M     src/ia32/macro-assembler-ia32.h
  M     src/ia32/macro-assembler-ia32.cc
  M     src/ia32/virtual-frame-ia32.h
  M     src/ia32/virtual-frame-ia32.cc
  M     src/virtual-frame-inl.h


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to