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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart

Issue 340023003: Various caches for incremental compilation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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: dart/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
index 900823debae97ed865376b6903a98f92076cd5c0..ef845d98650e4f1f1ec695d9734420c995717d26 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart
@@ -6,6 +6,9 @@ part of js_backend;
class NativeEmitter {
+ final Map<Element, ClassBuilder> cachedBuilders =
+ new HashMap<Element, ClassBuilder>.identity();
Johnni Winther 2014/06/19 09:22:32 Ditto.
+
CodeEmitterTask emitter;
CodeBuffer nativeBuffer;
@@ -279,6 +282,16 @@ class NativeEmitter {
}
ClassBuilder generateNativeClass(ClassElement classElement) {
+ ClassBuilder builder;
+ if (compiler.hasIncrementalSupport) {
+ builder = cachedBuilders[classElement];
+ if (builder != null) return builder;
+ builder = new ClassBuilder(backend.namer);
+ cachedBuilders[classElement] = builder;
+ } else {
+ builder = new ClassBuilder(backend.namer);
+ }
+
// TODO(sra): Issue #13731- this is commented out as part of custom element
// constructor work.
//assert(!classElement.hasBackendMembers);
@@ -294,7 +307,6 @@ class NativeEmitter {
String superName = backend.namer.getNameOfClass(superclass);
- ClassBuilder builder = new ClassBuilder(backend.namer);
emitter.classEmitter.emitClassConstructor(classElement, builder);
bool hasFields = emitter.classEmitter.emitFields(
classElement, builder, superName, classIsNative: true);

Powered by Google App Engine
This is Rietveld 408576698