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 part of ssa; | 5 part of ssa; |
6 | 6 |
7 class SsaFunctionCompiler implements FunctionCompiler { | 7 class SsaFunctionCompiler implements FunctionCompiler { |
8 final SsaCodeGeneratorTask generator; | 8 final SsaCodeGeneratorTask generator; |
9 final SsaBuilderTask builder; | 9 final SsaBuilderTask builder; |
10 final SsaOptimizerTask optimizer; | 10 final SsaOptimizerTask optimizer; |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1290 Selector selector, | 1290 Selector selector, |
1291 TypeMask mask, | 1291 TypeMask mask, |
1292 List<HInstruction> providedArguments, | 1292 List<HInstruction> providedArguments, |
1293 ast.Node currentNode, | 1293 ast.Node currentNode, |
1294 {InterfaceType instanceType}) { | 1294 {InterfaceType instanceType}) { |
1295 // TODO(johnniwinther): Register this on the [registry]. Currently the | 1295 // TODO(johnniwinther): Register this on the [registry]. Currently the |
1296 // [CodegenRegistry] calls the enqueuer, but [element] should _not_ be | 1296 // [CodegenRegistry] calls the enqueuer, but [element] should _not_ be |
1297 // enqueued. | 1297 // enqueued. |
1298 backend.registerStaticUse(element, compiler.enqueuer.codegen); | 1298 backend.registerStaticUse(element, compiler.enqueuer.codegen); |
1299 | 1299 |
1300 if (element.isJsInterop && !element.isFactoryConstructor) { | |
1301 // We only inline factory JavaScript interop constructors. | |
1302 return false; | |
1303 } | |
1304 | |
1300 // Ensure that [element] is an implementation element. | 1305 // Ensure that [element] is an implementation element. |
1301 element = element.implementation; | 1306 element = element.implementation; |
1302 | 1307 |
1303 if (compiler.elementHasCompileTimeError(element)) return false; | 1308 if (compiler.elementHasCompileTimeError(element)) return false; |
1304 | 1309 |
1305 FunctionElement function = element; | 1310 FunctionElement function = element; |
1306 bool insideLoop = loopNesting > 0 || graph.calledInLoop; | 1311 bool insideLoop = loopNesting > 0 || graph.calledInLoop; |
1307 | 1312 |
1308 // Bail out early if the inlining decision is in the cache and we can't | 1313 // Bail out early if the inlining decision is in the cache and we can't |
1309 // inline (no need to check the hard constraints). | 1314 // inline (no need to check the hard constraints). |
(...skipping 10 matching lines...) Expand all Loading... | |
1320 Elements.isStaticOrTopLevel(element) || | 1325 Elements.isStaticOrTopLevel(element) || |
1321 element.isGenerativeConstructorBody, | 1326 element.isGenerativeConstructorBody, |
1322 message: "Missing selector for inlining of $element.")); | 1327 message: "Missing selector for inlining of $element.")); |
1323 if (selector != null) { | 1328 if (selector != null) { |
1324 if (!selector.applies(function, compiler.world)) return false; | 1329 if (!selector.applies(function, compiler.world)) return false; |
1325 if (mask != null && !mask.canHit(function, selector, compiler.world)) { | 1330 if (mask != null && !mask.canHit(function, selector, compiler.world)) { |
1326 return false; | 1331 return false; |
1327 } | 1332 } |
1328 } | 1333 } |
1329 | 1334 |
1335 if (element.isJsInterop) return false; | |
1336 | |
1330 // Don't inline operator== methods if the parameter can be null. | 1337 // Don't inline operator== methods if the parameter can be null. |
1331 if (element.name == '==') { | 1338 if (element.name == '==') { |
1332 if (element.enclosingClass != compiler.objectClass | 1339 if (element.enclosingClass != compiler.objectClass |
1333 && providedArguments[1].canBeNull()) { | 1340 && providedArguments[1].canBeNull()) { |
1334 return false; | 1341 return false; |
1335 } | 1342 } |
1336 } | 1343 } |
1337 | 1344 |
1338 // Generative constructors of native classes should not be called directly | 1345 // Generative constructors of native classes should not be called directly |
1339 // and have an extra argument that causes problems with inlining. | 1346 // and have an extra argument that causes problems with inlining. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1495 sourceInformationBuilder = | 1502 sourceInformationBuilder = |
1496 sourceInformationBuilder.forContext(element.implementation); | 1503 sourceInformationBuilder.forContext(element.implementation); |
1497 sourceElementStack.add(element.declaration); | 1504 sourceElementStack.add(element.declaration); |
1498 var result = f(); | 1505 var result = f(); |
1499 sourceInformationBuilder = oldSourceInformationBuilder; | 1506 sourceInformationBuilder = oldSourceInformationBuilder; |
1500 sourceElementStack.removeLast(); | 1507 sourceElementStack.removeLast(); |
1501 return result; | 1508 return result; |
1502 }); | 1509 }); |
1503 } | 1510 } |
1504 | 1511 |
1512 /** | |
1513 * Return null so it is simple to remove the optional parameters completely | |
1514 * interop methods to match JavaScript semantics for ommitted arguments. | |
Siggi Cherem (dart-lang)
2015/09/18 20:34:10
completely interop => completely from interop?
Jacob
2015/10/01 00:47:33
Done.
| |
1515 */ | |
1516 HInstruction handleConstantForOptionalParameterJsInterop(Element parameter) => | |
1517 null; | |
1518 | |
1505 HInstruction handleConstantForOptionalParameter(Element parameter) { | 1519 HInstruction handleConstantForOptionalParameter(Element parameter) { |
1506 ConstantValue constantValue = | 1520 ConstantValue constantValue = |
1507 backend.constants.getConstantValueForVariable(parameter); | 1521 backend.constants.getConstantValueForVariable(parameter); |
1508 assert(invariant(parameter, constantValue != null, | 1522 assert(invariant(parameter, constantValue != null, |
1509 message: 'No constant computed for $parameter')); | 1523 message: 'No constant computed for $parameter')); |
1510 return graph.addConstant(constantValue, compiler); | 1524 return graph.addConstant(constantValue, compiler); |
1511 } | 1525 } |
1512 | 1526 |
1513 Element get currentNonClosureClass { | 1527 Element get currentNonClosureClass { |
1514 ClassElement cls = sourceElement.enclosingClass; | 1528 ClassElement cls = sourceElement.enclosingClass; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1589 /** | 1603 /** |
1590 * Documentation wanted -- johnniwinther | 1604 * Documentation wanted -- johnniwinther |
1591 * | 1605 * |
1592 * Invariant: [functionElement] must be an implementation element. | 1606 * Invariant: [functionElement] must be an implementation element. |
1593 */ | 1607 */ |
1594 HGraph buildMethod(FunctionElement functionElement) { | 1608 HGraph buildMethod(FunctionElement functionElement) { |
1595 assert(invariant(functionElement, functionElement.isImplementation)); | 1609 assert(invariant(functionElement, functionElement.isImplementation)); |
1596 graph.calledInLoop = compiler.world.isCalledInLoop(functionElement); | 1610 graph.calledInLoop = compiler.world.isCalledInLoop(functionElement); |
1597 ast.FunctionExpression function = functionElement.node; | 1611 ast.FunctionExpression function = functionElement.node; |
1598 assert(function != null); | 1612 assert(function != null); |
1599 assert(!function.modifiers.isExternal); | |
1600 assert(elements.getFunctionDefinition(function) != null); | 1613 assert(elements.getFunctionDefinition(function) != null); |
1601 openFunction(functionElement, function); | 1614 openFunction(functionElement, function); |
1602 String name = functionElement.name; | 1615 String name = functionElement.name; |
1616 if (functionElement.isJsInterop) { | |
1617 push(invokeJsInteropFunction(functionElement, parameters.values.toList(), sourceInformationBuilder.buildGeneric(function))); | |
Siggi Cherem (dart-lang)
2015/09/18 20:34:10
long lines (here and below)
Jacob
2015/10/01 00:47:33
Done.
| |
1618 var value = pop(); | |
1619 closeAndGotoExit(new HReturn(value, | |
1620 sourceInformationBuilder.buildReturn(functionElement.node))); | |
Siggi Cherem (dart-lang)
2015/09/18 20:34:10
indent
Jacob
2015/10/01 00:47:33
Done.
| |
1621 return closeFunction(); | |
1622 } else { | |
1623 assert(!function.modifiers.isExternal); | |
1624 } | |
1625 | |
1603 // If [functionElement] is `operator==` we explicitely add a null check at | 1626 // If [functionElement] is `operator==` we explicitely add a null check at |
1604 // the beginning of the method. This is to avoid having call sites do the | 1627 // the beginning of the method. This is to avoid having call sites do the |
1605 // null check. | 1628 // null check. |
1606 if (name == '==') { | 1629 if (name == '==') { |
1607 if (!backend.operatorEqHandlesNullArgument(functionElement)) { | 1630 if (!backend.operatorEqHandlesNullArgument(functionElement)) { |
1608 handleIf( | 1631 handleIf( |
1609 function, | 1632 function, |
1610 visitCondition: () { | 1633 visitCondition: () { |
1611 HParameterValue parameter = parameters.values.first; | 1634 HParameterValue parameter = parameters.values.first; |
1612 push(new HIdentity( | 1635 push(new HIdentity( |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1774 returnType = state.oldReturnType; | 1797 returnType = state.oldReturnType; |
1775 assert(stack.isEmpty); | 1798 assert(stack.isEmpty); |
1776 stack = state.oldStack; | 1799 stack = state.oldStack; |
1777 } | 1800 } |
1778 | 1801 |
1779 /** | 1802 /** |
1780 * Run this builder on the body of the [function] to be inlined. | 1803 * Run this builder on the body of the [function] to be inlined. |
1781 */ | 1804 */ |
1782 void visitInlinedFunction(FunctionElement function) { | 1805 void visitInlinedFunction(FunctionElement function) { |
1783 potentiallyCheckInlinedParameterTypes(function); | 1806 potentiallyCheckInlinedParameterTypes(function); |
1807 | |
1784 if (function.isGenerativeConstructor) { | 1808 if (function.isGenerativeConstructor) { |
1785 buildFactory(function); | 1809 buildFactory(function); |
1786 } else { | 1810 } else { |
1787 ast.FunctionExpression functionNode = function.node; | 1811 ast.FunctionExpression functionNode = function.node; |
1788 functionNode.body.accept(this); | 1812 functionNode.body.accept(this); |
1789 } | 1813 } |
1790 } | 1814 } |
1791 | 1815 |
1792 | 1816 |
1793 addInlinedInstantiation(DartType type) { | 1817 addInlinedInstantiation(DartType type) { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2077 * current constructor and super constructors or constructors redirected | 2101 * current constructor and super constructors or constructors redirected |
2078 * to, starting from the current constructor. | 2102 * to, starting from the current constructor. |
2079 * - Call the constructor bodies, starting from the constructor(s) in the | 2103 * - Call the constructor bodies, starting from the constructor(s) in the |
2080 * super class(es). | 2104 * super class(es). |
2081 */ | 2105 */ |
2082 HGraph buildFactory(ConstructorElement functionElement) { | 2106 HGraph buildFactory(ConstructorElement functionElement) { |
2083 functionElement = functionElement.implementation; | 2107 functionElement = functionElement.implementation; |
2084 ClassElement classElement = | 2108 ClassElement classElement = |
2085 functionElement.enclosingClass.implementation; | 2109 functionElement.enclosingClass.implementation; |
2086 bool isNativeUpgradeFactory = | 2110 bool isNativeUpgradeFactory = |
2087 Elements.isNativeOrExtendsNative(classElement); | 2111 Elements.isNativeOrExtendsNative(classElement) |
2112 && !classElement.isJsInterop; | |
2088 ast.FunctionExpression function = functionElement.node; | 2113 ast.FunctionExpression function = functionElement.node; |
2089 // Note that constructors (like any other static function) do not need | 2114 // Note that constructors (like any other static function) do not need |
2090 // to deal with optional arguments. It is the callers job to provide all | 2115 // to deal with optional arguments. It is the callers job to provide all |
2091 // arguments as if they were positional. | 2116 // arguments as if they were positional. |
2092 | 2117 |
2093 if (inliningStack.isEmpty) { | 2118 if (inliningStack.isEmpty) { |
2094 // The initializer list could contain closures. | 2119 // The initializer list could contain closures. |
2095 openFunction(functionElement, function); | 2120 openFunction(functionElement, function); |
2096 } | 2121 } |
2097 | 2122 |
(...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3856 | 3881 |
3857 HInstruction compileArgument(ast.Node argument) { | 3882 HInstruction compileArgument(ast.Node argument) { |
3858 visit(argument); | 3883 visit(argument); |
3859 return pop(); | 3884 return pop(); |
3860 } | 3885 } |
3861 | 3886 |
3862 return callStructure.makeArgumentsList( | 3887 return callStructure.makeArgumentsList( |
3863 arguments, | 3888 arguments, |
3864 element, | 3889 element, |
3865 compileArgument, | 3890 compileArgument, |
3866 handleConstantForOptionalParameter); | 3891 element.isJsInterop ? |
3892 handleConstantForOptionalParameterJsInterop : | |
3893 handleConstantForOptionalParameter | |
3894 ); | |
3867 } | 3895 } |
3868 | 3896 |
3869 void addGenericSendArgumentsToList(Link<ast.Node> link, List<HInstruction> lis t) { | 3897 void addGenericSendArgumentsToList(Link<ast.Node> link, List<HInstruction> lis t) { |
3870 for (; !link.isEmpty; link = link.tail) { | 3898 for (; !link.isEmpty; link = link.tail) { |
3871 visit(link.head); | 3899 visit(link.head); |
3872 list.add(pop()); | 3900 list.add(pop()); |
3873 } | 3901 } |
3874 } | 3902 } |
3875 | 3903 |
3876 /// Generate a dynamic method, getter or setter invocation. | 3904 /// Generate a dynamic method, getter or setter invocation. |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4991 | 5019 |
4992 if (compiler.elementHasCompileTimeError(constructor)) { | 5020 if (compiler.elementHasCompileTimeError(constructor)) { |
4993 // TODO(ahe): Do something like [generateWrongArgumentCountError]. | 5021 // TODO(ahe): Do something like [generateWrongArgumentCountError]. |
4994 stack.add(graph.addConstantNull(compiler)); | 5022 stack.add(graph.addConstantNull(compiler)); |
4995 return; | 5023 return; |
4996 } | 5024 } |
4997 if (checkTypeVariableBounds(node, type)) return; | 5025 if (checkTypeVariableBounds(node, type)) return; |
4998 | 5026 |
4999 var inputs = <HInstruction>[]; | 5027 var inputs = <HInstruction>[]; |
5000 if (constructor.isGenerativeConstructor && | 5028 if (constructor.isGenerativeConstructor && |
5001 Elements.isNativeOrExtendsNative(constructor.enclosingClass)) { | 5029 Elements.isNativeOrExtendsNative(constructor.enclosingClass) && |
5030 !constructor.isJsInterop) { | |
5002 // Native class generative constructors take a pre-constructed object. | 5031 // Native class generative constructors take a pre-constructed object. |
5003 inputs.add(graph.addConstantNull(compiler)); | 5032 inputs.add(graph.addConstantNull(compiler)); |
5004 } | 5033 } |
5005 // TODO(5347): Try to avoid the need for calling [implementation] before | 5034 // TODO(5347): Try to avoid the need for calling [implementation] before |
5006 // calling [makeStaticArgumentList]. | 5035 // calling [makeStaticArgumentList]. |
5007 constructorImplementation = constructor.implementation; | 5036 constructorImplementation = constructor.implementation; |
5008 if (constructorImplementation.isErroneous || | 5037 if (constructorImplementation.isErroneous || |
5009 !callStructure.signatureApplies( | 5038 !callStructure.signatureApplies( |
5010 constructorImplementation.functionSignature)) { | 5039 constructorImplementation.functionSignature)) { |
5011 generateWrongArgumentCountError(send, constructor, send.arguments); | 5040 generateWrongArgumentCountError(send, constructor, send.arguments); |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5719 push( | 5748 push( |
5720 new HInvokeDynamicSetter(selector, mask, null, inputs, type) | 5749 new HInvokeDynamicSetter(selector, mask, null, inputs, type) |
5721 ..sourceInformation = sourceInformation); | 5750 ..sourceInformation = sourceInformation); |
5722 } else { | 5751 } else { |
5723 push( | 5752 push( |
5724 new HInvokeDynamicMethod(selector, mask, inputs, type, isIntercepted) | 5753 new HInvokeDynamicMethod(selector, mask, inputs, type, isIntercepted) |
5725 ..sourceInformation = sourceInformation); | 5754 ..sourceInformation = sourceInformation); |
5726 } | 5755 } |
5727 } | 5756 } |
5728 | 5757 |
5758 HForeignCode invokeJsInteropFunction(Element element, | |
5759 List<HInstruction> arguments, | |
5760 SourceInformation sourceInformation) { | |
5761 assert(element.isJsInterop); | |
5762 nativeEmitter.nativeMethods.add(element); | |
5763 var templateString; | |
sra1
2015/10/01 17:34:30
The rest of this file uses local types.
We have fo
Jacob
2015/10/02 20:08:15
Done. Tried to match the general style of builder.
| |
5764 | |
5765 if (element.isFactoryConstructor) { | |
5766 // Treat factory constructors as syntactic sugar for creating object | |
5767 // literals. | |
5768 var templateParts = []; | |
5769 var parameterValues = []; | |
5770 | |
5771 FunctionSignature params = (element as ConstructorElement).functionSignatu re; | |
sra1
2015/10/01 17:34:30
The dart2js way is to use a local declaration:
C
Jacob
2015/10/02 20:08:15
Done.
| |
5772 int i = 0; | |
5773 int positions = 0; | |
5774 var filteredArguments = <HInstruction>[]; | |
5775 var parameterNameMap = new Map<String, js.Expression>(); | |
5776 params.orderedForEachParameter((ParameterElement parameter) { | |
5777 // TODO(jacobr): throw if parameter names do not match names of property | |
5778 // names in the class. | |
5779 assert (parameter.isNamed); | |
5780 if (!parameter.isNamed) { | |
5781 compiler.reportError( | |
5782 parameter, MessageKind.GENERIC, | |
5783 {'text': 'Error: all arguments to external constructors of' | |
5784 'JavaScript interop classes must be named as these' | |
5785 'constructors are syntactic sugar for object literals'}); | |
5786 } | |
5787 var argument = arguments[i]; | |
5788 if (argument != null) { | |
5789 filteredArguments.add(argument); | |
5790 parameterNameMap[parameter.name] = | |
5791 new js.InterpolatedExpression(positions++); | |
5792 } | |
5793 i++; | |
5794 }); | |
5795 var codeTemplate = new js.Template(null, | |
5796 js.objectLiteral(parameterNameMap)); | |
5797 | |
5798 var nativeBehavior = new native.NativeBehavior() | |
5799 ..codeTemplate = codeTemplate; | |
5800 return new HForeignCode( | |
5801 codeTemplate, | |
5802 backend.dynamicType, filteredArguments, | |
5803 nativeBehavior: nativeBehavior) | |
5804 ..sourceInformation = sourceInformation; | |
5805 } | |
5806 var target = new HForeignCode(js.js.parseForeignJS( | |
5807 element.isInstanceMember ? | |
5808 "this.${element.fixedBackendName}" : element.fixedBackendName), | |
5809 backend.dynamicType, | |
5810 <HInstruction>[]); | |
5811 add(target); | |
5812 // Strip off trailing arguments that were not specified. | |
5813 // we could assert that the trailing arguments are all null. | |
5814 // TODO(jacobr): rewrite named arguments to an object literal matching | |
5815 // the factory constructor case. | |
5816 arguments = arguments.where((arg) => arg != null).toList(); | |
5817 var inputs = [target]..addAll(arguments); | |
5818 | |
5819 var codeTemplate; | |
5820 if (element.isGetter) { | |
5821 codeTemplate = js.js.parseForeignJS("#"); | |
5822 } else if (element.isSetter) { | |
5823 codeTemplate = js.js.parseForeignJS("# = #"); | |
5824 } else { | |
5825 var argsStub = []; | |
5826 for (int i = 0; i < arguments.length; i++) { | |
5827 argsStub.add('#'); | |
5828 } | |
5829 if (element.isConstructor) { | |
5830 codeTemplate = js.js.parseForeignJS("new #(${argsStub.join(",")})"); | |
5831 } else { | |
5832 codeTemplate = js.js.parseForeignJS("#(${argsStub.join(",")})"); | |
5833 } | |
5834 } | |
5835 | |
5836 var nativeBehavior = new native.NativeBehavior() | |
5837 ..codeTemplate = codeTemplate | |
5838 ..typesReturned.add(backend.jsPlainJavaScriptObjectClass.computeType(compi ler)) | |
5839 ..typesInstantiated.add(backend.jsPlainJavaScriptObjectClass.computeType(c ompiler)) | |
5840 ..sideEffects.setAllSideEffects(); | |
5841 return new HForeignCode( | |
5842 codeTemplate, | |
5843 backend.dynamicType, inputs, | |
5844 nativeBehavior: nativeBehavior) | |
5845 ..sourceInformation = sourceInformation; | |
5846 } | |
5847 | |
5729 void pushInvokeStatic(ast.Node location, | 5848 void pushInvokeStatic(ast.Node location, |
5730 Element element, | 5849 Element element, |
5731 List<HInstruction> arguments, | 5850 List<HInstruction> arguments, |
5732 {TypeMask typeMask, | 5851 {TypeMask typeMask, |
5733 InterfaceType instanceType, | 5852 InterfaceType instanceType, |
5734 SourceInformation sourceInformation}) { | 5853 SourceInformation sourceInformation}) { |
5735 // TODO(johnniwinther): Use [sourceInformation] instead of [location]. | 5854 // TODO(johnniwinther): Use [sourceInformation] instead of [location]. |
5736 if (tryInlineMethod(element, null, null, arguments, location, | 5855 if (tryInlineMethod(element, null, null, arguments, location, |
5737 instanceType: instanceType)) { | 5856 instanceType: instanceType)) { |
5738 return; | 5857 return; |
5739 } | 5858 } |
5740 | 5859 |
5741 if (typeMask == null) { | 5860 if (typeMask == null) { |
5742 typeMask = | 5861 typeMask = |
5743 TypeMaskFactory.inferredReturnTypeForElement(element, compiler); | 5862 TypeMaskFactory.inferredReturnTypeForElement(element, compiler); |
5744 } | 5863 } |
5745 bool targetCanThrow = !compiler.world.getCannotThrow(element); | 5864 bool targetCanThrow = !compiler.world.getCannotThrow(element); |
5746 // TODO(5346): Try to avoid the need for calling [declaration] before | 5865 // TODO(5346): Try to avoid the need for calling [declaration] before |
5747 // creating an [HInvokeStatic]. | 5866 var instruction; |
5748 HInvokeStatic instruction = new HInvokeStatic( | 5867 if (element.isJsInterop) { |
5749 element.declaration, arguments, typeMask, | 5868 instruction = invokeJsInteropFunction(element, arguments, sourceInformatio n); |
5750 targetCanThrow: targetCanThrow) | 5869 } else { |
5751 ..sourceInformation = sourceInformation; | 5870 // creating an [HInvokeStatic]. |
5752 if (!currentInlinedInstantiations.isEmpty) { | 5871 instruction = new HInvokeStatic( |
5753 instruction.instantiatedTypes = new List<DartType>.from( | 5872 element.declaration, arguments, typeMask, |
5754 currentInlinedInstantiations); | 5873 targetCanThrow: targetCanThrow) |
5874 ..sourceInformation = sourceInformation; | |
5875 if (!currentInlinedInstantiations.isEmpty) { | |
5876 instruction.instantiatedTypes = new List<DartType>.from( | |
5877 currentInlinedInstantiations); | |
5878 } | |
5879 instruction.sideEffects = compiler.world.getSideEffectsOfElement(element); | |
5755 } | 5880 } |
5756 instruction.sideEffects = compiler.world.getSideEffectsOfElement(element); | |
5757 if (location == null) { | 5881 if (location == null) { |
5758 push(instruction); | 5882 push(instruction); |
5759 } else { | 5883 } else { |
5760 pushWithPosition(instruction, location); | 5884 pushWithPosition(instruction, location); |
5761 } | 5885 } |
5762 } | 5886 } |
5763 | 5887 |
5764 HInstruction buildInvokeSuper(Selector selector, | 5888 HInstruction buildInvokeSuper(Selector selector, |
5765 Element element, | 5889 Element element, |
5766 List<HInstruction> arguments, | 5890 List<HInstruction> arguments, |
(...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8926 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 9050 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
8927 unaliased.accept(this, builder); | 9051 unaliased.accept(this, builder); |
8928 } | 9052 } |
8929 | 9053 |
8930 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 9054 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
8931 JavaScriptBackend backend = builder.compiler.backend; | 9055 JavaScriptBackend backend = builder.compiler.backend; |
8932 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 9056 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
8933 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 9057 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
8934 } | 9058 } |
8935 } | 9059 } |
OLD | NEW |