Chromium Code Reviews| 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 774 // The most recently opened block. Has the same value as [current] while | 774 // The most recently opened block. Has the same value as [current] while |
| 775 // the block is open, but unlike [current], it isn't cleared when the current | 775 // the block is open, but unlike [current], it isn't cleared when the current |
| 776 // block is closed. | 776 // block is closed. |
| 777 HBasicBlock lastOpenedBlock; | 777 HBasicBlock lastOpenedBlock; |
| 778 | 778 |
| 779 LibraryElement get currentLibrary() => work.element.getLibrary(); | 779 LibraryElement get currentLibrary() => work.element.getLibrary(); |
| 780 | 780 |
| 781 SsaBuilder(Compiler compiler, WorkItem work) | 781 SsaBuilder(Compiler compiler, WorkItem work) |
| 782 : this.compiler = compiler, | 782 : this.compiler = compiler, |
| 783 this.work = work, | 783 this.work = work, |
| 784 interceptors = compiler.builder.interceptors, | 784 interceptors = compiler.backend.builder.interceptors, |
|
ahe
2012/05/11 11:39:48
I think this will cause a type warning. compiler.b
Anton Muhin
2012/05/12 15:48:43
I am sorry I probably missed something, what kind
ngeoffray
2012/05/13 17:02:47
It will create a static type warning, eg: "interfa
Anton Muhin
2012/05/14 14:36:45
Thanks a lot for explanation, Nicolas!
Q: how do
ahe
2012/05/14 15:56:41
If you want to make sure you run all the tests, yo
| |
| 785 methodInterceptionEnabled = true, | 785 methodInterceptionEnabled = true, |
| 786 elements = work.resolutionTree, | 786 elements = work.resolutionTree, |
| 787 graph = new HGraph(), | 787 graph = new HGraph(), |
| 788 stack = new List<HInstruction>(), | 788 stack = new List<HInstruction>(), |
| 789 jumpTargets = new Map<TargetElement, JumpHandler>() { | 789 jumpTargets = new Map<TargetElement, JumpHandler>() { |
| 790 localsHandler = new LocalsHandler(this); | 790 localsHandler = new LocalsHandler(this); |
| 791 } | 791 } |
| 792 | 792 |
| 793 void disableMethodInterception() { | 793 void disableMethodInterception() { |
| 794 assert(methodInterceptionEnabled); | 794 assert(methodInterceptionEnabled); |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1458 wrapExpressionGraph(conditionExpression), | 1458 wrapExpressionGraph(conditionExpression), |
| 1459 wrapStatementGraph(bodyGraph), | 1459 wrapStatementGraph(bodyGraph), |
| 1460 null, | 1460 null, |
| 1461 loopEntryBlock.loopInformation.target, | 1461 loopEntryBlock.loopInformation.target, |
| 1462 loopEntryBlock.loopInformation.labels); | 1462 loopEntryBlock.loopInformation.labels); |
| 1463 loopEntryBlock.setBlockFlow(loopBlockInfo, current); | 1463 loopEntryBlock.setBlockFlow(loopBlockInfo, current); |
| 1464 loopInfo.loopBlockInformation = loopBlockInfo; | 1464 loopInfo.loopBlockInformation = loopBlockInfo; |
| 1465 } | 1465 } |
| 1466 | 1466 |
| 1467 visitFunctionExpression(FunctionExpression node) { | 1467 visitFunctionExpression(FunctionExpression node) { |
| 1468 ClosureData nestedClosureData = compiler.builder.closureDataCache[node]; | 1468 ClosureData nestedClosureData = compiler.backend.builder.closureDataCache[no de]; |
| 1469 if (nestedClosureData === null) { | 1469 if (nestedClosureData === null) { |
| 1470 // TODO(floitsch): we can only assume that the reason for not having a | 1470 // TODO(floitsch): we can only assume that the reason for not having a |
| 1471 // closure data here is, because the function is inside an initializer. | 1471 // closure data here is, because the function is inside an initializer. |
| 1472 compiler.unimplemented("Closures inside initializers", node: node); | 1472 compiler.unimplemented("Closures inside initializers", node: node); |
| 1473 } | 1473 } |
| 1474 assert(nestedClosureData !== null); | 1474 assert(nestedClosureData !== null); |
| 1475 assert(nestedClosureData.closureClassElement !== null); | 1475 assert(nestedClosureData.closureClassElement !== null); |
| 1476 ClassElement closureClassElement = | 1476 ClassElement closureClassElement = |
| 1477 nestedClosureData.closureClassElement; | 1477 nestedClosureData.closureClassElement; |
| 1478 FunctionElement callElement = nestedClosureData.callElement; | 1478 FunctionElement callElement = nestedClosureData.callElement; |
| (...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3320 <HInstruction>[target, input], | 3320 <HInstruction>[target, input], |
| 3321 HType.STRING)); | 3321 HType.STRING)); |
| 3322 return builder.pop(); | 3322 return builder.pop(); |
| 3323 } | 3323 } |
| 3324 | 3324 |
| 3325 HInstruction result() { | 3325 HInstruction result() { |
| 3326 flushLiterals(); | 3326 flushLiterals(); |
| 3327 return prefix; | 3327 return prefix; |
| 3328 } | 3328 } |
| 3329 } | 3329 } |
| OLD | NEW |