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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 2954463002: Refactoring to prepare for kernel based jump targets (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 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
« no previous file with comments | « pkg/compiler/lib/src/elements/jumps.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library elements.modelx; 5 library elements.modelx;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show Identifiers; 8 import '../common/names.dart' show Identifiers;
9 import '../common/resolution.dart' show Resolution, ParsingContext; 9 import '../common/resolution.dart' show Resolution, ParsingContext;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 3322 matching lines...) Expand 10 before | Expand all | Expand 10 after
3333 super(name, subclass.compilationUnit, id); 3333 super(name, subclass.compilationUnit, id);
3334 3334
3335 bool get isUnnamedMixinApplication => true; 3335 bool get isUnnamedMixinApplication => true;
3336 3336
3337 bool get isAbstract => true; 3337 bool get isAbstract => true;
3338 } 3338 }
3339 3339
3340 class LabelDefinitionX implements LabelDefinition<Node> { 3340 class LabelDefinitionX implements LabelDefinition<Node> {
3341 final Label label; 3341 final Label label;
3342 final String labelName; 3342 final String labelName;
3343 final JumpTarget<Node> target; 3343 final JumpTargetX target;
3344 bool isBreakTarget = false; 3344 bool isBreakTarget = false;
3345 bool isContinueTarget = false; 3345 bool isContinueTarget = false;
3346 3346
3347 LabelDefinitionX(Label label, String labelName, this.target) 3347 LabelDefinitionX(Label label, String labelName, this.target)
3348 : this.label = label, 3348 : this.label = label,
3349 this.labelName = labelName; 3349 this.labelName = labelName;
3350 3350
3351 // In case of a synthetic label, just use [labelName] for identifying the 3351 // In case of a synthetic label, just use [labelName] for identifying the
3352 // label. 3352 // label.
3353 String get name => label == null ? labelName : label.identifier.source; 3353 String get name => label == null ? labelName : label.identifier.source;
(...skipping 25 matching lines...) Expand all
3379 3379
3380 JumpTargetX(this.statement, this.nestingLevel, this.executableContext); 3380 JumpTargetX(this.statement, this.nestingLevel, this.executableContext);
3381 3381
3382 @override 3382 @override
3383 MemberElement get memberContext => executableContext.memberContext; 3383 MemberElement get memberContext => executableContext.memberContext;
3384 3384
3385 String get name => "target"; 3385 String get name => "target";
3386 3386
3387 bool get isTarget => isBreakTarget || isContinueTarget; 3387 bool get isTarget => isBreakTarget || isContinueTarget;
3388 3388
3389 LabelDefinition<Node> addLabel(Label label, String labelName) { 3389 LabelDefinition<Node> addLabel(Label label, String labelName,
3390 LabelDefinition<Node> result = new LabelDefinitionX(label, labelName, this); 3390 {bool isBreakTarget: false}) {
3391 LabelDefinitionX result = new LabelDefinitionX(label, labelName, this);
3391 labels.add(result); 3392 labels.add(result);
3393 if (isBreakTarget) {
3394 result.setBreakTarget();
3395 }
3392 return result; 3396 return result;
3393 } 3397 }
3394 3398
3395 bool get isSwitch => statement is SwitchStatement; 3399 bool get isSwitch => statement is SwitchStatement;
3396 3400
3397 String toString() => 'Target:$statement'; 3401 String toString() => 'Target:$statement';
3398 } 3402 }
3399 3403
3400 class TypeVariableElementX extends ElementX 3404 class TypeVariableElementX extends ElementX
3401 with AstElementMixin 3405 with AstElementMixin
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
3575 body = node.asFunctionExpression().body; 3579 body = node.asFunctionExpression().body;
3576 } 3580 }
3577 return new ParsedResolvedAst( 3581 return new ParsedResolvedAst(
3578 declaration, 3582 declaration,
3579 node, 3583 node,
3580 body, 3584 body,
3581 definingElement.treeElements, 3585 definingElement.treeElements,
3582 definingElement.compilationUnit.script.resourceUri); 3586 definingElement.compilationUnit.script.resourceUri);
3583 } 3587 }
3584 } 3588 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/jumps.dart ('k') | pkg/compiler/lib/src/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698