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

Side by Side Diff: pkg/compiler/lib/src/kernel/element_map.dart

Issue 2995113002: Share locals between members (Closed)
Patch Set: Rebased 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:kernel/ast.dart' as ir; 5 import 'package:kernel/ast.dart' as ir;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../common.dart'; 8 import '../common.dart';
9 import '../constants/values.dart'; 9 import '../constants/values.dart';
10 import '../common_elements.dart'; 10 import '../common_elements.dart';
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 /// Call to notify that [member] is no longer being inlined. 383 /// Call to notify that [member] is no longer being inlined.
384 void leaveInlinedMember(covariant MemberEntity member); 384 void leaveInlinedMember(covariant MemberEntity member);
385 385
386 /// Returns the [Local] for [node]. If [isClosureCallMethod] is true, this 386 /// Returns the [Local] for [node]. If [isClosureCallMethod] is true, this
387 /// gives the locals map permission to also look one scope higher within the 387 /// gives the locals map permission to also look one scope higher within the
388 /// class for the corresponding local. This can happen in the case of free 388 /// class for the corresponding local. This can happen in the case of free
389 /// variables involved with a closure class. 389 /// variables involved with a closure class.
390 // TODO(efortuna, johnniwinther): convey this information without a boolean 390 // TODO(efortuna, johnniwinther): convey this information without a boolean
391 // parameter. 391 // parameter.
392 Local getLocalVariable(ir.VariableDeclaration node, 392 Local getLocalVariable(ir.VariableDeclaration node);
393 {bool isClosureCallMethod = false});
394 393
395 /// Returns the [Local] corresponding to the [node]. The node must be either 394 /// Returns the [Local] corresponding to the [node]. The node must be either
396 /// a [ir.FunctionDeclaration] or [ir.FunctionExpression]. 395 /// a [ir.FunctionDeclaration] or [ir.FunctionExpression].
397 Local getLocalFunction(ir.TreeNode node); 396 Local getLocalFunction(ir.TreeNode node);
398 397
399 /// Returns the [JumpTarget] for the break statement [node]. 398 /// Returns the [JumpTarget] for the break statement [node].
400 JumpTarget getJumpTargetForBreak(ir.BreakStatement node); 399 JumpTarget getJumpTargetForBreak(ir.BreakStatement node);
401 400
402 /// Returns `true` if [node] should generate a `continue` to its [JumpTarget]. 401 /// Returns `true` if [node] should generate a `continue` to its [JumpTarget].
403 bool generateContinueForBreak(ir.BreakStatement node); 402 bool generateContinueForBreak(ir.BreakStatement node);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 uri = Uri.parse(node.location.file); 461 uri = Uri.parse(node.location.file);
463 break; 462 break;
464 } 463 }
465 node = node.parent; 464 node = node.parent;
466 } 465 }
467 if (uri != null) { 466 if (uri != null) {
468 return new SourceSpan(uri, offset, offset + 1); 467 return new SourceSpan(uri, offset, offset + 1);
469 } 468 }
470 return null; 469 return null;
471 } 470 }
OLDNEW
« 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