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

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

Issue 1189873005: dart2js: Support frequency based metadata indices in new emitter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comments addressed Created 5 years, 6 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; 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, TokenFinalizer;
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 List<Holder> holders; 18 final List<Holder> holders;
19 final bool outputContainsConstantList; 19 final bool outputContainsConstantList;
20 final bool needsNativeSupport; 20 final bool needsNativeSupport;
21 final bool hasIsolateSupport; 21 final bool hasIsolateSupport;
22 /// A map from load id to the list of fragments that need to be loaded. 22 /// A map from load id to the list of fragments that need to be loaded.
23 final Map<String, List<Fragment>> loadMap; 23 final Map<String, List<Fragment>> loadMap;
24 24
25 // If this field is not `null` then its value must be emitted in the embedded 25 // 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. 26 // global `TYPE_TO_INTERCEPTOR_MAP`. The map references constants and classes.
27 final js.Expression typeToInterceptorMap; 27 final js.Expression typeToInterceptorMap;
28 28
29 // TODO(floitsch): we should store the metadata directly instead of storing 29 // TODO(floitsch): we should store the metadata directly instead of storing
30 // the collector. However, the old emitter still updates the data. 30 // the collector. However, the old emitter still updates the data.
31 final MetadataCollector _metadataCollector; 31 final MetadataCollector _metadataCollector;
32 TokenFinalizer get metadataFinalizer => _metadataCollector;
32 33
33 Program(this.fragments, 34 Program(this.fragments,
34 this.holders, 35 this.holders,
35 this.loadMap, 36 this.loadMap,
36 this.typeToInterceptorMap, 37 this.typeToInterceptorMap,
37 this._metadataCollector, 38 this._metadataCollector,
38 {this.needsNativeSupport, 39 {this.needsNativeSupport,
39 this.outputContainsConstantList, 40 this.outputContainsConstantList,
40 this.hasIsolateSupport}) { 41 this.hasIsolateSupport}) {
41 assert(needsNativeSupport != null); 42 assert(needsNativeSupport != null);
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 requiredParameterCount: requiredParameterCount, 481 requiredParameterCount: requiredParameterCount,
481 optionalParameterDefaultValues: optionalParameterDefaultValues, 482 optionalParameterDefaultValues: optionalParameterDefaultValues,
482 functionType: functionType); 483 functionType: functionType);
483 } 484 }
484 485
485 class StaticStubMethod extends StubMethod implements StaticMethod { 486 class StaticStubMethod extends StubMethod implements StaticMethod {
486 Holder holder; 487 Holder holder;
487 StaticStubMethod(String name, this.holder, js.Expression code) 488 StaticStubMethod(String name, this.holder, js.Expression code)
488 : super(name, code); 489 : super(name, code);
489 } 490 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698