| 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 /** | 7 /** |
| 8 * A special element for the extra parameter taken by intercepted | 8 * A special element for the extra parameter taken by intercepted |
| 9 * methods. We need to override [Element.computeType] because our | 9 * methods. We need to override [Element.computeType] because our |
| 10 * optimizers may look at its declared type. | 10 * optimizers may look at its declared type. |
| (...skipping 3027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3038 // If the isolate library is not used, we just generate code | 3038 // If the isolate library is not used, we just generate code |
| 3039 // to fetch the Leg's current isolate. | 3039 // to fetch the Leg's current isolate. |
| 3040 String name = backend.namer.CURRENT_ISOLATE; | 3040 String name = backend.namer.CURRENT_ISOLATE; |
| 3041 push(new HForeign(new DartString.literal(name), | 3041 push(new HForeign(new DartString.literal(name), |
| 3042 const LiteralDartString('var'), | 3042 const LiteralDartString('var'), |
| 3043 <HInstruction>[])); | 3043 <HInstruction>[])); |
| 3044 } else { | 3044 } else { |
| 3045 // Call a helper method from the isolate library. The isolate | 3045 // Call a helper method from the isolate library. The isolate |
| 3046 // library uses its own isolate structure, that encapsulates | 3046 // library uses its own isolate structure, that encapsulates |
| 3047 // Leg's isolate. | 3047 // Leg's isolate. |
| 3048 Element element = compiler.isolateHelperLibrary.find( | 3048 Element element = compiler.isolateLibrary.find( |
| 3049 const SourceString('_currentIsolate')); | 3049 const SourceString('_currentIsolate')); |
| 3050 if (element == null) { | 3050 if (element == null) { |
| 3051 compiler.cancel( | 3051 compiler.cancel( |
| 3052 'Isolate library and compiler mismatch', node: node); | 3052 'Isolate library and compiler mismatch', node: node); |
| 3053 } | 3053 } |
| 3054 pushInvokeHelper0(element); | 3054 pushInvokeHelper0(element); |
| 3055 } | 3055 } |
| 3056 } | 3056 } |
| 3057 | 3057 |
| 3058 void handleForeignJsCallInIsolate(Send node) { | 3058 void handleForeignJsCallInIsolate(Send node) { |
| 3059 Link<Node> link = node.arguments; | 3059 Link<Node> link = node.arguments; |
| 3060 if (!compiler.hasIsolateSupport()) { | 3060 if (!compiler.hasIsolateSupport()) { |
| 3061 // If the isolate library is not used, we just invoke the | 3061 // If the isolate library is not used, we just invoke the |
| 3062 // closure. | 3062 // closure. |
| 3063 visit(link.tail.head); | 3063 visit(link.tail.head); |
| 3064 Selector selector = new Selector.callClosure(0); | 3064 Selector selector = new Selector.callClosure(0); |
| 3065 push(new HInvokeClosure(selector, <HInstruction>[pop()])); | 3065 push(new HInvokeClosure(selector, <HInstruction>[pop()])); |
| 3066 } else { | 3066 } else { |
| 3067 // Call a helper method from the isolate library. | 3067 // Call a helper method from the isolate library. |
| 3068 Element element = compiler.isolateHelperLibrary.find( | 3068 Element element = compiler.isolateLibrary.find( |
| 3069 const SourceString('_callInIsolate')); | 3069 const SourceString('_callInIsolate')); |
| 3070 if (element == null) { | 3070 if (element == null) { |
| 3071 compiler.cancel( | 3071 compiler.cancel( |
| 3072 'Isolate library and compiler mismatch', node: node); | 3072 'Isolate library and compiler mismatch', node: node); |
| 3073 } | 3073 } |
| 3074 HStatic target = new HStatic(element); | 3074 HStatic target = new HStatic(element); |
| 3075 add(target); | 3075 add(target); |
| 3076 List<HInstruction> inputs = <HInstruction>[target]; | 3076 List<HInstruction> inputs = <HInstruction>[target]; |
| 3077 addGenericSendArgumentsToList(link, inputs); | 3077 addGenericSendArgumentsToList(link, inputs); |
| 3078 push(new HInvokeStatic(inputs)); | 3078 push(new HInvokeStatic(inputs)); |
| (...skipping 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5074 new HSubGraphBlockInformation(elseBranch.graph)); | 5074 new HSubGraphBlockInformation(elseBranch.graph)); |
| 5075 | 5075 |
| 5076 HBasicBlock conditionStartBlock = conditionBranch.block; | 5076 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 5077 conditionStartBlock.setBlockFlow(info, joinBlock); | 5077 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 5078 SubGraph conditionGraph = conditionBranch.graph; | 5078 SubGraph conditionGraph = conditionBranch.graph; |
| 5079 HIf branch = conditionGraph.end.last; | 5079 HIf branch = conditionGraph.end.last; |
| 5080 assert(branch is HIf); | 5080 assert(branch is HIf); |
| 5081 branch.blockInformation = conditionStartBlock.blockFlow; | 5081 branch.blockInformation = conditionStartBlock.blockFlow; |
| 5082 } | 5082 } |
| 5083 } | 5083 } |
| OLD | NEW |