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

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

Issue 10386161: Start compiler refactoring to support more than a single backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « lib/compiler/implementation/emitter.dart ('k') | lib/compiler/implementation/native_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/native_emitter.dart
diff --git a/lib/compiler/implementation/native_emitter.dart b/lib/compiler/implementation/native_emitter.dart
index 0413df145bd118046c604db0eb34bdb66db34c86..7b16f897fe2d2ddb2d24359b6f4f29985266ba2a 100644
--- a/lib/compiler/implementation/native_emitter.dart
+++ b/lib/compiler/implementation/native_emitter.dart
@@ -4,7 +4,7 @@
class NativeEmitter {
- Compiler compiler;
+ CodeEmitterTask emitter;
StringBuffer nativeBuffer;
// Classes that participate in dynamic dispatch. These are the
@@ -30,7 +30,7 @@ class NativeEmitter {
// implementation.
Set<FunctionElement> nativeMethods;
- NativeEmitter(this.compiler)
+ NativeEmitter(this.emitter)
: classesWithDynamicDispatch = new Set<ClassElement>(),
nativeClasses = new Set<ClassElement>(),
subtypes = new Map<ClassElement, List<ClassElement>>(),
@@ -39,6 +39,8 @@ class NativeEmitter {
nativeMethods = new Set<FunctionElement>(),
nativeBuffer = new StringBuffer();
+ Compiler get compiler() => emitter.compiler;
+
String get dynamicName() {
Element element = compiler.findHelper(
const SourceString('dynamicFunction'));
@@ -75,7 +77,7 @@ class NativeEmitter {
String get defineNativeClassFunction() {
return """
function(cls, fields, methods) {
- var generateGetterSetter = ${compiler.emitter.generateGetterSetterFunction};
+ var generateGetterSetter = ${emitter.generateGetterSetterFunction};
for (var i = 0; i < fields.length; i++) {
generateGetterSetter(fields[i], methods);
}
@@ -100,7 +102,7 @@ function(cls, fields, methods) {
for (Element member in classElement.members) {
if (member.isInstanceMember()) {
- compiler.emitter.addInstanceMember(member, defineInstanceMember);
+ emitter.addInstanceMember(member, defineInstanceMember);
}
}
}
@@ -136,10 +138,10 @@ function(cls, fields, methods) {
}
StringBuffer fieldBuffer = new StringBuffer();
- compiler.emitter.emitClassFields(classElement, fieldBuffer);
+ emitter.emitClassFields(classElement, fieldBuffer);
StringBuffer methodBuffer = new StringBuffer();
- compiler.emitter.emitInstanceMembers(classElement, methodBuffer);
+ emitter.emitInstanceMembers(classElement, methodBuffer);
if (methodBuffer.isEmpty() && fieldBuffer.isEmpty()) return;
« no previous file with comments | « lib/compiler/implementation/emitter.dart ('k') | lib/compiler/implementation/native_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698