| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 'dart:math' as math; | 5 import 'dart:math' as math; |
| 6 import '../common.dart'; | 6 import '../common.dart'; |
| 7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; | 7 import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem; |
| 8 import '../common/tasks.dart' show CompilerTask; | 8 import '../common/tasks.dart' show CompilerTask; |
| 9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
| 10 import '../constants/constant_system.dart'; | 10 import '../constants/constant_system.dart'; |
| (...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 js.Expression receiverExpression = pop(); | 1630 js.Expression receiverExpression = pop(); |
| 1631 use(node.conditionalConstantInterceptor); | 1631 use(node.conditionalConstantInterceptor); |
| 1632 js.Expression constant = pop(); | 1632 js.Expression constant = pop(); |
| 1633 push(js.js('# && #', [receiverExpression, constant])); | 1633 push(js.js('# && #', [receiverExpression, constant])); |
| 1634 } else { | 1634 } else { |
| 1635 assert(node.inputs.length == 1); | 1635 assert(node.inputs.length == 1); |
| 1636 registry.registerSpecializedGetInterceptor(node.interceptedClasses); | 1636 registry.registerSpecializedGetInterceptor(node.interceptedClasses); |
| 1637 js.Name name = | 1637 js.Name name = |
| 1638 backend.namer.nameForGetInterceptor(node.interceptedClasses); | 1638 backend.namer.nameForGetInterceptor(node.interceptedClasses); |
| 1639 var isolate = new js.VariableUse( | 1639 var isolate = new js.VariableUse( |
| 1640 backend.namer.globalObjectFor(helpers.interceptorsLibrary)); | 1640 backend.namer.globalObjectForLibrary(helpers.interceptorsLibrary)); |
| 1641 use(node.receiver); | 1641 use(node.receiver); |
| 1642 List<js.Expression> arguments = <js.Expression>[pop()]; | 1642 List<js.Expression> arguments = <js.Expression>[pop()]; |
| 1643 push(js | 1643 push(js |
| 1644 .propertyCall(isolate, name, arguments) | 1644 .propertyCall(isolate, name, arguments) |
| 1645 .withSourceInformation(node.sourceInformation)); | 1645 .withSourceInformation(node.sourceInformation)); |
| 1646 registry.registerUseInterceptor(); | 1646 registry.registerUseInterceptor(); |
| 1647 } | 1647 } |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 visitInvokeDynamicMethod(HInvokeDynamicMethod node) { | 1650 visitInvokeDynamicMethod(HInvokeDynamicMethod node) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 push(js | 1695 push(js |
| 1696 .propertyCall(object, methodName, arguments) | 1696 .propertyCall(object, methodName, arguments) |
| 1697 .withSourceInformation(node.sourceInformation)); | 1697 .withSourceInformation(node.sourceInformation)); |
| 1698 registry.registerStaticUse(new StaticUse.constructorBodyInvoke( | 1698 registry.registerStaticUse(new StaticUse.constructorBodyInvoke( |
| 1699 node.element, new CallStructure.unnamed(arguments.length))); | 1699 node.element, new CallStructure.unnamed(arguments.length))); |
| 1700 } | 1700 } |
| 1701 | 1701 |
| 1702 void visitOneShotInterceptor(HOneShotInterceptor node) { | 1702 void visitOneShotInterceptor(HOneShotInterceptor node) { |
| 1703 List<js.Expression> arguments = visitArguments(node.inputs); | 1703 List<js.Expression> arguments = visitArguments(node.inputs); |
| 1704 var isolate = new js.VariableUse( | 1704 var isolate = new js.VariableUse( |
| 1705 backend.namer.globalObjectFor(helpers.interceptorsLibrary)); | 1705 backend.namer.globalObjectForLibrary(helpers.interceptorsLibrary)); |
| 1706 Selector selector = node.selector; | 1706 Selector selector = node.selector; |
| 1707 js.Name methodName = backend.registerOneShotInterceptor(selector); | 1707 js.Name methodName = backend.registerOneShotInterceptor(selector); |
| 1708 push(js | 1708 push(js |
| 1709 .propertyCall(isolate, methodName, arguments) | 1709 .propertyCall(isolate, methodName, arguments) |
| 1710 .withSourceInformation(node.sourceInformation)); | 1710 .withSourceInformation(node.sourceInformation)); |
| 1711 if (selector.isGetter) { | 1711 if (selector.isGetter) { |
| 1712 registerGetter(node); | 1712 registerGetter(node); |
| 1713 } else if (selector.isSetter) { | 1713 } else if (selector.isSetter) { |
| 1714 registerSetter(node); | 1714 registerSetter(node); |
| 1715 } else { | 1715 } else { |
| (...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3115 registry.registerStaticUse(new StaticUse.staticInvoke( | 3115 registry.registerStaticUse(new StaticUse.staticInvoke( |
| 3116 helper, new CallStructure.unnamed(argumentCount))); | 3116 helper, new CallStructure.unnamed(argumentCount))); |
| 3117 return backend.emitter.staticFunctionAccess(helper); | 3117 return backend.emitter.staticFunctionAccess(helper); |
| 3118 } | 3118 } |
| 3119 | 3119 |
| 3120 @override | 3120 @override |
| 3121 void visitRef(HRef node) { | 3121 void visitRef(HRef node) { |
| 3122 visit(node.value); | 3122 visit(node.value); |
| 3123 } | 3123 } |
| 3124 } | 3124 } |
| OLD | NEW |