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

Side by Side Diff: lib/compiler/implementation/js_backend/native_emitter.dart

Issue 10824275: Revert "Refactor Library/CompilationUnit and how we define local Scope." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class NativeEmitter { 5 class NativeEmitter {
6 6
7 CodeEmitterTask emitter; 7 CodeEmitterTask emitter;
8 CodeBuffer nativeBuffer; 8 CodeBuffer nativeBuffer;
9 9
10 // Classes that participate in dynamic dispatch. These are the 10 // Classes that participate in dynamic dispatch. These are the
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 String className = compiler.namer.getName(classElement); 105 String className = compiler.namer.getName(classElement);
106 nativeBuffer.add(className); 106 nativeBuffer.add(className);
107 nativeBuffer.add(' = '); 107 nativeBuffer.add(' = ');
108 nativeBuffer.add(nativeCode); 108 nativeBuffer.add(nativeCode);
109 nativeBuffer.add(';\n'); 109 nativeBuffer.add(';\n');
110 110
111 void defineInstanceMember(String name, CodeBuffer value) { 111 void defineInstanceMember(String name, CodeBuffer value) {
112 nativeBuffer.add("$className.$name = $value;\n"); 112 nativeBuffer.add("$className.$name = $value;\n");
113 } 113 }
114 114
115 for (Element member in classElement.localMembers) { 115 for (Element member in classElement.members) {
116 if (member.isInstanceMember()) { 116 if (member.isInstanceMember()) {
117 emitter.addInstanceMember(member, defineInstanceMember); 117 emitter.addInstanceMember(member, defineInstanceMember);
118 } 118 }
119 } 119 }
120 } 120 }
121 121
122 bool isNativeLiteral(String quotedName) { 122 bool isNativeLiteral(String quotedName) {
123 return quotedName[1] === '='; 123 return quotedName[1] === '=';
124 } 124 }
125 125
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 if (!first) targetBuffer.add(",\n"); 426 if (!first) targetBuffer.add(",\n");
427 targetBuffer.add(" $name: $function"); 427 targetBuffer.add(" $name: $function");
428 first = false; 428 first = false;
429 }); 429 });
430 targetBuffer.add("\n});\n\n"); 430 targetBuffer.add("\n});\n\n");
431 } 431 }
432 targetBuffer.add('$nativeBuffer'); 432 targetBuffer.add('$nativeBuffer');
433 targetBuffer.add('\n'); 433 targetBuffer.add('\n');
434 } 434 }
435 } 435 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/enqueue.dart ('k') | lib/compiler/implementation/native_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698