Frank Shearar uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-fbs.510.mcz ==================== Summary ==================== Name: System-fbs.510 Author: fbs Time: 3 January 2013, 1:16:36.267 pm UUID: 70b86651-f357-4746-a017-5d231faf542c Ancestors: System-nice.509 This seems like the proper post-Environment thing to do. It addresses http://bugs.squeak.org/view.php?id=7714. However, the change needs careful thought: how does this affect DataStreams written out within one Environment and read in by another Environment? Can this only work between "equivalent" Environments and, if so, what exactly does "equivalent" mean? Right now, this change does away with the need for Environments-fbs.9 (also in the Inbox), so applying it would make the ReleaseSqueakTrunk job work once more. =============== Diff against System-nice.509 =============== Item was changed: ----- Method: DataStream class>>initialize (in category 'as yet unclassified') ----- initialize "TypeMap maps Smalltalk classes to type ID numbers which identify the data stream primitive formats. nextPut: writes these IDs to the data stream. NOTE: Changing these type ID numbers will invalidate all extant data stream files. Adding new ones is OK. Classes named here have special formats in the file. If such a class has a subclass, it will use type 9 and write correctly. It will just be slow. (Later write the class name in the special format, then subclasses can use the type also.) See nextPut:, next, typeIDFor:, & ReferenceStream>>isAReferenceType:" "DataStream initialize" | refTypes t | refTypes := OrderedCollection new. t := TypeMap := WeakIdentityKeyDictionary new. "It has to be weak, because some classes may go away, leaving obsolete versions in this dictionary which may make it corrupt." t at: UndefinedObject put: 1. refTypes add: 0. t at: True put: 2. refTypes add: 0. t at: False put: 3. refTypes add: 0. t at: SmallInteger put: 4. refTypes add: 0. t at: ByteString put: 5. refTypes add: 1. t at: ByteSymbol put: 6. refTypes add: 1. t at: ByteArray put: 7. refTypes add: 1. t at: Array put: 8. refTypes add: 1. "(type ID 9 is for arbitrary instances of any class, cf. typeIDFor:)" refTypes add: 1. "(type ID 10 is for references, cf. ReferenceStream>>tryToPutReference:)" refTypes add: 0. t at: Bitmap put: 11. refTypes add: 1. t at: Metaclass put: 12. refTypes add: 0. "Type ID 13 is used for HyperSqueak User classes that must be reconstructed." refTypes add: 1. t at: Float put: 14. refTypes add: 1. t at: Rectangle put: 15. refTypes add: 1. "Allow compact Rects." "type ID 16 is an instance with short header. See beginInstance:size:" refTypes add: 1. self flag: #ByteArray. t at: ByteString put: 17. refTypes add: 1. "new String format, 1 or 4 bytes of length" t at: WordArray put: 18. refTypes add: 1. "bitmap-like" t at: WordArrayForSegment put: 19. refTypes add: 1. "bitmap-like" t at: SoundBuffer put: 20. refTypes add: 1. "And all other word arrays, both 16-bit and 32-bit. See methods in ArrayedCollection. Overridden in SoundBuffer." t at: CompiledMethod put: 21. refTypes add: 1. "special creation method" "t at: put: 22. refTypes add: 0." ReferenceStream refTypes: refTypes. "save it" "For all classes that are like WordArrays, store them the way ColorArray is stored. As bits, and able to change endianness." + self environment allClassesDo: [:cls | - Smalltalk do: [:cls | (cls isInMemory and: [ cls isBehavior and: [ cls isObsolete not and: [ cls isPointers not and: [ cls isVariable and: [ cls isWords and: [ (t includesKey: cls) not ] ] ] ] ] ]) ifTrue: [ t at: cls put: 20 ] ]! |
On Thu, Jan 3, 2013 at 8:16 AM, <[hidden email]> wrote: Frank Shearar uploaded a new version of System to project The Inbox: I suspect that the new binding protocol will have to address the distinction between "all classes in an environment" and "all classes in the system". This will be an issue with SystemNavigation, for example, where we might want "environment senders" or "system senders". Things like MethodReference will be affected too.
I wonder how DataStream deals with variable-word classes that get added after the type map is initialized. Is this just an optimization for stuff that ships with the image? Does it re-initialize somehow?
If it's just an optimization, the change above is fine. If it needs a comprehensive type map to work correctly, we'll have to do something more involved.
Colin |
On 03.01.2013, at 15:35, Colin Putney <[hidden email]> wrote:
> I wonder how DataStream deals with variable-word classes that get added after the type map is initialized. Is this just an optimization for stuff that ships with the image? Does it re-initialize somehow? I remember seeing code that re-initializes DataStream when installed. Maybe it was FFI to register ExternalAddress? > > If it's just an optimization, the change above is fine. If it needs a comprehensive type map to work correctly, we'll have to do something more involved. > > Colin > - Bert - |
On 7 January 2013 09:44, Bert Freudenberg <[hidden email]> wrote:
> On 03.01.2013, at 15:35, Colin Putney <[hidden email]> wrote: > >> I wonder how DataStream deals with variable-word classes that get added after the type map is initialized. Is this just an optimization for stuff that ships with the image? Does it re-initialize somehow? > > I remember seeing code that re-initializes DataStream when installed. Maybe it was FFI to register ExternalAddress? Not FFI, that I can see. frank >> If it's just an optimization, the change above is fine. If it needs a comprehensive type map to work correctly, we'll have to do something more involved. >> >> Colin >> > > - Bert - > > > |
On 07.01.2013, at 07:25, Frank Shearar <[hidden email]> wrote: > On 7 January 2013 09:44, Bert Freudenberg <[hidden email]> wrote: >> On 03.01.2013, at 15:35, Colin Putney <[hidden email]> wrote: >> >>> I wonder how DataStream deals with variable-word classes that get added after the type map is initialized. Is this just an optimization for stuff that ships with the image? Does it re-initialize somehow? >> >> I remember seeing code that re-initializes DataStream when installed. Maybe it was FFI to register ExternalAddress? > > Not FFI, that I can see. > > frank Then maybe Balloon3D? It was Andreas' code, I think. Ah yes. In Etoys we have a "discard3D" method which also re-initializes DataStream. - Bert - |
Free forum by Nabble | Edit this page |