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 * from interop methods to match JavaScript semantics for ommitted arguments. |
| 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(), |
| 1618 sourceInformationBuilder.buildGeneric(function))); |
| 1619 var value = pop(); |
| 1620 closeAndGotoExit(new HReturn(value, |
| 1621 sourceInformationBuilder.buildReturn(functionElement.node))); |
| 1622 return closeFunction(); |
| 1623 } else { |
| 1624 assert(!function.modifiers.isExternal); |
| 1625 } |
| 1626 |
1603 // If [functionElement] is `operator==` we explicitely add a null check at | 1627 // 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 | 1628 // the beginning of the method. This is to avoid having call sites do the |
1605 // null check. | 1629 // null check. |
1606 if (name == '==') { | 1630 if (name == '==') { |
1607 if (!backend.operatorEqHandlesNullArgument(functionElement)) { | 1631 if (!backend.operatorEqHandlesNullArgument(functionElement)) { |
1608 handleIf( | 1632 handleIf( |
1609 function, | 1633 function, |
1610 visitCondition: () { | 1634 visitCondition: () { |
1611 HParameterValue parameter = parameters.values.first; | 1635 HParameterValue parameter = parameters.values.first; |
1612 push(new HIdentity( | 1636 push(new HIdentity( |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1774 returnType = state.oldReturnType; | 1798 returnType = state.oldReturnType; |
1775 assert(stack.isEmpty); | 1799 assert(stack.isEmpty); |
1776 stack = state.oldStack; | 1800 stack = state.oldStack; |
1777 } | 1801 } |
1778 | 1802 |
1779 /** | 1803 /** |
1780 * Run this builder on the body of the [function] to be inlined. | 1804 * Run this builder on the body of the [function] to be inlined. |
1781 */ | 1805 */ |
1782 void visitInlinedFunction(FunctionElement function) { | 1806 void visitInlinedFunction(FunctionElement function) { |
1783 potentiallyCheckInlinedParameterTypes(function); | 1807 potentiallyCheckInlinedParameterTypes(function); |
| 1808 |
1784 if (function.isGenerativeConstructor) { | 1809 if (function.isGenerativeConstructor) { |
1785 buildFactory(function); | 1810 buildFactory(function); |
1786 } else { | 1811 } else { |
1787 ast.FunctionExpression functionNode = function.node; | 1812 ast.FunctionExpression functionNode = function.node; |
1788 functionNode.body.accept(this); | 1813 functionNode.body.accept(this); |
1789 } | 1814 } |
1790 } | 1815 } |
1791 | 1816 |
1792 | 1817 |
1793 addInlinedInstantiation(DartType type) { | 1818 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 | 2102 * current constructor and super constructors or constructors redirected |
2078 * to, starting from the current constructor. | 2103 * to, starting from the current constructor. |
2079 * - Call the constructor bodies, starting from the constructor(s) in the | 2104 * - Call the constructor bodies, starting from the constructor(s) in the |
2080 * super class(es). | 2105 * super class(es). |
2081 */ | 2106 */ |
2082 HGraph buildFactory(ConstructorElement functionElement) { | 2107 HGraph buildFactory(ConstructorElement functionElement) { |
2083 functionElement = functionElement.implementation; | 2108 functionElement = functionElement.implementation; |
2084 ClassElement classElement = | 2109 ClassElement classElement = |
2085 functionElement.enclosingClass.implementation; | 2110 functionElement.enclosingClass.implementation; |
2086 bool isNativeUpgradeFactory = | 2111 bool isNativeUpgradeFactory = |
2087 Elements.isNativeOrExtendsNative(classElement); | 2112 Elements.isNativeOrExtendsNative(classElement) |
| 2113 && !classElement.isJsInterop; |
2088 ast.FunctionExpression function = functionElement.node; | 2114 ast.FunctionExpression function = functionElement.node; |
2089 // Note that constructors (like any other static function) do not need | 2115 // 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 | 2116 // to deal with optional arguments. It is the callers job to provide all |
2091 // arguments as if they were positional. | 2117 // arguments as if they were positional. |
2092 | 2118 |
2093 if (inliningStack.isEmpty) { | 2119 if (inliningStack.isEmpty) { |
2094 // The initializer list could contain closures. | 2120 // The initializer list could contain closures. |
2095 openFunction(functionElement, function); | 2121 openFunction(functionElement, function); |
2096 } | 2122 } |
2097 | 2123 |
(...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3856 | 3882 |
3857 HInstruction compileArgument(ast.Node argument) { | 3883 HInstruction compileArgument(ast.Node argument) { |
3858 visit(argument); | 3884 visit(argument); |
3859 return pop(); | 3885 return pop(); |
3860 } | 3886 } |
3861 | 3887 |
3862 return callStructure.makeArgumentsList( | 3888 return callStructure.makeArgumentsList( |
3863 arguments, | 3889 arguments, |
3864 element, | 3890 element, |
3865 compileArgument, | 3891 compileArgument, |
3866 handleConstantForOptionalParameter); | 3892 element.isJsInterop ? |
| 3893 handleConstantForOptionalParameterJsInterop : |
| 3894 handleConstantForOptionalParameter |
| 3895 ); |
3867 } | 3896 } |
3868 | 3897 |
3869 void addGenericSendArgumentsToList(Link<ast.Node> link, List<HInstruction> lis
t) { | 3898 void addGenericSendArgumentsToList(Link<ast.Node> link, List<HInstruction> lis
t) { |
3870 for (; !link.isEmpty; link = link.tail) { | 3899 for (; !link.isEmpty; link = link.tail) { |
3871 visit(link.head); | 3900 visit(link.head); |
3872 list.add(pop()); | 3901 list.add(pop()); |
3873 } | 3902 } |
3874 } | 3903 } |
3875 | 3904 |
3876 /// Generate a dynamic method, getter or setter invocation. | 3905 /// Generate a dynamic method, getter or setter invocation. |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4991 | 5020 |
4992 if (compiler.elementHasCompileTimeError(constructor)) { | 5021 if (compiler.elementHasCompileTimeError(constructor)) { |
4993 // TODO(ahe): Do something like [generateWrongArgumentCountError]. | 5022 // TODO(ahe): Do something like [generateWrongArgumentCountError]. |
4994 stack.add(graph.addConstantNull(compiler)); | 5023 stack.add(graph.addConstantNull(compiler)); |
4995 return; | 5024 return; |
4996 } | 5025 } |
4997 if (checkTypeVariableBounds(node, type)) return; | 5026 if (checkTypeVariableBounds(node, type)) return; |
4998 | 5027 |
4999 var inputs = <HInstruction>[]; | 5028 var inputs = <HInstruction>[]; |
5000 if (constructor.isGenerativeConstructor && | 5029 if (constructor.isGenerativeConstructor && |
5001 Elements.isNativeOrExtendsNative(constructor.enclosingClass)) { | 5030 Elements.isNativeOrExtendsNative(constructor.enclosingClass) && |
| 5031 !constructor.isJsInterop) { |
5002 // Native class generative constructors take a pre-constructed object. | 5032 // Native class generative constructors take a pre-constructed object. |
5003 inputs.add(graph.addConstantNull(compiler)); | 5033 inputs.add(graph.addConstantNull(compiler)); |
5004 } | 5034 } |
5005 // TODO(5347): Try to avoid the need for calling [implementation] before | 5035 // TODO(5347): Try to avoid the need for calling [implementation] before |
5006 // calling [makeStaticArgumentList]. | 5036 // calling [makeStaticArgumentList]. |
5007 constructorImplementation = constructor.implementation; | 5037 constructorImplementation = constructor.implementation; |
5008 if (constructorImplementation.isErroneous || | 5038 if (constructorImplementation.isErroneous || |
5009 !callStructure.signatureApplies( | 5039 !callStructure.signatureApplies( |
5010 constructorImplementation.functionSignature)) { | 5040 constructorImplementation.functionSignature)) { |
5011 generateWrongArgumentCountError(send, constructor, send.arguments); | 5041 generateWrongArgumentCountError(send, constructor, send.arguments); |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5719 push( | 5749 push( |
5720 new HInvokeDynamicSetter(selector, mask, null, inputs, type) | 5750 new HInvokeDynamicSetter(selector, mask, null, inputs, type) |
5721 ..sourceInformation = sourceInformation); | 5751 ..sourceInformation = sourceInformation); |
5722 } else { | 5752 } else { |
5723 push( | 5753 push( |
5724 new HInvokeDynamicMethod(selector, mask, inputs, type, isIntercepted) | 5754 new HInvokeDynamicMethod(selector, mask, inputs, type, isIntercepted) |
5725 ..sourceInformation = sourceInformation); | 5755 ..sourceInformation = sourceInformation); |
5726 } | 5756 } |
5727 } | 5757 } |
5728 | 5758 |
| 5759 HForeignCode invokeJsInteropFunction(Element element, |
| 5760 List<HInstruction> arguments, |
| 5761 SourceInformation sourceInformation) { |
| 5762 assert(element.isJsInterop); |
| 5763 nativeEmitter.nativeMethods.add(element); |
| 5764 var templateString; |
| 5765 |
| 5766 if (element.isFactoryConstructor) { |
| 5767 // Treat factory constructors as syntactic sugar for creating object |
| 5768 // literals. |
| 5769 var templateParts = []; |
| 5770 var parameterValues = []; |
| 5771 |
| 5772 ConstructorElement constructor = element; |
| 5773 FunctionSignature params = constructor.functionSignature; |
| 5774 int i = 0; |
| 5775 int positions = 0; |
| 5776 var filteredArguments = <HInstruction>[]; |
| 5777 var parameterNameMap = new Map<String, js.Expression>(); |
| 5778 params.orderedForEachParameter((ParameterElement parameter) { |
| 5779 // TODO(jacobr): throw if parameter names do not match names of property |
| 5780 // names in the class. |
| 5781 assert (parameter.isNamed); |
| 5782 if (!parameter.isNamed) { |
| 5783 compiler.reportError( |
| 5784 parameter, MessageKind.GENERIC, |
| 5785 {'text': 'Error: all arguments to external constructors of' |
| 5786 'JavaScript interop classes must be named as these' |
| 5787 'constructors are syntactic sugar for object literals'}); |
| 5788 } |
| 5789 var argument = arguments[i]; |
| 5790 if (argument != null) { |
| 5791 filteredArguments.add(argument); |
| 5792 parameterNameMap[parameter.name] = |
| 5793 new js.InterpolatedExpression(positions++); |
| 5794 } |
| 5795 i++; |
| 5796 }); |
| 5797 var codeTemplate = new js.Template(null, |
| 5798 js.objectLiteral(parameterNameMap)); |
| 5799 |
| 5800 var nativeBehavior = new native.NativeBehavior() |
| 5801 ..codeTemplate = codeTemplate; |
| 5802 return new HForeignCode( |
| 5803 codeTemplate, |
| 5804 backend.dynamicType, filteredArguments, |
| 5805 nativeBehavior: nativeBehavior) |
| 5806 ..sourceInformation = sourceInformation; |
| 5807 } |
| 5808 var target = new HForeignCode(js.js.parseForeignJS( |
| 5809 "${element.fixedBackendReceiver}.${element.fixedBackendName}"), |
| 5810 backend.dynamicType, |
| 5811 <HInstruction>[]); |
| 5812 add(target); |
| 5813 // Strip off trailing arguments that were not specified. |
| 5814 // we could assert that the trailing arguments are all null. |
| 5815 // TODO(jacobr): rewrite named arguments to an object literal matching |
| 5816 // the factory constructor case. |
| 5817 arguments = arguments.where((arg) => arg != null).toList(); |
| 5818 var inputs = [target]..addAll(arguments); |
| 5819 |
| 5820 var codeTemplate; |
| 5821 if (element.isGetter) { |
| 5822 codeTemplate = js.js.parseForeignJS("#"); |
| 5823 } else if (element.isSetter) { |
| 5824 codeTemplate = js.js.parseForeignJS("# = #"); |
| 5825 } else { |
| 5826 var argsStub = []; |
| 5827 for (int i = 0; i < arguments.length; i++) { |
| 5828 argsStub.add('#'); |
| 5829 } |
| 5830 if (element.isConstructor) { |
| 5831 codeTemplate = js.js.parseForeignJS("new #(${argsStub.join(",")})"); |
| 5832 } else { |
| 5833 codeTemplate = js.js.parseForeignJS("#(${argsStub.join(",")})"); |
| 5834 } |
| 5835 } |
| 5836 |
| 5837 var nativeBehavior = new native.NativeBehavior() |
| 5838 ..codeTemplate = codeTemplate |
| 5839 ..typesReturned.add( |
| 5840 backend.jsPlainJavaScriptObjectClass.computeType(compiler)) |
| 5841 ..typesInstantiated.add( |
| 5842 backend.jsPlainJavaScriptObjectClass.computeType(compiler)) |
| 5843 ..sideEffects.setAllSideEffects(); |
| 5844 return new HForeignCode( |
| 5845 codeTemplate, |
| 5846 backend.dynamicType, inputs, |
| 5847 nativeBehavior: nativeBehavior) |
| 5848 ..sourceInformation = sourceInformation; |
| 5849 } |
| 5850 |
5729 void pushInvokeStatic(ast.Node location, | 5851 void pushInvokeStatic(ast.Node location, |
5730 Element element, | 5852 Element element, |
5731 List<HInstruction> arguments, | 5853 List<HInstruction> arguments, |
5732 {TypeMask typeMask, | 5854 {TypeMask typeMask, |
5733 InterfaceType instanceType, | 5855 InterfaceType instanceType, |
5734 SourceInformation sourceInformation}) { | 5856 SourceInformation sourceInformation}) { |
5735 // TODO(johnniwinther): Use [sourceInformation] instead of [location]. | 5857 // TODO(johnniwinther): Use [sourceInformation] instead of [location]. |
5736 if (tryInlineMethod(element, null, null, arguments, location, | 5858 if (tryInlineMethod(element, null, null, arguments, location, |
5737 instanceType: instanceType)) { | 5859 instanceType: instanceType)) { |
5738 return; | 5860 return; |
5739 } | 5861 } |
5740 | 5862 |
5741 if (typeMask == null) { | 5863 if (typeMask == null) { |
5742 typeMask = | 5864 typeMask = |
5743 TypeMaskFactory.inferredReturnTypeForElement(element, compiler); | 5865 TypeMaskFactory.inferredReturnTypeForElement(element, compiler); |
5744 } | 5866 } |
5745 bool targetCanThrow = !compiler.world.getCannotThrow(element); | 5867 bool targetCanThrow = !compiler.world.getCannotThrow(element); |
5746 // TODO(5346): Try to avoid the need for calling [declaration] before | 5868 // TODO(5346): Try to avoid the need for calling [declaration] before |
5747 // creating an [HInvokeStatic]. | 5869 var instruction; |
5748 HInvokeStatic instruction = new HInvokeStatic( | 5870 if (element.isJsInterop) { |
5749 element.declaration, arguments, typeMask, | 5871 instruction = invokeJsInteropFunction(element, arguments, |
5750 targetCanThrow: targetCanThrow) | 5872 sourceInformation); |
5751 ..sourceInformation = sourceInformation; | 5873 } else { |
5752 if (!currentInlinedInstantiations.isEmpty) { | 5874 // creating an [HInvokeStatic]. |
5753 instruction.instantiatedTypes = new List<DartType>.from( | 5875 instruction = new HInvokeStatic( |
5754 currentInlinedInstantiations); | 5876 element.declaration, arguments, typeMask, |
| 5877 targetCanThrow: targetCanThrow) |
| 5878 ..sourceInformation = sourceInformation; |
| 5879 if (!currentInlinedInstantiations.isEmpty) { |
| 5880 instruction.instantiatedTypes = new List<DartType>.from( |
| 5881 currentInlinedInstantiations); |
| 5882 } |
| 5883 instruction.sideEffects = compiler.world.getSideEffectsOfElement(element); |
5755 } | 5884 } |
5756 instruction.sideEffects = compiler.world.getSideEffectsOfElement(element); | |
5757 if (location == null) { | 5885 if (location == null) { |
5758 push(instruction); | 5886 push(instruction); |
5759 } else { | 5887 } else { |
5760 pushWithPosition(instruction, location); | 5888 pushWithPosition(instruction, location); |
5761 } | 5889 } |
5762 } | 5890 } |
5763 | 5891 |
5764 HInstruction buildInvokeSuper(Selector selector, | 5892 HInstruction buildInvokeSuper(Selector selector, |
5765 Element element, | 5893 Element element, |
5766 List<HInstruction> arguments, | 5894 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'; | 9054 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
8927 unaliased.accept(this, builder); | 9055 unaliased.accept(this, builder); |
8928 } | 9056 } |
8929 | 9057 |
8930 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 9058 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
8931 JavaScriptBackend backend = builder.compiler.backend; | 9059 JavaScriptBackend backend = builder.compiler.backend; |
8932 ClassElement cls = backend.findHelper('DynamicRuntimeType'); | 9060 ClassElement cls = backend.findHelper('DynamicRuntimeType'); |
8933 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 9061 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
8934 } | 9062 } |
8935 } | 9063 } |
OLD | NEW |