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

Side by Side Diff: pkg/analyzer2dart/lib/src/cps_generator.dart

Issue 1136843006: dart2js cps: Access to lazily initialized fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer2dart/test/sexpr_data.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer2dart.cps_generator; 5 library analyzer2dart.cps_generator;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 8
9 import 'package:compiler/src/dart_types.dart' as dart2js; 9 import 'package:compiler/src/dart_types.dart' as dart2js;
10 import 'package:compiler/src/elements/elements.dart' as dart2js; 10 import 'package:compiler/src/elements/elements.dart' as dart2js;
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 } 405 }
406 406
407 @override 407 @override
408 ir.Node visitStaticFieldAccess(AstNode node, AccessSemantics semantics) { 408 ir.Node visitStaticFieldAccess(AstNode node, AccessSemantics semantics) {
409 analyzer.Element element = semantics.element; 409 analyzer.Element element = semantics.element;
410 dart2js.Element target = converter.convertElement(element); 410 dart2js.Element target = converter.convertElement(element);
411 // TODO(johnniwinther): Selector information should be computed in the 411 // TODO(johnniwinther): Selector information should be computed in the
412 // [TreeShaker] and shared with the [CpsGeneratingVisitor]. 412 // [TreeShaker] and shared with the [CpsGeneratingVisitor].
413 assert(invariant(node, target.isTopLevel || target.isStatic, 413 assert(invariant(node, target.isTopLevel || target.isStatic,
414 '$target expected to be top-level or static.')); 414 '$target expected to be top-level or static.'));
415 return irBuilder.buildStaticFieldGet(target); 415 return irBuilder.buildStaticFieldLazyGet(target, null);
416 } 416 }
417 417
418 ir.Primitive handleBinaryExpression(BinaryExpression node, 418 ir.Primitive handleBinaryExpression(BinaryExpression node,
419 String op) { 419 String op) {
420 ir.Primitive left = build(node.leftOperand); 420 ir.Primitive left = build(node.leftOperand);
421 ir.Primitive right = build(node.rightOperand); 421 ir.Primitive right = build(node.rightOperand);
422 Selector selector = new Selector.binaryOperator(op); 422 Selector selector = new Selector.binaryOperator(op);
423 return irBuilder.buildDynamicInvocation( 423 return irBuilder.buildDynamicInvocation(
424 left, selector, <ir.Primitive>[right]); 424 left, selector, <ir.Primitive>[right]);
425 } 425 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 catchClause.exceptionParameter.staticElement), 580 catchClause.exceptionParameter.staticElement),
581 buildCatchBlock: subbuild(catchClause.body))); 581 buildCatchBlock: subbuild(catchClause.body)));
582 582
583 } 583 }
584 irBuilder.buildTry( 584 irBuilder.buildTry(
585 tryStatementInfo: new TryStatementInfo(), 585 tryStatementInfo: new TryStatementInfo(),
586 buildTryBlock: subbuild(node.body), 586 buildTryBlock: subbuild(node.body),
587 catchClauseInfos: catchClauseInfos); 587 catchClauseInfos: catchClauseInfos);
588 } 588 }
589 } 589 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer2dart/test/sexpr_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698