| 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 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 // TODO(ahe): The constructor name is statically resolved. See | 1325 // TODO(ahe): The constructor name is statically resolved. See |
| 1326 // SsaCodeGenerator.visitInvokeDynamicMethod. Is there a cleaner | 1326 // SsaCodeGenerator.visitInvokeDynamicMethod. Is there a cleaner |
| 1327 // way to do this? | 1327 // way to do this? |
| 1328 SourceString name = | 1328 SourceString name = |
| 1329 new SourceString(backend.namer.getName(body.declaration)); | 1329 new SourceString(backend.namer.getName(body.declaration)); |
| 1330 // TODO(kasperl): This seems fishy. We shouldn't be inventing all | 1330 // TODO(kasperl): This seems fishy. We shouldn't be inventing all |
| 1331 // these selectors. Maybe the resolver can do more of the work | 1331 // these selectors. Maybe the resolver can do more of the work |
| 1332 // for us here? | 1332 // for us here? |
| 1333 LibraryElement library = body.getLibrary(); | 1333 LibraryElement library = body.getLibrary(); |
| 1334 Selector selector = new Selector.call(name, library, arity); | 1334 Selector selector = new Selector.call(name, library, arity); |
| 1335 add(new HInvokeDynamicMethod(selector, bodyCallInputs)); | 1335 HInstruction invoke = new HInvokeDynamicMethod(selector, bodyCallInputs); |
| 1336 invoke.element = body; |
| 1337 add(invoke); |
| 1336 } | 1338 } |
| 1337 close(new HReturn(newObject)).addSuccessor(graph.exit); | 1339 close(new HReturn(newObject)).addSuccessor(graph.exit); |
| 1338 return closeFunction(); | 1340 return closeFunction(); |
| 1339 } | 1341 } |
| 1340 | 1342 |
| 1341 void addParameterCheckInstruction(Element element) { | 1343 void addParameterCheckInstruction(Element element) { |
| 1342 // This is the code we emit for a parameter that is being checked | 1344 // This is the code we emit for a parameter that is being checked |
| 1343 // on whether it was given at value at the call site: | 1345 // on whether it was given at value at the call site: |
| 1344 // | 1346 // |
| 1345 // foo([a = 42) { | 1347 // foo([a = 42) { |
| (...skipping 2999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4345 new HSubGraphBlockInformation(elseBranch.graph)); | 4347 new HSubGraphBlockInformation(elseBranch.graph)); |
| 4346 | 4348 |
| 4347 HBasicBlock conditionStartBlock = conditionBranch.block; | 4349 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 4348 conditionStartBlock.setBlockFlow(info, joinBlock); | 4350 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 4349 SubGraph conditionGraph = conditionBranch.graph; | 4351 SubGraph conditionGraph = conditionBranch.graph; |
| 4350 HIf branch = conditionGraph.end.last; | 4352 HIf branch = conditionGraph.end.last; |
| 4351 assert(branch is HIf); | 4353 assert(branch is HIf); |
| 4352 branch.blockInformation = conditionStartBlock.blockFlow; | 4354 branch.blockInformation = conditionStartBlock.blockFlow; |
| 4353 } | 4355 } |
| 4354 } | 4356 } |
| OLD | NEW |