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

Unified Diff: pkg/fletchc/lib/src/fletch_backend.dart

Issue 1059573004: Compile tearoffs of static functions as constants. (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Created 5 years, 8 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/fletchc/lib/src/fletch_backend.dart
diff --git a/pkg/fletchc/lib/src/fletch_backend.dart b/pkg/fletchc/lib/src/fletch_backend.dart
index 8d5d5703d209e5d65e03144b3b9a7c589d94af95..24bfad9a26b445815bac8d4e244e8e18b2ccba03 100644
--- a/pkg/fletchc/lib/src/fletch_backend.dart
+++ b/pkg/fletchc/lib/src/fletch_backend.dart
@@ -75,7 +75,8 @@ import 'package:compiler/src/library_loader.dart' show
import 'fletch_constants.dart' show
FletchClassConstant,
- FletchFunctionConstant;
+ FletchFunctionConstant,
+ FletchClassInstanceConstant;
import 'compiled_function.dart' show
CompiledFunction;
@@ -922,6 +923,10 @@ class FletchBackend extends Backend {
commands
..add(new PushFromMap(MapId.classes, compiledClass.id))
..add(const PushNewInstance());
+ } else if (constant is FletchClassInstanceConstant) {
+ commands
+ ..add(new PushFromMap(MapId.classes, constant.classId))
+ ..add(const PushNewInstance());
} else {
throw "Unsupported constant: ${constant.toStructuredString()}";
}

Powered by Google App Engine
This is Rietveld 408576698