Chromium Code Reviews
DescriptionBegin making copies of AST nodes for constants during resolution.
The resolver now copies the resolved AST's for the initializers of
constant variable declarations into the element model. This is a
necessary prerequisite for moving constant evaluation into the new
task model, since in the new task model, the original AST nodes won't
be available at constant evaluation time.
Also, the resolver is now responsible for copying the resolved
initializer lists for constant constructors into the element model.
This was previously done at constant evaluation time, but once again
in the new task model the original AST nodes won't be available at
constant evaluation time.
Since not all constants are guaranteed to have been evaluated at the time
that the resolver makes these copies, we can no longer store the
evaluationResult for an InstanceCreationExpression in its AST node
(it's no longer guaranteed to get copied safely). So instead, we
store the evaluationResult in an intermediate object called
ConstantInstanceCreationHandle; that way the copied AST node will
point to the same ConstantInstanceCreationHandle as the original AST
node, so once the constant is evaluated, the resulting value will be
accessible from both AST nodes.
R=brianwilkerson@google.com
Committed: https://code.google.com/p/dart/source/detail?r=44861
Patch Set 1 #
Total comments: 12
Patch Set 2 : Address review comments and switch to using mixins. #
Total comments: 2
Messages
Total messages: 9 (2 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||