JavaClassReloader.st
branchdevelopment
changeset 2528 bc5ce044d5a1
parent 2504 08bdd02727cf
child 2529 764ab6925cf5
equal deleted inserted replaced
2527:c380a7c258fb 2528:bc5ce044d5a1
   268 updateOldClass
   268 updateOldClass
   269     "at this point we know that both classes have same layout. So we can
   269     "at this point we know that both classes have same layout. So we can
   270      simply copy methods and other info from new class to old one. 
   270      simply copy methods and other info from new class to old one. 
   271      References must be flushed anyway!!"
   271      References must be flushed anyway!!"
   272 
   272 
   273 
   273     | oldMethods newMethods |
   274 
   274 
   275     oldClass setMethodDictionary: newClass methodDictionary.
   275     oldMethods := oldClass methodDictionary.
       
   276     newMethods := newClass methodDictionary copy.
       
   277 
       
   278     newMethods keysDo:[:selector|
       
   279         | oldM newM |
       
   280 
       
   281         oldM := oldMethods at: selector ifAbsent:[nil].
       
   282         oldM notNil ifTrue:[
       
   283             newM := newMethods at: selector.
       
   284             (oldM canBeUpdatedFrom: newM) ifTrue:[
       
   285                 oldM updateFrom: newM.
       
   286                 newMethods at: selector put: oldM.
       
   287             ]
       
   288         ]
       
   289     ].
       
   290     newMethods do:[:m|m setJavaClass: oldClass].
       
   291     oldClass setMethodDictionary: newMethods.
   276     oldClass setConstantPool: newClass constantPool.
   292     oldClass setConstantPool: newClass constantPool.
   277 
   293 
   278     "Created: / 16-12-2012 / 17:36:52 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
   294     "Created: / 16-12-2012 / 17:36:52 / Marcel Hlopko <marcel.hlopko@fit.cvut.cz>"
       
   295     "Modified: / 19-04-2013 / 00:24:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   279 ! !
   296 ! !
   280 
   297 
   281 !JavaClassReloader::SingleClassReloader methodsFor:'reloading'!
   298 !JavaClassReloader::SingleClassReloader methodsFor:'reloading'!
   282 
   299 
   283 reload
   300 reload