| 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 class Interceptors { | 5 class Interceptors { |
| 6 Compiler compiler; | 6 Compiler compiler; |
| 7 Interceptors(Compiler this.compiler); | 7 Interceptors(Compiler this.compiler); |
| 8 | 8 |
| 9 SourceString mapOperatorToMethodName(Operator op) { | 9 SourceString mapOperatorToMethodName(Operator op) { |
| 10 String name = op.source.stringValue; | 10 String name = op.source.stringValue; |
| (...skipping 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2547 target = new HInvokeSuper(inputs); | 2547 target = new HInvokeSuper(inputs); |
| 2548 add(target); | 2548 add(target); |
| 2549 inputs = <HInstruction>[target]; | 2549 inputs = <HInstruction>[target]; |
| 2550 addDynamicSendArgumentsToList(node, inputs); | 2550 addDynamicSendArgumentsToList(node, inputs); |
| 2551 push(new HInvokeClosure(selector, inputs)); | 2551 push(new HInvokeClosure(selector, inputs)); |
| 2552 } | 2552 } |
| 2553 } | 2553 } |
| 2554 | 2554 |
| 2555 HInstruction analyzeTypeArgument(DartType argument, Node currentNode) { | 2555 HInstruction analyzeTypeArgument(DartType argument, Node currentNode) { |
| 2556 if (argument.element.isTypeVariable()) { | 2556 if (argument.element.isTypeVariable()) { |
| 2557 if (work.element.isFactoryConstructor() | 2557 Element member = work.element; |
| 2558 || work.element.isGenerativeConstructor()) { | 2558 if (member.enclosingElement.isClosure()) { |
| 2559 member = (member.enclosingElement as ClosureClassElement).methodElement; |
| 2560 member = member.getOutermostEnclosingMemberOrTopLevel(); |
| 2561 } |
| 2562 if (member.isFactoryConstructor()) { |
| 2559 // The type variable is stored in a parameter of the | 2563 // The type variable is stored in a parameter of the |
| 2560 // factory. | 2564 // factory. |
| 2561 return localsHandler.readLocal(argument.element); | 2565 return localsHandler.readLocal(argument.element); |
| 2562 } else if (work.element.isInstanceMember()) { | 2566 } else if (member.isInstanceMember() |
| 2567 || member.isGenerativeConstructor()) { |
| 2563 // The type variable is stored in [this]. | 2568 // The type variable is stored in [this]. |
| 2564 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), | 2569 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), |
| 2565 localsHandler.readThis()); | 2570 localsHandler.readThis()); |
| 2566 HInstruction typeInfo = pop(); | 2571 HInstruction typeInfo = pop(); |
| 2567 HInstruction foreign = new HForeign( | 2572 HInstruction foreign = new HForeign( |
| 2568 new LiteralDartString('#.$argument'), | 2573 new LiteralDartString('#.$argument'), |
| 2569 new LiteralDartString('String'), | 2574 new LiteralDartString('String'), |
| 2570 <HInstruction>[typeInfo]); | 2575 <HInstruction>[typeInfo]); |
| 2571 add(foreign); | 2576 add(foreign); |
| 2572 return foreign; | 2577 return foreign; |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4032 new HSubGraphBlockInformation(elseBranch.graph)); | 4037 new HSubGraphBlockInformation(elseBranch.graph)); |
| 4033 | 4038 |
| 4034 HBasicBlock conditionStartBlock = conditionBranch.block; | 4039 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 4035 conditionStartBlock.setBlockFlow(info, joinBlock); | 4040 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 4036 SubGraph conditionGraph = conditionBranch.graph; | 4041 SubGraph conditionGraph = conditionBranch.graph; |
| 4037 HIf branch = conditionGraph.end.last; | 4042 HIf branch = conditionGraph.end.last; |
| 4038 assert(branch is HIf); | 4043 assert(branch is HIf); |
| 4039 branch.blockInformation = conditionStartBlock.blockFlow; | 4044 branch.blockInformation = conditionStartBlock.blockFlow; |
| 4040 } | 4045 } |
| 4041 } | 4046 } |
| OLD | NEW |