Chromium Code Reviews| Index: pkg/compiler/lib/src/ssa/codegen_helpers.dart |
| diff --git a/pkg/compiler/lib/src/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart |
| index c298e06bc32dbce718a3418bbf9c026f97daf853..8b373bb7096d4bfb767aebd72b984a7736f65d67 100644 |
| --- a/pkg/compiler/lib/src/ssa/codegen_helpers.dart |
| +++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart |
| @@ -335,6 +335,8 @@ class SsaInstructionMerger extends HBaseVisitor { |
| SsaInstructionMerger(this.generateAtUseSite, this.compiler); |
| + JavaScriptBackend get backend => compiler.backend; |
| + |
| void visitGraph(HGraph graph) { |
| visitDominatorTree(graph); |
| } |
| @@ -384,6 +386,24 @@ class SsaInstructionMerger extends HBaseVisitor { |
| analyzeInputs(instruction, 0); |
| } |
| + void visitInvokeSuper(HInvokeSuper instruction) { |
| + Element superMethod = instruction.element; |
| + Selector selector = instruction.selector; |
| + // If aliased super members cannot be used, we will generate code like |
| + // |
| + // C.prototype.method.call(instance) |
|
floitsch
2015/03/06 14:54:10
indent by 4.
herhut
2015/03/09 14:28:35
Done.
|
| + // |
| + // where instance is the [this] object for the method. In such a case, the |
| + // get of prototype might be evaluted before instance is created if we |
|
floitsch
2015/03/06 14:54:09
evaluated
herhut
2015/03/09 14:28:35
Thanks!
|
| + // generate instance at use site, which in turn might update the prototype |
| + // after first access if we use lazy initialization. |
|
sra1
2015/03/05 18:23:25
This requires inlining of method, right?
new A().
herhut
2015/03/06 12:36:45
Yes. We have an existing test that does this.
|
| + if (!backend.canUseAliasedSuperMember(superMethod, selector)) { |
| + analyzeInputs(instruction, 1); |
| + } else { |
| + super.visitInvokeSuper(instruction); |
| + } |
| + } |
| + |
| void visitIs(HIs instruction) { |
| // In the general case the input might be used multple multiple times, so it |
| // must not be set generate at use site. If the code will generate |