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

Unified Diff: pkg/compiler/lib/src/kernel/element_map.dart

Issue 2994353002: Fix the locals lookup of variables and partial implementation of boxing of variables.
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_model/locals.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/element_map.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map.dart b/pkg/compiler/lib/src/kernel/element_map.dart
index 9bad04ee9de5a80a1acafda382e328c4b7ed90de..8f7cc42b88f635f3b24a4a7aec23a01e22ddb343 100644
--- a/pkg/compiler/lib/src/kernel/element_map.dart
+++ b/pkg/compiler/lib/src/kernel/element_map.dart
@@ -244,6 +244,9 @@ abstract class MemberDefinition {
enum ClassKind {
regular,
closure,
+ // TODO(efortuna, johnniwinther): Container is not a class, but is
+ // masquerading as one currently for consistency with the old element model.
+ container,
}
/// A member directly defined by its [ir.Member] node.
@@ -383,8 +386,12 @@ abstract class KernelToLocalsMap {
/// Call to notify that [member] is no longer being inlined.
void leaveInlinedMember(covariant MemberEntity member);
- /// Returns the [Local] for [node].
- Local getLocalVariable(ir.VariableDeclaration node);
+ /// Returns the [Local] for [node]. If [isClosureCallMethod] is true, this
+ /// gives the locals map permission to also look one scope higher within the
+ /// class for the corresponding local. This can happen in the case of free
+ /// variables involved with a closure class.
+ Local getLocalVariable(ir.VariableDeclaration node,
+ {bool isClosureCallMethod = false});
/// Returns the [Local] corresponding to the [node]. The node must be either
/// a [ir.FunctionDeclaration] or [ir.FunctionExpression].
« no previous file with comments | « pkg/compiler/lib/src/js_model/locals.dart ('k') | pkg/compiler/lib/src/kernel/element_map_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698