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

Unified Diff: lib/compiler/implementation/native_handler.dart

Issue 10386086: RFC: Start refactoring to provide more than a single backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Next iteration Created 8 years, 7 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: lib/compiler/implementation/native_handler.dart
diff --git a/lib/compiler/implementation/native_handler.dart b/lib/compiler/implementation/native_handler.dart
index b414c76197f8fa2f4fb3e2760b7a71465ba46702..678ddd6e2ff2d5353cb5780490ddceb5c6100ece 100644
--- a/lib/compiler/implementation/native_handler.dart
+++ b/lib/compiler/implementation/native_handler.dart
@@ -11,10 +11,10 @@
#import('tree/tree.dart');
#import('util/util.dart');
-void processNativeClasses(Compiler compiler,
+void processNativeClasses(Emitter emitter,
Collection<LibraryElement> libraries) {
for (LibraryElement library in libraries) {
- processNativeClassesInLibrary(compiler, library);
+ processNativeClassesInLibrary(emitter, library);
}
}
@@ -33,9 +33,10 @@ void addSubtypes(ClassElement cls,
directSubtypes.add(cls);
}
-void processNativeClassesInLibrary(Compiler compiler,
+void processNativeClassesInLibrary(Emitter emitter,
LibraryElement library) {
bool hasNativeClass = false;
+ final compiler = emitter.compiler;
for (Link<Element> link = library.topLevelElements;
!link.isEmpty(); link = link.tail) {
Element element = link.head;
@@ -53,8 +54,7 @@ void processNativeClassesInLibrary(Compiler compiler,
// Add the information that this class is a subtype of
// its supertypes. The code emitter and the ssa builder use that
// information.
- NativeEmitter emitter = compiler.emitter.nativeEmitter;
- addSubtypes(classElement, emitter);
+ addSubtypes(classElement, emitter.nativeEmitter);
}
}
}
@@ -195,7 +195,7 @@ void handleSsaNative(SsaBuilder builder, Send node) {
Compiler compiler = builder.compiler;
FunctionElement element = builder.work.element;
element.setNative();
- NativeEmitter nativeEmitter = compiler.emitter.nativeEmitter;
+ NativeEmitter nativeEmitter = builder.emitter.nativeEmitter;
// If what we're compiling is a getter named 'typeName' and the native
// class is named 'DOMType', we generate a call to the typeNameOf
// function attached on the isolate.
@@ -247,7 +247,7 @@ void handleSsaNative(SsaBuilder builder, Send node) {
}
if (!hasBody) {
- compiler.emitter.nativeEmitter.nativeMethods.add(element);
+ nativeEmitter.nativeMethods.add(element);
}
FunctionSignature parameters = element.computeSignature(builder.compiler);

Powered by Google App Engine
This is Rietveld 408576698