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

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

Issue 838643002: dart2js: Register constants in the model builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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.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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 // TODO(kasperl): This clearly doesn't work yet. 437 // TODO(kasperl): This clearly doesn't work yet.
438 js.Expression code = js.string("<<unimplemented>>"); 438 js.Expression code = js.string("<<unimplemented>>");
439 return new StaticMethod(element, 439 return new StaticMethod(element,
440 name, _registry.registerHolder(holder), code); 440 name, _registry.registerHolder(holder), code);
441 } 441 }
442 442
443 void _registerConstants(OutputUnit outputUnit, 443 void _registerConstants(OutputUnit outputUnit,
444 List<ConstantValue> constantValues) { 444 List<ConstantValue> constantValues) {
445 if (constantValues == null) return; 445 if (constantValues == null) return;
446 for (ConstantValue constantValue in constantValues) { 446 for (ConstantValue constantValue in constantValues) {
447 _registry.registerConstant(outputUnit, constantValue);
447 assert(!_constants.containsKey(constantValue)); 448 assert(!_constants.containsKey(constantValue));
448 String name = namer.constantName(constantValue); 449 String name = namer.constantName(constantValue);
449 String constantObject = namer.globalObjectForConstant(constantValue); 450 String constantObject = namer.globalObjectForConstant(constantValue);
450 Holder holder = _registry.registerHolder(constantObject); 451 Holder holder = _registry.registerHolder(constantObject);
451 Constant constant = new Constant(name, holder, constantValue); 452 Constant constant = new Constant(name, holder, constantValue);
452 _constants[constantValue] = constant; 453 _constants[constantValue] = constant;
453 }; 454 };
454 } 455 }
455 } 456 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/registry.dart » ('j') | pkg/compiler/lib/src/js_emitter/registry.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698