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

Unified Diff: pkg/compiler/lib/src/js_emitter/model.dart

Issue 849623003: dart2js: start using the model in the old emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More uses. Created 5 years, 11 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/js_emitter/model.dart
diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
index bd091b310b9ae2387cb31700a5c56b481db20c60..b1e20c10bdb660dc213a6adf7b1c3c8896c974f6 100644
--- a/pkg/compiler/lib/src/js_emitter/model.dart
+++ b/pkg/compiler/lib/src/js_emitter/model.dart
@@ -18,6 +18,9 @@ class Program {
final Map<String, List<Fragment>> loadMap;
Program(this.fragments, this.outputContainsConstantList, this.loadMap);
+
+ bool get isSplit => fragments.length > 1;
+ Iterable<Fragment> get deferredFragments => fragments.skip(1);
}
/**
@@ -245,20 +248,27 @@ class Method {
final String name;
final js.Expression code;
- Method(this.element, this.name, this.code);
+ final bool needsTearOff;
+
+ Method(this.element, this.name, this.code, {this.needsTearOff}) {
+ assert(needsTearOff != null);
+ }
}
class StubMethod extends Method {
- StubMethod(String name, js.Expression code) : super(null, name, code);
+ StubMethod(String name, js.Expression code, {bool needsTearOff})
+ : super(null, name, code, needsTearOff: needsTearOff);
}
class StaticMethod extends Method {
final Holder holder;
- StaticMethod(Element element, String name, this.holder, js.Expression code)
- : super(element, name, code);
+ StaticMethod(Element element, String name, this.holder, js.Expression code,
+ {bool needsTearOff})
+ : super(element, name, code, needsTearOff: needsTearOff);
}
class StaticStubMethod extends StaticMethod {
- StaticStubMethod(String name, Holder holder, js.Expression code)
- : super(null, name, holder, code);
+ StaticStubMethod(String name, Holder holder, js.Expression code,
+ {bool needsTearOff})
+ : super(null, name, holder, code, needsTearOff: needsTearOff);
}
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/code_emitter_task.dart ('k') | pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698