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

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

Issue 871073002: dart2js: add work-around hack for try. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index 1bdfc8105e337045e07aa4fdf06c0a7b13ee18c9..4e2f55577e1f5162fdeb4978ad9e506d378751da 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -262,6 +262,28 @@ class ProgramBuilder {
staticFieldsForReflection);
}
+ /// HACK for Try.
ahe 2015/01/28 07:22:37 This is not for Try Dart. This is for incremental
floitsch 2015/01/28 16:25:05 Renamed function to buildClassWithFieldsForIncreme
+ ///
+ /// Returns a class that contains the fields of a class.
+ Class buildClassWithFieldsForTry(ClassElement element) {
+ bool onlyForRti = _task.typeTestRegistry.rtiNeededClasses.contains(element);
ahe 2015/01/28 07:22:37 For incremental compilation, this should probably
floitsch 2015/01/28 16:25:05 Done.
+
+ List<Field> instanceFields =
+ onlyForRti ? const <Field>[] : _buildFields(element, false);
+
+ String name = namer.getNameOfClass(element);
+ String holderName = namer.globalObjectFor(element);
+ Holder holder = _registry.registerHolder(holderName);
ahe 2015/01/28 07:22:37 I'm not sure I understand what a holder is. Does t
floitsch 2015/01/28 16:25:05 In the new emitter it's more complicated. Since yo
+ bool isInstantiated =
+ _compiler.codegenWorld.directlyInstantiatedClasses.contains(element);
ahe 2015/01/28 07:22:37 For incremental compilation, my guess is that it w
floitsch 2015/01/28 16:25:05 Done.
+
+ return new Class(
+ element, name, holder, [], instanceFields, [], [], [], null,
+ isDirectlyInstantiated: isInstantiated,
+ onlyForRti: onlyForRti,
ahe 2015/01/28 07:22:37 As mentioned above, the above two arguments should
floitsch 2015/01/28 16:25:05 Done.
+ isNative: element.isNative);
+ }
+
Class _buildClass(ClassElement element) {
bool onlyForRti = _task.typeTestRegistry.rtiNeededClasses.contains(element);
« no previous file with comments | « no previous file | pkg/dart2js_incremental/lib/library_updater.dart » ('j') | pkg/dart2js_incremental/lib/library_updater.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698