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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 1418573011: dart2js: Change how super tear-offs are registered. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix Created 5 years, 1 month 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/js_backend/codegen/codegen.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index 417f83a4423689219b92ffdeccae55d20341b4ef..bcf09683b88188eb9cd796c250bc132d3264e51d 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -307,6 +307,15 @@ class CodeGenerator extends tree_ir.StatementVisitor
@override
js.Expression visitInvokeMethodDirectly(tree_ir.InvokeMethodDirectly node) {
+ if (node.isTearOff) {
+ // If this is a tear-off, register the fact that a tear-off closure
+ // will be created, and that this tear-off must bypass ordinary
+ // dispatch to ensure the super method is invoked.
+ registry.registerStaticUse(new StaticUse.staticInvoke(
+ glue.closureFromTearOff, new CallStructure.unnamed(
+ glue.closureFromTearOff.parameters.length)));
+ registry.registerStaticUse(new StaticUse.superTearOff(node.target));
+ }
if (node.target is ConstructorBodyElement) {
registry.registerStaticUse(
new StaticUse.constructorBodyInvoke(
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_helpers.dart ('k') | pkg/compiler/lib/src/js_backend/codegen/glue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698