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

Unified Diff: dart/pkg/dart2js_incremental/lib/library_updater.dart

Issue 712393002: Incremental compilation of newly instantiated classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
« no previous file with comments | « no previous file | dart/tests/try/web/incremental_compilation_update_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/dart2js_incremental/lib/library_updater.dart
diff --git a/dart/pkg/dart2js_incremental/lib/library_updater.dart b/dart/pkg/dart2js_incremental/lib/library_updater.dart
index 3582f726d211a4bf322678d41094e9da03a4f5c6..c206760c08d2304859f34229bc464a199048ed80 100644
--- a/dart/pkg/dart2js_incremental/lib/library_updater.dart
+++ b/dart/pkg/dart2js_incremental/lib/library_updater.dart
@@ -375,6 +375,9 @@ class LibraryUpdater extends JsFeatures {
}
String computeUpdateJs() {
+ Set existingClasses =
+ new Set.from(compiler.codegenWorld.directlyInstantiatedClasses);
+
List<Update> removals = <Update>[];
List<Element> updatedElements = applyUpdates(removals);
if (compiler.progress != null) {
@@ -393,6 +396,30 @@ class LibraryUpdater extends JsFeatures {
compiler.processQueue(compiler.enqueuer.codegen, null);
List<jsAst.Statement> updates = <jsAst.Statement>[];
+
+ Set newClasses =
+ new Set.from(compiler.codegenWorld.directlyInstantiatedClasses);
+ newClasses.removeAll(existingClasses);
+
+ for (ClassElementX cls in newClasses) {
+ jsAst.Node access = namer.elementAccess(cls);
+ String name = namer.getNameOfClass(cls);
+
+ // TODO(ahe): Compute arguments.
+ List<jsAst.Node> arguments = <jsAst.Node>[];
+
+ // TODO(ahe): Compute statements, that is initializers.
+ List<jsAst.Statement> statements = <jsAst.Statement>[];
+
+ updates.add(
+ js.statement(
+ '# = function $name(#) {#}', [access, arguments, statements]));
+ }
+
+ for (ClassElementX cls in newClasses) {
+ // TODO(ahe): Set up superclasses.
+ }
+
for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) {
if (!element.isField) {
updates.add(computeMemberUpdateJs(element));
« no previous file with comments | « no previous file | dart/tests/try/web/incremental_compilation_update_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698