| 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:collection'; | 5 import 'dart:collection'; |
| 6 | 6 |
| 7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
| 8 | 8 |
| 9 import '../closure.dart'; | 9 import '../closure.dart'; |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 2966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2977 SourceInformation sourceInformation) { | 2977 SourceInformation sourceInformation) { |
| 2978 // Until now we only handle these as getters. | 2978 // Until now we only handle these as getters. |
| 2979 invariant(node, deferredLoader.isDeferredLoaderGetter); | 2979 invariant(node, deferredLoader.isDeferredLoaderGetter); |
| 2980 FunctionEntity loadFunction = commonElements.loadLibraryWrapper; | 2980 FunctionEntity loadFunction = commonElements.loadLibraryWrapper; |
| 2981 PrefixElement prefixElement = deferredLoader.enclosingElement; | 2981 PrefixElement prefixElement = deferredLoader.enclosingElement; |
| 2982 String loadId = deferredLoadTask.getImportDeferName(node, prefixElement); | 2982 String loadId = deferredLoadTask.getImportDeferName(node, prefixElement); |
| 2983 var inputs = [ | 2983 var inputs = [ |
| 2984 graph.addConstantString(new ast.DartString.literal(loadId), closedWorld) | 2984 graph.addConstantString(new ast.DartString.literal(loadId), closedWorld) |
| 2985 ]; | 2985 ]; |
| 2986 push(new HInvokeStatic(loadFunction, inputs, commonMasks.nonNullType, | 2986 push(new HInvokeStatic(loadFunction, inputs, commonMasks.nonNullType, |
| 2987 targetCanThrow: false)..sourceInformation = sourceInformation); | 2987 targetCanThrow: false) |
| 2988 ..sourceInformation = sourceInformation); |
| 2988 } | 2989 } |
| 2989 | 2990 |
| 2990 generateSuperNoSuchMethodSend( | 2991 generateSuperNoSuchMethodSend( |
| 2991 ast.Send node, Selector selector, List<HInstruction> arguments) { | 2992 ast.Send node, Selector selector, List<HInstruction> arguments) { |
| 2992 String name = selector.name; | 2993 String name = selector.name; |
| 2993 | 2994 |
| 2994 ClassElement cls = currentNonClosureClass; | 2995 ClassElement cls = currentNonClosureClass; |
| 2995 MethodElement element = cls.lookupSuperMember(Identifiers.noSuchMethod_); | 2996 MethodElement element = cls.lookupSuperMember(Identifiers.noSuchMethod_); |
| 2996 if (!Selectors.noSuchMethod_.signatureApplies(element)) { | 2997 if (!Selectors.noSuchMethod_.signatureApplies(element)) { |
| 2997 ClassElement objectClass = commonElements.objectClass; | 2998 ClassElement objectClass = commonElements.objectClass; |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4073 } else if (element.isSetter) { | 4074 } else if (element.isSetter) { |
| 4074 code = "# = #"; | 4075 code = "# = #"; |
| 4075 } else { | 4076 } else { |
| 4076 var args = new List.filled(arguments.length, '#').join(','); | 4077 var args = new List.filled(arguments.length, '#').join(','); |
| 4077 code = element.isConstructor ? "new #($args)" : "#($args)"; | 4078 code = element.isConstructor ? "new #($args)" : "#($args)"; |
| 4078 } | 4079 } |
| 4079 js.Template codeTemplate = js.js.parseForeignJS(code); | 4080 js.Template codeTemplate = js.js.parseForeignJS(code); |
| 4080 nativeBehavior.codeTemplate = codeTemplate; | 4081 nativeBehavior.codeTemplate = codeTemplate; |
| 4081 | 4082 |
| 4082 return new HForeignCode(codeTemplate, commonMasks.dynamicType, inputs, | 4083 return new HForeignCode(codeTemplate, commonMasks.dynamicType, inputs, |
| 4083 nativeBehavior: nativeBehavior)..sourceInformation = sourceInformation; | 4084 nativeBehavior: nativeBehavior) |
| 4085 ..sourceInformation = sourceInformation; |
| 4084 } | 4086 } |
| 4085 | 4087 |
| 4086 void pushInvokeStatic( | 4088 void pushInvokeStatic( |
| 4087 ast.Node location, MethodElement element, List<HInstruction> arguments, | 4089 ast.Node location, MethodElement element, List<HInstruction> arguments, |
| 4088 {TypeMask typeMask, | 4090 {TypeMask typeMask, |
| 4089 ResolutionInterfaceType instanceType, | 4091 ResolutionInterfaceType instanceType, |
| 4090 SourceInformation sourceInformation}) { | 4092 SourceInformation sourceInformation}) { |
| 4091 assert(element.isDeclaration); | 4093 assert(element.isDeclaration); |
| 4092 // TODO(johnniwinther): Use [sourceInformation] instead of [location]. | 4094 // TODO(johnniwinther): Use [sourceInformation] instead of [location]. |
| 4093 if (tryInlineMethod(element, null, null, arguments, location, | 4095 if (tryInlineMethod(element, null, null, arguments, location, |
| (...skipping 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6739 this.oldReturnLocal, | 6741 this.oldReturnLocal, |
| 6740 this.oldReturnType, | 6742 this.oldReturnType, |
| 6741 this.oldResolvedAst, | 6743 this.oldResolvedAst, |
| 6742 this.oldStack, | 6744 this.oldStack, |
| 6743 this.oldLocalsHandler, | 6745 this.oldLocalsHandler, |
| 6744 this.inTryStatement, | 6746 this.inTryStatement, |
| 6745 this.allFunctionsCalledOnce, | 6747 this.allFunctionsCalledOnce, |
| 6746 this.oldElementInferenceResults) | 6748 this.oldElementInferenceResults) |
| 6747 : super(function); | 6749 : super(function); |
| 6748 } | 6750 } |
| OLD | NEW |