| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.startup_emitter.model_emitter; | 5 part of dart2js.js_emitter.startup_emitter.model_emitter; |
| 6 | 6 |
| 7 /// The name of the property that stores the tear-off getter on a static | 7 /// The name of the property that stores the tear-off getter on a static |
| 8 /// function. | 8 /// function. |
| 9 /// | 9 /// |
| 10 /// This property is only used when isolates are used. | 10 /// This property is only used when isolates are used. |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 fun[#argumentCount] = requiredParameterCount; | 226 fun[#argumentCount] = requiredParameterCount; |
| 227 fun[#defaultArgumentValues] = optionalParameterDefaultValues; | 227 fun[#defaultArgumentValues] = optionalParameterDefaultValues; |
| 228 var reflectionInfo = funType; | 228 var reflectionInfo = funType; |
| 229 if (typeof reflectionInfo == "number") { | 229 if (typeof reflectionInfo == "number") { |
| 230 // The reflectionInfo can either be a function, or a pointer into the types | 230 // The reflectionInfo can either be a function, or a pointer into the types |
| 231 // table. If it points into the types-table we need to update the index, | 231 // table. If it points into the types-table we need to update the index, |
| 232 // in case the tear-off is part of a deferred hunk. | 232 // in case the tear-off is part of a deferred hunk. |
| 233 reflectionInfo = reflectionInfo + typesOffset; | 233 reflectionInfo = reflectionInfo + typesOffset; |
| 234 } | 234 } |
| 235 var name = funsOrNames[0]; | 235 var name = funsOrNames[0]; |
| 236 fun.#stubName = name; |
| 236 var getterFunction = | 237 var getterFunction = |
| 237 tearOff(funs, reflectionInfo, isStatic, name, isIntercepted); | 238 tearOff(funs, reflectionInfo, isStatic, name, isIntercepted); |
| 238 container[getterName] = getterFunction; | 239 container[getterName] = getterFunction; |
| 239 if (isStatic) { | 240 if (isStatic) { |
| 240 fun.$tearOffPropertyName = getterFunction; | 241 fun.$tearOffPropertyName = getterFunction; |
| 241 } | 242 } |
| 242 } | 243 } |
| 243 | 244 |
| 244 // Instead of setting the interceptor tags directly we use this update | 245 // Instead of setting the interceptor tags directly we use this update |
| 245 // function. This makes it easier for deferred fragments to contribute to the | 246 // function. This makes it easier for deferred fragments to contribute to the |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 'holdersList': new js.ArrayInitializer(nonStaticStateHolders | 449 'holdersList': new js.ArrayInitializer(nonStaticStateHolders |
| 449 .map((holder) => js.js("#", holder.name)) | 450 .map((holder) => js.js("#", holder.name)) |
| 450 .toList(growable: false)), | 451 .toList(growable: false)), |
| 451 'staticStateDeclaration': new js.VariableDeclaration( | 452 'staticStateDeclaration': new js.VariableDeclaration( |
| 452 namer.staticStateHolder, | 453 namer.staticStateHolder, |
| 453 allowRename: false), | 454 allowRename: false), |
| 454 'staticState': js.js('#', namer.staticStateHolder), | 455 'staticState': js.js('#', namer.staticStateHolder), |
| 455 'constantHolderReference': buildConstantHolderReference(program), | 456 'constantHolderReference': buildConstantHolderReference(program), |
| 456 'holders': emitHolders(program.holders, fragment), | 457 'holders': emitHolders(program.holders, fragment), |
| 457 'callName': js.string(namer.callNameField), | 458 'callName': js.string(namer.callNameField), |
| 459 'stubName': js.string(namer.stubNameField), |
| 458 'argumentCount': js.string(namer.requiredParameterField), | 460 'argumentCount': js.string(namer.requiredParameterField), |
| 459 'defaultArgumentValues': js.string(namer.defaultValuesField), | 461 'defaultArgumentValues': js.string(namer.defaultValuesField), |
| 460 'prototypes': emitPrototypes(fragment), | 462 'prototypes': emitPrototypes(fragment), |
| 461 'inheritance': emitInheritance(fragment), | 463 'inheritance': emitInheritance(fragment), |
| 462 'aliases': emitInstanceMethodAliases(fragment), | 464 'aliases': emitInstanceMethodAliases(fragment), |
| 463 'tearOffs': emitInstallTearOffs(fragment), | 465 'tearOffs': emitInstallTearOffs(fragment), |
| 464 'constants': emitConstants(fragment), | 466 'constants': emitConstants(fragment), |
| 465 'staticNonFinalFields': emitStaticNonFinalFields(fragment), | 467 'staticNonFinalFields': emitStaticNonFinalFields(fragment), |
| 466 'lazyStatics': emitLazilyInitializedStatics(fragment), | 468 'lazyStatics': emitLazilyInitializedStatics(fragment), |
| 467 'embeddedGlobals': emitEmbeddedGlobals(program, deferredLoadHashes), | 469 'embeddedGlobals': emitEmbeddedGlobals(program, deferredLoadHashes), |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 } | 1311 } |
| 1310 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1312 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
| 1311 js.objectLiteral(interceptorsByTag))); | 1313 js.objectLiteral(interceptorsByTag))); |
| 1312 statements.add( | 1314 statements.add( |
| 1313 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); | 1315 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); |
| 1314 statements.add(subclassAssignment); | 1316 statements.add(subclassAssignment); |
| 1315 | 1317 |
| 1316 return new js.Block(statements); | 1318 return new js.Block(statements); |
| 1317 } | 1319 } |
| 1318 } | 1320 } |
| OLD | NEW |