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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart

Issue 1394483002: Do not emit type metadata for classes that are only emitted for rti. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart2js.js_emitter.full_emitter; 5 part of dart2js.js_emitter.full_emitter;
6 6
7 class ClassEmitter extends CodeEmitterHelper { 7 class ClassEmitter extends CodeEmitterHelper {
8 8
9 ClassStubGenerator get _stubGenerator => 9 ClassStubGenerator get _stubGenerator =>
10 new ClassStubGenerator(compiler, namer, backend); 10 new ClassStubGenerator(compiler, namer, backend);
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 // TODO(ahe): This method (generateClass) should return a jsAst.Expression. 336 // TODO(ahe): This method (generateClass) should return a jsAst.Expression.
337 jsAst.ObjectInitializer propertyValue = 337 jsAst.ObjectInitializer propertyValue =
338 classBuilder.toObjectInitializer(); 338 classBuilder.toObjectInitializer();
339 compiler.dumpInfoTask.registerElementAst(classBuilder.element, propertyValue ); 339 compiler.dumpInfoTask.registerElementAst(classBuilder.element, propertyValue );
340 enclosingBuilder.addProperty(className, propertyValue); 340 enclosingBuilder.addProperty(className, propertyValue);
341 341
342 String reflectionName = emitter.getReflectionName(classElement, className); 342 String reflectionName = emitter.getReflectionName(classElement, className);
343 if (reflectionName != null) { 343 if (reflectionName != null) {
344 if (!backend.isAccessibleByReflection(classElement)) { 344 if (!backend.isAccessibleByReflection(classElement) || cls.onlyForRti) {
345 // TODO(herhut): Fix use of reflection name here. 345 // TODO(herhut): Fix use of reflection name here.
346 enclosingBuilder.addPropertyByName("+$reflectionName", js.number(0)); 346 enclosingBuilder.addPropertyByName("+$reflectionName", js.number(0));
347 } else { 347 } else {
348 List<jsAst.Expression> types = <jsAst.Expression>[]; 348 List<jsAst.Expression> types = <jsAst.Expression>[];
349 if (classElement.supertype != null) { 349 if (classElement.supertype != null) {
350 types.add(task.metadataCollector.reifyType(classElement.supertype)); 350 types.add(task.metadataCollector.reifyType(classElement.supertype));
351 } 351 }
352 for (DartType interface in classElement.interfaces) { 352 for (DartType interface in classElement.interfaces) {
353 types.add(task.metadataCollector.reifyType(interface)); 353 types.add(task.metadataCollector.reifyType(interface));
354 } 354 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 : new Selector.setter( 427 : new Selector.setter(
428 new Name(member.name, member.library, isSetter: true)); 428 new Name(member.name, member.library, isSetter: true));
429 String reflectionName = emitter.getReflectionName(selector, name); 429 String reflectionName = emitter.getReflectionName(selector, name);
430 if (reflectionName != null) { 430 if (reflectionName != null) {
431 var reflectable = 431 var reflectable =
432 js(backend.isAccessibleByReflection(member) ? '1' : '0'); 432 js(backend.isAccessibleByReflection(member) ? '1' : '0');
433 builder.addPropertyByName('+$reflectionName', reflectable); 433 builder.addPropertyByName('+$reflectionName', reflectable);
434 } 434 }
435 } 435 }
436 } 436 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698