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

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

Issue 1913033002: dart2js: Pass type information to constructor rather than add later. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: rebase Created 4 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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.new_js_emitter.model; 5 library dart2js.new_js_emitter.model;
6 6
7 import '../constants/values.dart' show ConstantValue; 7 import '../constants/values.dart' show ConstantValue;
8 import '../deferred_load.dart' show OutputUnit; 8 import '../deferred_load.dart' show OutputUnit;
9 import '../elements/elements.dart' show Element; 9 import '../elements/elements.dart' show Element;
10 import '../js/js.dart' as js show Expression, Name, Statement, TokenFinalizer; 10 import '../js/js.dart' as js show Expression, Name, Statement, TokenFinalizer;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 /// Stub methods for this class that are call stubs for getters. 223 /// Stub methods for this class that are call stubs for getters.
224 final List<StubMethod> callStubs; 224 final List<StubMethod> callStubs;
225 225
226 /// Stub methods for this class handling reads to type variables. 226 /// Stub methods for this class handling reads to type variables.
227 final List<StubMethod> typeVariableReaderStubs; 227 final List<StubMethod> typeVariableReaderStubs;
228 228
229 /// noSuchMethod stubs in the special case that the class is Object. 229 /// noSuchMethod stubs in the special case that the class is Object.
230 final List<StubMethod> noSuchMethodStubs; 230 final List<StubMethod> noSuchMethodStubs;
231 final List<Field> staticFieldsForReflection; 231 final List<Field> staticFieldsForReflection;
232 final bool hasRti;
232 final bool onlyForRti; 233 final bool onlyForRti;
233 final bool isDirectlyInstantiated; 234 final bool isDirectlyInstantiated;
234 final bool isNative; 235 final bool isNative;
235 236
236 // If the class implements a function type, and the type is encoded in the 237 // If the class implements a function type, and the type is encoded in the
237 // metatada table, then this field contains the index into that field. 238 // metatada table, then this field contains the index into that field.
238 final js.Expression functionTypeIndex; 239 final js.Expression functionTypeIndex;
239 240
240 /// Whether the class must be evaluated eagerly. 241 /// Whether the class must be evaluated eagerly.
241 bool isEager = false; 242 bool isEager = false;
(...skipping 13 matching lines...) Expand all
255 this.holder, 256 this.holder,
256 this.methods, 257 this.methods,
257 this.fields, 258 this.fields,
258 this.staticFieldsForReflection, 259 this.staticFieldsForReflection,
259 this.callStubs, 260 this.callStubs,
260 this.typeVariableReaderStubs, 261 this.typeVariableReaderStubs,
261 this.noSuchMethodStubs, 262 this.noSuchMethodStubs,
262 this.checkedSetters, 263 this.checkedSetters,
263 this.isChecks, 264 this.isChecks,
264 this.functionTypeIndex, 265 this.functionTypeIndex,
265 {this.onlyForRti, 266 {this.hasRti,
267 this.onlyForRti,
266 this.isDirectlyInstantiated, 268 this.isDirectlyInstantiated,
267 this.isNative}) { 269 this.isNative}) {
268 assert(onlyForRti != null); 270 assert(onlyForRti != null);
269 assert(isDirectlyInstantiated != null); 271 assert(isDirectlyInstantiated != null);
270 assert(isNative != null); 272 assert(isNative != null);
271 } 273 }
272 274
273 bool get isMixinApplication => false; 275 bool get isMixinApplication => false;
274 Class get superclass => _superclass; 276 Class get superclass => _superclass;
275 277
(...skipping 14 matching lines...) Expand all
290 Element element, 292 Element element,
291 js.Name name, 293 js.Name name,
292 Holder holder, 294 Holder holder,
293 List<Field> instanceFields, 295 List<Field> instanceFields,
294 List<Field> staticFieldsForReflection, 296 List<Field> staticFieldsForReflection,
295 List<StubMethod> callStubs, 297 List<StubMethod> callStubs,
296 List<StubMethod> typeVariableReaderStubs, 298 List<StubMethod> typeVariableReaderStubs,
297 List<StubMethod> checkedSetters, 299 List<StubMethod> checkedSetters,
298 List<StubMethod> isChecks, 300 List<StubMethod> isChecks,
299 js.Expression functionTypeIndex, 301 js.Expression functionTypeIndex,
300 {bool onlyForRti, 302 {bool hasRti,
303 bool onlyForRti,
301 bool isDirectlyInstantiated}) 304 bool isDirectlyInstantiated})
302 : super( 305 : super(
303 element, 306 element,
304 name, 307 name,
305 holder, 308 holder,
306 const <Method>[], 309 const <Method>[],
307 instanceFields, 310 instanceFields,
308 staticFieldsForReflection, 311 staticFieldsForReflection,
309 callStubs, 312 callStubs,
310 typeVariableReaderStubs, 313 typeVariableReaderStubs,
311 const <StubMethod>[], 314 const <StubMethod>[],
312 checkedSetters, 315 checkedSetters,
313 isChecks, 316 isChecks,
314 functionTypeIndex, 317 functionTypeIndex,
318 hasRti: hasRti,
315 onlyForRti: onlyForRti, 319 onlyForRti: onlyForRti,
316 isDirectlyInstantiated: isDirectlyInstantiated, 320 isDirectlyInstantiated: isDirectlyInstantiated,
317 isNative: false); 321 isNative: false);
318 322
319 bool get isMixinApplication => true; 323 bool get isMixinApplication => true;
320 Class get mixinClass => _mixinClass; 324 Class get mixinClass => _mixinClass;
321 325
322 void setMixinClass(Class mixinClass) { 326 void setMixinClass(Class mixinClass) {
323 _mixinClass = mixinClass; 327 _mixinClass = mixinClass;
324 } 328 }
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 functionType: functionType); 529 functionType: functionType);
526 530
527 bool get isStatic => true; 531 bool get isStatic => true;
528 } 532 }
529 533
530 class StaticStubMethod extends StubMethod implements StaticMethod { 534 class StaticStubMethod extends StubMethod implements StaticMethod {
531 Holder holder; 535 Holder holder;
532 StaticStubMethod(js.Name name, this.holder, js.Expression code) 536 StaticStubMethod(js.Name name, this.holder, js.Expression code)
533 : super(name, code); 537 : super(name, code);
534 } 538 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698