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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart

Issue 27251003: Generate onlyForRti class constructor for csp. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comment Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
index b5fd0833a35bc4e191067ac871c7e014712b15ac..d143af5aa6dfcdddf1442812ed755a89cbd88e07 100644
--- a/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart
@@ -35,16 +35,11 @@ class ClassEmitter extends CodeEmitterHelper {
}
ClassBuilder builder = new ClassBuilder();
- if (!onlyForRti) {
- emitClassConstructor(classElement, builder, runtimeName);
- }
+ emitClassConstructor(classElement, builder, runtimeName,
+ onlyForRti: onlyForRti);
emitFields(classElement, builder, superName, onlyForRti: onlyForRti);
- if (!onlyForRti) {
- emitClassGettersSetters(classElement, builder);
- if (!classElement.isMixinApplication) {
- emitInstanceMembers(classElement, builder);
- }
- }
+ emitClassGettersSetters(classElement, builder, onlyForRti: onlyForRti);
+ emitInstanceMembers(classElement, builder, onlyForRti: onlyForRti);
task.typeTestEmitter.emitIsTests(classElement, builder);
emitClassBuilderWithReflectionData(
@@ -53,9 +48,10 @@ class ClassEmitter extends CodeEmitterHelper {
void emitClassConstructor(ClassElement classElement,
ClassBuilder builder,
- String runtimeName) {
+ String runtimeName,
+ {bool onlyForRti: false}) {
List<String> fields = <String>[];
- if (!classElement.isNative()) {
+ if (!onlyForRti && !classElement.isNative()) {
visitFields(classElement, false,
(Element member,
String name,
@@ -229,7 +225,10 @@ class ClassEmitter extends CodeEmitterHelper {
}
void emitClassGettersSetters(ClassElement classElement,
- ClassBuilder builder) {
+ ClassBuilder builder,
+ {bool onlyForRti: false}) {
+ if (onlyForRti) return;
+
visitFields(classElement, false,
(VariableElement member,
String name,
@@ -258,9 +257,12 @@ class ClassEmitter extends CodeEmitterHelper {
* Invariant: [classElement] must be a declaration element.
*/
void emitInstanceMembers(ClassElement classElement,
- ClassBuilder builder) {
+ ClassBuilder builder,
+ {bool onlyForRti: false}) {
assert(invariant(classElement, classElement.isDeclaration));
+ if (onlyForRti || classElement.isMixinApplication) return;
+
void visitMember(ClassElement enclosing, Element member) {
assert(invariant(classElement, member.isDeclaration));
if (member.isInstanceMember()) {
« 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