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

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

Issue 903283002: dart2js: fix deferred loading in the new emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and clean up. Created 5 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) 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 '../js/js.dart' as js show Expression, Statement; 7 import '../js/js.dart' as js show Expression, Statement;
8 import '../constants/values.dart' show ConstantValue; 8 import '../constants/values.dart' show ConstantValue;
9 9
10 import '../deferred_load.dart' show OutputUnit; 10 import '../deferred_load.dart' show OutputUnit;
11 11
12 import 'js_emitter.dart' show MetadataCollector; 12 import 'js_emitter.dart' show MetadataCollector;
13 13
14 import '../common.dart'; 14 import '../common.dart';
15 15
16 class Program { 16 class Program {
17 final List<Fragment> fragments; 17 final List<Fragment> fragments;
18 final bool outputContainsConstantList; 18 final bool outputContainsConstantList;
19 final bool outputContainsNativeClasses; 19 final bool outputContainsNativeClasses;
20 final bool hasIsolateSupport;
20 /// A map from load id to the list of fragments that need to be loaded. 21 /// A map from load id to the list of fragments that need to be loaded.
21 final Map<String, List<Fragment>> loadMap; 22 final Map<String, List<Fragment>> loadMap;
22 23
23 // If this field is not `null` then its value must be emitted in the embedded 24 // If this field is not `null` then its value must be emitted in the embedded
24 // global `TYPE_TO_INTERCEPTOR_MAP`. The map references constants and classes. 25 // global `TYPE_TO_INTERCEPTOR_MAP`. The map references constants and classes.
25 final js.Expression typeToInterceptorMap; 26 final js.Expression typeToInterceptorMap;
26 27
27 // TODO(floitsch): we should store the metadata directly instead of storing 28 // TODO(floitsch): we should store the metadata directly instead of storing
28 // the collector. However, the old emitter still updates the data. 29 // the collector. However, the old emitter still updates the data.
29 final MetadataCollector _metadataCollector; 30 final MetadataCollector _metadataCollector;
30 31
31 Program(this.fragments, 32 Program(this.fragments,
32 this.loadMap, 33 this.loadMap,
33 this.typeToInterceptorMap, 34 this.typeToInterceptorMap,
34 this._metadataCollector, 35 this._metadataCollector,
35 {this.outputContainsNativeClasses, 36 {this.outputContainsNativeClasses,
36 this.outputContainsConstantList}) { 37 this.outputContainsConstantList,
38 this.hasIsolateSupport}) {
37 assert(outputContainsNativeClasses != null); 39 assert(outputContainsNativeClasses != null);
38 assert(outputContainsConstantList != null); 40 assert(outputContainsConstantList != null);
41 assert(hasIsolateSupport != null);
39 } 42 }
40 43
41 /// A list of pretty-printed JavaScript expressions. 44 /// A list of pretty-printed JavaScript expressions.
42 /// 45 ///
43 /// This list must be emitted in the `METADATA` embedded global. 46 /// This list must be emitted in the `METADATA` embedded global.
44 /// The list references constants and must hence be emitted after constants 47 /// The list references constants and must hence be emitted after constants
45 /// have been initialized. 48 /// have been initialized.
46 /// 49 ///
47 /// Note: the metadata is derived from the task's `metadataCollector`. The 50 /// Note: the metadata is derived from the task's `metadataCollector`. The
48 /// list must not be emitted before all operations on it are done. For 51 /// list must not be emitted before all operations on it are done. For
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 tearOffName : tearOffName, 437 tearOffName : tearOffName,
435 canBeApplied : canBeApplied, 438 canBeApplied : canBeApplied,
436 canBeReflected : canBeReflected); 439 canBeReflected : canBeReflected);
437 } 440 }
438 441
439 class StaticStubMethod extends StubMethod implements StaticMethod { 442 class StaticStubMethod extends StubMethod implements StaticMethod {
440 Holder holder; 443 Holder holder;
441 StaticStubMethod(String name, this.holder, js.Expression code) 444 StaticStubMethod(String name, this.holder, js.Expression code)
442 : super(name, code); 445 : super(name, code);
443 } 446 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698