| OLD | NEW |
| 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 ClassStubGenerator classStubGenerator = | 325 ClassStubGenerator classStubGenerator = |
| 326 new ClassStubGenerator(_compiler, namer, backend); | 326 new ClassStubGenerator(_compiler, namer, backend); |
| 327 RuntimeTypeGenerator runtimeTypeGenerator = | 327 RuntimeTypeGenerator runtimeTypeGenerator = |
| 328 new RuntimeTypeGenerator(_compiler, _task, namer); | 328 new RuntimeTypeGenerator(_compiler, _task, namer); |
| 329 | 329 |
| 330 void visitMember(ClassElement enclosing, Element member) { | 330 void visitMember(ClassElement enclosing, Element member) { |
| 331 assert(invariant(element, member.isDeclaration)); | 331 assert(invariant(element, member.isDeclaration)); |
| 332 assert(invariant(element, element == enclosing)); | 332 assert(invariant(element, element == enclosing)); |
| 333 | 333 |
| 334 if (Elements.isNonAbstractInstanceMember(member)) { | 334 if (Elements.isNonAbstractInstanceMember(member)) { |
| 335 js.Expression code = backend.generatedCode[member]; | |
| 336 // TODO(herhut): Remove once _buildMethod can no longer return null. | 335 // TODO(herhut): Remove once _buildMethod can no longer return null. |
| 337 Method method = _buildMethod(member); | 336 Method method = _buildMethod(member); |
| 338 if (method != null) methods.add(method); | 337 if (method != null) methods.add(method); |
| 339 } | 338 } |
| 340 if (member.isGetter || member.isField) { | 339 if (member.isGetter || member.isField) { |
| 341 Set<Selector> selectors = | 340 Set<Selector> selectors = |
| 342 _compiler.codegenWorld.invokedNames[member.name]; | 341 _compiler.codegenWorld.invokedNames[member.name]; |
| 343 if (selectors != null && !selectors.isEmpty) { | 342 if (selectors != null && !selectors.isEmpty) { |
| 344 | 343 |
| 345 Map<String, js.Expression> callStubsForMember = | 344 Map<String, js.Expression> callStubsForMember = |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 _registry.registerConstant(outputUnit, constantValue); | 755 _registry.registerConstant(outputUnit, constantValue); |
| 757 assert(!_constants.containsKey(constantValue)); | 756 assert(!_constants.containsKey(constantValue)); |
| 758 String name = namer.constantName(constantValue); | 757 String name = namer.constantName(constantValue); |
| 759 String constantObject = namer.globalObjectForConstant(constantValue); | 758 String constantObject = namer.globalObjectForConstant(constantValue); |
| 760 Holder holder = _registry.registerHolder(constantObject); | 759 Holder holder = _registry.registerHolder(constantObject); |
| 761 Constant constant = new Constant(name, holder, constantValue); | 760 Constant constant = new Constant(name, holder, constantValue); |
| 762 _constants[constantValue] = constant; | 761 _constants[constantValue] = constant; |
| 763 } | 762 } |
| 764 } | 763 } |
| 765 } | 764 } |
| OLD | NEW |