| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:js_runtime/shared/embedded_names.dart'; | 5 import 'package:js_runtime/shared/embedded_names.dart'; |
| 6 import 'package:kernel/ast.dart' as ir; | 6 import 'package:kernel/ast.dart' as ir; |
| 7 | 7 |
| 8 import '../closure.dart'; | 8 import '../closure.dart'; |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../compiler.dart'; | 10 import '../compiler.dart'; |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 if (constantExpression == null) return null; | 356 if (constantExpression == null) return null; |
| 357 return _backend.constants.getConstantValue(constantExpression); | 357 return _backend.constants.getConstantValue(constantExpression); |
| 358 } | 358 } |
| 359 | 359 |
| 360 ConstantValue getConstantForType(ir.DartType irType) { | 360 ConstantValue getConstantForType(ir.DartType irType) { |
| 361 ResolutionDartType type = getDartType(irType); | 361 ResolutionDartType type = getDartType(irType); |
| 362 return _backend.constantSystem | 362 return _backend.constantSystem |
| 363 .createType(_compiler.commonElements, type.asRaw()); | 363 .createType(_compiler.commonElements, type.asRaw()); |
| 364 } | 364 } |
| 365 | 365 |
| 366 bool isIntercepted(ir.Node node) { | |
| 367 Selector selector = getSelector(node); | |
| 368 return _backend.interceptorData.isInterceptedSelector(selector); | |
| 369 } | |
| 370 | |
| 371 bool isInterceptedSelector(Selector selector) { | |
| 372 return _backend.interceptorData.isInterceptedSelector(selector); | |
| 373 } | |
| 374 | |
| 375 // Is the member a lazy initialized static or top-level member? | 366 // Is the member a lazy initialized static or top-level member? |
| 376 bool isLazyStatic(ir.Member member) { | 367 bool isLazyStatic(ir.Member member) { |
| 377 if (member is ir.Field) { | 368 if (member is ir.Field) { |
| 378 FieldElement field = _nodeToElement[member]; | 369 FieldElement field = _nodeToElement[member]; |
| 379 return field.constant == null; | 370 return field.constant == null; |
| 380 } | 371 } |
| 381 return false; | 372 return false; |
| 382 } | 373 } |
| 383 | 374 |
| 384 LibraryElement get jsHelperLibrary => | 375 LibraryElement get jsHelperLibrary => |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 JumpTarget continueTarget = | 823 JumpTarget continueTarget = |
| 833 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); | 824 astAdapter.getJumpTarget(switchCase, isContinueTarget: true); |
| 834 assert(continueTarget is KernelJumpTarget); | 825 assert(continueTarget is KernelJumpTarget); |
| 835 targetIndexMap[continueTarget] = switchIndex; | 826 targetIndexMap[continueTarget] = switchIndex; |
| 836 assert(builder.jumpTargets[continueTarget] == null); | 827 assert(builder.jumpTargets[continueTarget] == null); |
| 837 builder.jumpTargets[continueTarget] = this; | 828 builder.jumpTargets[continueTarget] = this; |
| 838 switchIndex++; | 829 switchIndex++; |
| 839 } | 830 } |
| 840 } | 831 } |
| 841 } | 832 } |
| OLD | NEW |