DescriptionAdd 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.
Currently only binary operations and compare operations are considered
when finding trivial left sub-expressions.
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.
Committed: http://code.google.com/p/v8/source/detail?r=4087
Patch Set 1 #Patch Set 2 : '' #Patch Set 3 : '' #
Total comments: 42
Patch Set 4 : '' #Patch Set 5 : '' #Patch Set 6 : '' #Patch Set 7 : '' #
Total comments: 26
Patch Set 8 : '' #
Total comments: 16
Patch Set 9 : '' #
Messages
Total messages: 9 (0 generated)
|