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

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

Issue 175043004: Version 1.2.0-dev.5.14 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 6 years, 10 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 part of js_backend; 5 part of js_backend;
6 6
7 class NativeEmitter { 7 class NativeEmitter {
8 8
9 CodeEmitterTask emitter; 9 CodeEmitterTask emitter;
10 CodeBuffer nativeBuffer; 10 CodeBuffer nativeBuffer;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 ClassElement superclass = classElement.superclass; 335 ClassElement superclass = classElement.superclass;
336 assert(superclass != null); 336 assert(superclass != null);
337 // Fix superclass. TODO(sra): make native classes inherit from Interceptor. 337 // Fix superclass. TODO(sra): make native classes inherit from Interceptor.
338 assert(superclass != compiler.objectClass); 338 assert(superclass != compiler.objectClass);
339 if (superclass == compiler.objectClass) { 339 if (superclass == compiler.objectClass) {
340 superclass = backend.jsInterceptorClass; 340 superclass = backend.jsInterceptorClass;
341 } 341 }
342 342
343 String superName = backend.namer.getNameOfClass(superclass); 343 String superName = backend.namer.getNameOfClass(superclass);
344 344
345 ClassBuilder builder = new ClassBuilder(); 345 ClassBuilder builder = new ClassBuilder(backend.namer);
346 emitter.classEmitter.emitClassConstructor(classElement, builder, null); 346 emitter.classEmitter.emitClassConstructor(classElement, builder, null);
347 bool hasFields = emitter.classEmitter.emitFields( 347 bool hasFields = emitter.classEmitter.emitFields(
348 classElement, builder, superName, classIsNative: true); 348 classElement, builder, superName, classIsNative: true);
349 int propertyCount = builder.properties.length; 349 int propertyCount = builder.properties.length;
350 emitter.classEmitter.emitClassGettersSetters(classElement, builder); 350 emitter.classEmitter.emitClassGettersSetters(classElement, builder);
351 emitter.classEmitter.emitInstanceMembers(classElement, builder); 351 emitter.classEmitter.emitInstanceMembers(classElement, builder);
352 emitter.typeTestEmitter.emitIsTests(classElement, builder); 352 emitter.typeTestEmitter.emitIsTests(classElement, builder);
353 353
354 if (!hasFields && 354 if (!hasFields &&
355 builder.properties.length == propertyCount && 355 builder.properties.length == propertyCount &&
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 if (emitter.compiler.enableMinification) targetBuffer.add(';'); 510 if (emitter.compiler.enableMinification) targetBuffer.add(';');
511 targetBuffer.add(jsAst.prettyPrint( 511 targetBuffer.add(jsAst.prettyPrint(
512 new jsAst.ExpressionStatement(init), compiler)); 512 new jsAst.ExpressionStatement(init), compiler));
513 targetBuffer.add('\n'); 513 targetBuffer.add('\n');
514 } 514 }
515 515
516 targetBuffer.add(nativeBuffer); 516 targetBuffer.add(nativeBuffer);
517 targetBuffer.add('\n'); 517 targetBuffer.add('\n');
518 } 518 }
519 } 519 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698