| 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 * Documentation wanted -- johnniwinther | 9 * Documentation wanted -- johnniwinther |
| 10 * | 10 * |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 if (isIntercepted) { | 196 if (isIntercepted) { |
| 197 task.interceptorEmitter.interceptorInvocationNames.add( | 197 task.interceptorEmitter.interceptorInvocationNames.add( |
| 198 namer.setterName(field)); | 198 namer.setterName(field)); |
| 199 } | 199 } |
| 200 } else { | 200 } else { |
| 201 setterCode = 1; | 201 setterCode = 1; |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 int code = getterCode + (setterCode << 2); | 204 int code = getterCode + (setterCode << 2); |
| 205 if (code == 0) { | 205 if (code == 0) { |
| 206 compiler.reportInternalError( | 206 compiler.internalError(field, |
| 207 field, MessageKind.GENERIC, | 207 'Field code is 0 ($element/$field).'); |
| 208 {'text': 'Field code is 0 ($element/$field)'}); | |
| 209 } else { | 208 } else { |
| 210 fieldCode = FIELD_CODE_CHARACTERS[code - FIRST_FIELD_CODE]; | 209 fieldCode = FIELD_CODE_CHARACTERS[code - FIRST_FIELD_CODE]; |
| 211 } | 210 } |
| 212 } | 211 } |
| 213 if (backend.isAccessibleByReflection(field)) { | 212 if (backend.isAccessibleByReflection(field)) { |
| 214 reflectionMarker = '-'; | 213 reflectionMarker = '-'; |
| 215 if (backend.isNeededForReflection(field)) { | 214 if (backend.isNeededForReflection(field)) { |
| 216 DartType type = field.computeType(compiler); | 215 DartType type = field.computeType(compiler); |
| 217 reflectionMarker = '-${task.metadataEmitter.reifyType(type)}'; | 216 reflectionMarker = '-${task.metadataEmitter.reifyType(type)}'; |
| 218 } | 217 } |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 computeTypeVariable = | 594 computeTypeVariable = |
| 596 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); | 595 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); |
| 597 } | 596 } |
| 598 jsAst.Expression convertRtiToRuntimeType = | 597 jsAst.Expression convertRtiToRuntimeType = |
| 599 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); | 598 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); |
| 600 builder.addProperty( | 599 builder.addProperty( |
| 601 name, js.fun( | 600 name, js.fun( |
| 602 [], [js.return_(convertRtiToRuntimeType(computeTypeVariable))])); | 601 [], [js.return_(convertRtiToRuntimeType(computeTypeVariable))])); |
| 603 } | 602 } |
| 604 } | 603 } |
| OLD | NEW |