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 2411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2422 enableMethodInterception(); | 2422 enableMethodInterception(); |
2423 } | 2423 } |
2424 | 2424 |
2425 void handleForeignJsHasEquals(Send node) { | 2425 void handleForeignJsHasEquals(Send node) { |
2426 List<HInstruction> inputs = <HInstruction>[]; | 2426 List<HInstruction> inputs = <HInstruction>[]; |
2427 if (!node.arguments.tail.isEmpty()) { | 2427 if (!node.arguments.tail.isEmpty()) { |
2428 compiler.cancel( | 2428 compiler.cancel( |
2429 'More than one expression in JS_HAS_EQUALS()', node: node); | 2429 'More than one expression in JS_HAS_EQUALS()', node: node); |
2430 } | 2430 } |
2431 addGenericSendArgumentsToList(node.arguments, inputs); | 2431 addGenericSendArgumentsToList(node.arguments, inputs); |
2432 String name = backend.namer.instanceMethodName( | 2432 String name = |
2433 currentLibrary, Elements.OPERATOR_EQUALS, 1); | 2433 backend.namer.instanceMethodNameByArity(Elements.OPERATOR_EQUALS, 1); |
2434 push(new HForeign(new DartString.literal('!!#.$name'), | 2434 push(new HForeign(new DartString.literal('!!#.$name'), |
2435 const LiteralDartString('bool'), | 2435 const LiteralDartString('bool'), |
2436 inputs)); | 2436 inputs)); |
2437 } | 2437 } |
2438 | 2438 |
2439 void handleForeignJsCurrentIsolate(Send node) { | 2439 void handleForeignJsCurrentIsolate(Send node) { |
2440 if (!node.arguments.isEmpty()) { | 2440 if (!node.arguments.isEmpty()) { |
2441 compiler.cancel( | 2441 compiler.cancel( |
2442 'Too many arguments to JS_CURRENT_ISOLATE', node: node); | 2442 'Too many arguments to JS_CURRENT_ISOLATE', node: node); |
2443 } | 2443 } |
(...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4140 new HSubGraphBlockInformation(elseBranch.graph)); | 4140 new HSubGraphBlockInformation(elseBranch.graph)); |
4141 | 4141 |
4142 HBasicBlock conditionStartBlock = conditionBranch.block; | 4142 HBasicBlock conditionStartBlock = conditionBranch.block; |
4143 conditionStartBlock.setBlockFlow(info, joinBlock); | 4143 conditionStartBlock.setBlockFlow(info, joinBlock); |
4144 SubGraph conditionGraph = conditionBranch.graph; | 4144 SubGraph conditionGraph = conditionBranch.graph; |
4145 HIf branch = conditionGraph.end.last; | 4145 HIf branch = conditionGraph.end.last; |
4146 assert(branch is HIf); | 4146 assert(branch is HIf); |
4147 branch.blockInformation = conditionStartBlock.blockFlow; | 4147 branch.blockInformation = conditionStartBlock.blockFlow; |
4148 } | 4148 } |
4149 } | 4149 } |
OLD | NEW |