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

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

Issue 1153243003: dart2js: Use frequency of occurence to sort metadata indices. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed sra's comments 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.js_emitter.program_builder; 5 library dart2js.js_emitter.program_builder;
6 6
7 import 'js_emitter.dart' show computeMixinClass; 7 import 'js_emitter.dart' show computeMixinClass;
8 import 'model.dart'; 8 import 'model.dart';
9 9
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 requiredParameterCount: requiredParameterCount, 565 requiredParameterCount: requiredParameterCount,
566 optionalParameterDefaultValues: optionalParameterDefaultValues, 566 optionalParameterDefaultValues: optionalParameterDefaultValues,
567 functionType: functionType); 567 functionType: functionType);
568 } 568 }
569 569
570 js.Expression _generateFunctionType(DartType type, OutputUnit outputUnit) { 570 js.Expression _generateFunctionType(DartType type, OutputUnit outputUnit) {
571 if (type.containsTypeVariables) { 571 if (type.containsTypeVariables) {
572 js.Expression thisAccess = js.js(r'this.$receiver'); 572 js.Expression thisAccess = js.js(r'this.$receiver');
573 return backend.rti.getSignatureEncoding(type, thisAccess); 573 return backend.rti.getSignatureEncoding(type, thisAccess);
574 } else { 574 } else {
575 return js.number(backend.emitter.metadataCollector. 575 return backend.emitter.metadataCollector
576 reifyTypeForOutputUnit(type, outputUnit)); 576 .reifyTypeForOutputUnit(type, outputUnit);
577 } 577 }
578 } 578 }
579 579
580 List<ParameterStubMethod> _generateParameterStubs(MethodElement element, 580 List<ParameterStubMethod> _generateParameterStubs(MethodElement element,
581 bool canTearOff) { 581 bool canTearOff) {
582 582
583 if (!_methodNeedsStubs(element)) return const <ParameterStubMethod>[]; 583 if (!_methodNeedsStubs(element)) return const <ParameterStubMethod>[];
584 584
585 ParameterStubGenerator generator = 585 ParameterStubGenerator generator =
586 new ParameterStubGenerator(_compiler, namer, backend); 586 new ParameterStubGenerator(_compiler, namer, backend);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 _registry.registerConstant(outputUnit, constantValue); 755 _registry.registerConstant(outputUnit, constantValue);
756 assert(!_constants.containsKey(constantValue)); 756 assert(!_constants.containsKey(constantValue));
757 String name = namer.constantName(constantValue); 757 String name = namer.constantName(constantValue);
758 String constantObject = namer.globalObjectForConstant(constantValue); 758 String constantObject = namer.globalObjectForConstant(constantValue);
759 Holder holder = _registry.registerHolder(constantObject); 759 Holder holder = _registry.registerHolder(constantObject);
760 Constant constant = new Constant(name, holder, constantValue); 760 Constant constant = new Constant(name, holder, constantValue);
761 _constants[constantValue] = constant; 761 _constants[constantValue] = constant;
762 } 762 }
763 } 763 }
764 } 764 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart ('k') | pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698