Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: pkg/compiler/lib/src/ssa/codegen_helpers.dart

Issue 974803002: Defer addStubs to class instantiation time. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased and fixes. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..98db71e1a9dcbb2aa44d9222014e264e357ec4b0 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,26 @@ 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)
+ //
+ // where instance is the [this] object for the method. In such a case, the
+ // get of prototype might be evaluated before instance is created if we
+ // generate instance at use site, which in turn might update the prototype
+ // after first access if we use lazy initialization.
+ // In this case, we therefore don't allow the receiver (the first argument)
+ // to be generated at use site, and only analyze all other arguments.
+ 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

Powered by Google App Engine
This is Rietveld 408576698