OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
6 | 6 |
7 class ClassEmitter extends CodeEmitterHelper { | 7 class ClassEmitter extends CodeEmitterHelper { |
8 | 8 |
9 ClassStubGenerator get _stubGenerator => | 9 ClassStubGenerator get _stubGenerator => |
10 new ClassStubGenerator(compiler, namer, backend); | 10 new ClassStubGenerator(compiler, namer, backend); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 assert(invariant(classElement, method.element.isInstanceMember)); | 242 assert(invariant(classElement, method.element.isInstanceMember)); |
243 emitter.containerBuilder.addMemberMethod(method, builder); | 243 emitter.containerBuilder.addMemberMethod(method, builder); |
244 } | 244 } |
245 | 245 |
246 if (identical(classElement, compiler.objectClass) | 246 if (identical(classElement, compiler.objectClass) |
247 && compiler.enabledNoSuchMethod) { | 247 && compiler.enabledNoSuchMethod) { |
248 // Emit the noSuchMethod handlers on the Object prototype now, | 248 // Emit the noSuchMethod handlers on the Object prototype now, |
249 // so that the code in the dynamicFunction helper can find | 249 // so that the code in the dynamicFunction helper can find |
250 // them. Note that this helper is invoked before analyzing the | 250 // them. Note that this helper is invoked before analyzing the |
251 // full JS script. | 251 // full JS script. |
252 if (!emitter.nativeEmitter.handleNoSuchMethod) { | 252 emitter.nsmEmitter.emitNoSuchMethodHandlers(builder.addProperty); |
253 emitter.nsmEmitter.emitNoSuchMethodHandlers(builder.addProperty); | |
254 } | |
255 } | 253 } |
256 } | 254 } |
257 | 255 |
258 /// Emits the members from the model. | 256 /// Emits the members from the model. |
259 void emitRuntimeTypeInformation(Class cls, ClassBuilder builder) { | 257 void emitRuntimeTypeInformation(Class cls, ClassBuilder builder) { |
260 assert(builder.functionType == null); | 258 assert(builder.functionType == null); |
261 if (cls.functionTypeIndex != null) { | 259 if (cls.functionTypeIndex != null) { |
262 builder.functionType = '${cls.functionTypeIndex}'; | 260 builder.functionType = '${cls.functionTypeIndex}'; |
263 } | 261 } |
264 | 262 |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 js.number(index)); | 586 js.number(index)); |
589 } | 587 } |
590 jsAst.Expression convertRtiToRuntimeType = emitter | 588 jsAst.Expression convertRtiToRuntimeType = emitter |
591 .staticFunctionAccess(backend.findHelper('convertRtiToRuntimeType')); | 589 .staticFunctionAccess(backend.findHelper('convertRtiToRuntimeType')); |
592 compiler.dumpInfoTask.registerElementAst(element, | 590 compiler.dumpInfoTask.registerElementAst(element, |
593 builder.addProperty(name, | 591 builder.addProperty(name, |
594 js('function () { return #(#) }', | 592 js('function () { return #(#) }', |
595 [convertRtiToRuntimeType, computeTypeVariable]))); | 593 [convertRtiToRuntimeType, computeTypeVariable]))); |
596 } | 594 } |
597 } | 595 } |
OLD | NEW |