DescriptionCompile implicit closures as dispatchers instead of duplicating the original method's code.
This saves space in unoptimized code for implicit closures. In optimized code the
original method's code will often be inlined into the implicit closure dispatcher so that
there won't be a performance impact.
The static case just calls the original method. For implicit instance closures, the
this-parameter is loaded from the context and passed to the original method.
The coverage test is affected since the dispatcher has the original method's token position
associated with it. This means that the line with the method declaration is considered to
have executable code. Setting the token position to 0 (Scanner::kNoSourcePos) does not work
because it coincides with the first line (and first token) in the script.
R=hausner@google.com
Committed: https://code.google.com/p/dart/source/detail?r=44655
Patch Set 1 #
Total comments: 5
Patch Set 2 : #Patch Set 3 : rebased #
Messages
Total messages: 5 (1 generated)
|