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

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

Issue 2688413003: Extract BackendUsage, MirrorsData, and CheckedModeHelpers from Backend. (Closed)
Patch Set: Cleanup Created 3 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
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 library dart2js.js_emitter.full_emitter.container_builder; 5 library dart2js.js_emitter.full_emitter.container_builder;
6 6
7 import '../../constants/values.dart'; 7 import '../../constants/values.dart';
8 import '../../elements/elements.dart' 8 import '../../elements/elements.dart'
9 show 9 show
10 Element, 10 Element,
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 ? js("null") 144 ? js("null")
145 : js.quoteName(tearOffName)) 145 : js.quoteName(tearOffName))
146 ..add(js.number(requiredParameterCount)) 146 ..add(js.number(requiredParameterCount))
147 ..add(js.number(optionalParameterCount)) 147 ..add(js.number(optionalParameterCount))
148 ..add(memberTypeExpression == null ? js("null") : memberTypeExpression) 148 ..add(memberTypeExpression == null ? js("null") : memberTypeExpression)
149 ..addAll(task.metadataCollector.reifyDefaultArguments(member)); 149 ..addAll(task.metadataCollector.reifyDefaultArguments(member));
150 150
151 if (canBeReflected || canBeApplied) { 151 if (canBeReflected || canBeApplied) {
152 parameters.forEachParameter((Element parameter) { 152 parameters.forEachParameter((Element parameter) {
153 expressions.add(task.metadataCollector.reifyName(parameter.name)); 153 expressions.add(task.metadataCollector.reifyName(parameter.name));
154 if (backend.mustRetainMetadata) { 154 if (backend.mirrorsData.mustRetainMetadata) {
155 Iterable<jsAst.Expression> metadataIndices = 155 Iterable<jsAst.Expression> metadataIndices =
156 parameter.metadata.map((MetadataAnnotation annotation) { 156 parameter.metadata.map((MetadataAnnotation annotation) {
157 ConstantValue constant = 157 ConstantValue constant =
158 backend.constants.getConstantValueForMetadata(annotation); 158 backend.constants.getConstantValueForMetadata(annotation);
159 backend.constants.addCompileTimeConstantForEmission(constant); 159 backend.constants.addCompileTimeConstantForEmission(constant);
160 return task.metadataCollector.reifyMetadata(annotation); 160 return task.metadataCollector.reifyMetadata(annotation);
161 }); 161 });
162 expressions.add(new jsAst.ArrayInitializer(metadataIndices.toList())); 162 expressions.add(new jsAst.ArrayInitializer(metadataIndices.toList()));
163 } 163 }
164 }); 164 });
(...skipping 19 matching lines...) Expand all
184 jsAst.ArrayInitializer arrayInit = 184 jsAst.ArrayInitializer arrayInit =
185 new jsAst.ArrayInitializer(expressions.toList()); 185 new jsAst.ArrayInitializer(expressions.toList());
186 compiler.dumpInfoTask 186 compiler.dumpInfoTask
187 .registerElementAst(member, builder.addProperty(name, arrayInit)); 187 .registerElementAst(member, builder.addProperty(name, arrayInit));
188 } 188 }
189 189
190 void addMemberField(Field field, ClassBuilder builder) { 190 void addMemberField(Field field, ClassBuilder builder) {
191 // For now, do nothing. 191 // For now, do nothing.
192 } 192 }
193 } 193 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698