OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |