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

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

Issue 1212613009: dart2js: Implement frequency based naming. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 '../js/js.dart' as js show Expression, Statement, Name, Literal; 7 import '../js/js.dart' as js show Expression, Statement, Name, Literal,
8 TokenFinalizer;
8 import '../constants/values.dart' show ConstantValue; 9 import '../constants/values.dart' show ConstantValue;
9 10
10 import '../deferred_load.dart' show OutputUnit; 11 import '../deferred_load.dart' show OutputUnit;
11 12
12 import 'js_emitter.dart' show MetadataCollector, TokenFinalizer; 13 import 'js_emitter.dart' show MetadataCollector, TokenFinalizer;
13 14
14 import '../common.dart'; 15 import '../common.dart';
15 16
16 class Program { 17 class Program {
17 final List<Fragment> fragments; 18 final List<Fragment> fragments;
18 final List<Holder> holders; 19 final List<Holder> holders;
19 final bool outputContainsConstantList; 20 final bool outputContainsConstantList;
20 final bool needsNativeSupport; 21 final bool needsNativeSupport;
21 final bool hasIsolateSupport; 22 final bool hasIsolateSupport;
22 /// A map from load id to the list of fragments that need to be loaded. 23 /// A map from load id to the list of fragments that need to be loaded.
23 final Map<String, List<Fragment>> loadMap; 24 final Map<String, List<Fragment>> loadMap;
24 25
25 // If this field is not `null` then its value must be emitted in the embedded 26 // If this field is not `null` then its value must be emitted in the embedded
26 // global `TYPE_TO_INTERCEPTOR_MAP`. The map references constants and classes. 27 // global `TYPE_TO_INTERCEPTOR_MAP`. The map references constants and classes.
27 final js.Expression typeToInterceptorMap; 28 final js.Expression typeToInterceptorMap;
28 29
29 // TODO(floitsch): we should store the metadata directly instead of storing 30 // TODO(floitsch): we should store the metadata directly instead of storing
30 // the collector. However, the old emitter still updates the data. 31 // the collector. However, the old emitter still updates the data.
31 final MetadataCollector _metadataCollector; 32 final MetadataCollector _metadataCollector;
32 TokenFinalizer get metadataFinalizer => _metadataCollector; 33 final Iterable<js.TokenFinalizer> finalizers;
33 34
34 Program(this.fragments, 35 Program(this.fragments,
35 this.holders, 36 this.holders,
36 this.loadMap, 37 this.loadMap,
37 this.typeToInterceptorMap, 38 this.typeToInterceptorMap,
38 this._metadataCollector, 39 this._metadataCollector,
40 this.finalizers,
39 {this.needsNativeSupport, 41 {this.needsNativeSupport,
40 this.outputContainsConstantList, 42 this.outputContainsConstantList,
41 this.hasIsolateSupport}) { 43 this.hasIsolateSupport}) {
42 assert(needsNativeSupport != null); 44 assert(needsNativeSupport != null);
43 assert(outputContainsConstantList != null); 45 assert(outputContainsConstantList != null);
44 assert(hasIsolateSupport != null); 46 assert(hasIsolateSupport != null);
45 } 47 }
46 48
47 /// A list of metadata expressions. 49 /// A list of metadata expressions.
48 /// 50 ///
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 requiredParameterCount: requiredParameterCount, 485 requiredParameterCount: requiredParameterCount,
484 optionalParameterDefaultValues: optionalParameterDefaultValues, 486 optionalParameterDefaultValues: optionalParameterDefaultValues,
485 functionType: functionType); 487 functionType: functionType);
486 } 488 }
487 489
488 class StaticStubMethod extends StubMethod implements StaticMethod { 490 class StaticStubMethod extends StubMethod implements StaticMethod {
489 Holder holder; 491 Holder holder;
490 StaticStubMethod(js.Name name, this.holder, js.Expression code) 492 StaticStubMethod(js.Name name, this.holder, js.Expression code)
491 : super(name, code); 493 : super(name, code);
492 } 494 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698