Build Update for OpenSmalltalk/opensmalltalk-vm
-------------------------------------
Build: #1326
Status: Errored
Duration: 20 mins and 56 secs
Commit: 2a64f48 (Cog)
Author: Eliot Miranda
Message: CogVM source as per VMMaker.oscog-eem.2381
General:
** new primitive to compare strings (slang + JIT)
answers negative smi, 0 or positive smi (instead of 1, 2 or 3 in the MiscPlugin)
Spur:
Fix compiler bug with Apple LLVM version 7.0.0 (clang-700.1.76) for 64-bit Spur
segment loading where compiler bug eliminated second version check in segment
load when at -Os. Fix is to never inline the 32-bit word byte reversal.
Fix sign extension in printOop: et al on 64-bit Spur.
FFI Plugin:
Correct a 32bit-hardcoded pointer size in FFI
Correct two copy/paste typos in num32BitUnitsOf:
Nicolas Cellier:
Note: I don't like the FFI code that I just corrected. IMO, it does the wrong
thing.
if I have an argument spec is
MyLib>>foo: aFoo
<cdecl: void foo(Foo *)>
where Foo is some ExternalStructure subclass
(Foo class>>fields ^#((x 'ushort') (y 'ushort')))
and that I try to pass (MyLib new foo: Foo new), it seems to me that the
Foo new getHandle will be (ByteArray new: 4).
What I understand from the code that I just corrected is that we are trying to
pass the contents of the ByteArray re-interpreted as a void pointer.
Scary and wrong...
If I instead pass (MyLib new foo: Foo externalNew), it seems that we don't even
bother to check if the (argSpec anyMask: FFIFlagPointer) and just force passing
the structure by value (thru a memcpy on stack). Scary and wrong...
In general, every one use <cdecl: void foo(void *)> to work around this
ill-behavior, and thus bypass type checks...
Also note that we can't even pass an ExternalData (think an Array of Foo),
because ffiArgument:Spec:Class:in: insists on having
actualArg class inheritsFrom: argType referentClass.
ExternalData does not inherit from Foo, event if its type matches
(ExternalType structTypeNamed: #Foo). That's crazy...
Another reason while people use <cdecl: void foo(void *)>
It's high time to consider a rewrite IMO.
Git:
Add scripts to list modified and untracked files.
View the changeset: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/42c2af2d4838...2a…
View the full build log and details: https://travis-ci.org/OpenSmalltalk/opensmalltalk-vm/builds/374223023?utm_s…
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications
This email was sent to vm-dev(a)lists.squeakfoundation.org (mailto:vm-dev@lists.squeakfoundation.org)
unsubscribe from this list (http://clicks.travis-ci.com/track/unsub.php?u=14313403&id=82653a6a0fa34337b…)
Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: 2a64f480334f24aca3f48769b61d9989330ecf17
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/2a64f480334f24aca3…
Author: Eliot Miranda <eliot.miranda(a)gmail.com>
Date: 2018-05-02 (Wed, 02 May 2018)
Changed paths:
M nsspur64src/vm/cogit.h
M nsspur64src/vm/cogitX64SysV.c
M nsspur64src/vm/cogitX64WIN64.c
M nsspur64src/vm/cointerp.c
M nsspur64src/vm/cointerp.h
M nsspur64src/vm/gcc3x-cointerp.c
M nsspursrc/vm/cogit.h
M nsspursrc/vm/cogitARMv5.c
M nsspursrc/vm/cogitIA32.c
M nsspursrc/vm/cogitMIPSEL.c
M nsspursrc/vm/cointerp.c
M nsspursrc/vm/cointerp.h
M nsspursrc/vm/gcc3x-cointerp.c
M nsspurstack64src/vm/gcc3x-interp.c
M nsspurstack64src/vm/interp.c
M nsspurstacksrc/vm/gcc3x-interp.c
M nsspurstacksrc/vm/interp.c
A scripts/modified
A scripts/untracked
M spur64src/vm/cogit.h
M spur64src/vm/cogitX64SysV.c
M spur64src/vm/cogitX64WIN64.c
M spur64src/vm/cointerp.c
M spur64src/vm/cointerp.h
M spur64src/vm/cointerpmt.c
M spur64src/vm/cointerpmt.h
M spur64src/vm/gcc3x-cointerp.c
M spur64src/vm/gcc3x-cointerpmt.c
M spurlowcode64src/vm/cogit.h
M spurlowcode64src/vm/cogitX64SysV.c
M spurlowcode64src/vm/cogitX64WIN64.c
M spurlowcode64src/vm/cointerp.c
M spurlowcode64src/vm/cointerp.h
M spurlowcode64src/vm/gcc3x-cointerp.c
M spurlowcodesrc/vm/cogit.h
M spurlowcodesrc/vm/cogitARMv5.c
M spurlowcodesrc/vm/cogitIA32.c
M spurlowcodesrc/vm/cogitMIPSEL.c
M spurlowcodesrc/vm/cointerp.c
M spurlowcodesrc/vm/cointerp.h
M spurlowcodesrc/vm/gcc3x-cointerp.c
M spurlowcodestack64src/vm/gcc3x-interp.c
M spurlowcodestack64src/vm/interp.c
M spurlowcodestacksrc/vm/gcc3x-interp.c
M spurlowcodestacksrc/vm/interp.c
M spursista64src/vm/cogit.h
M spursista64src/vm/cogitX64SysV.c
M spursista64src/vm/cogitX64WIN64.c
M spursista64src/vm/cointerp.c
M spursista64src/vm/cointerp.h
M spursista64src/vm/gcc3x-cointerp.c
M spursistasrc/vm/cogit.h
M spursistasrc/vm/cogitARMv5.c
M spursistasrc/vm/cogitIA32.c
M spursistasrc/vm/cogitMIPSEL.c
M spursistasrc/vm/cointerp.c
M spursistasrc/vm/cointerp.h
M spursistasrc/vm/gcc3x-cointerp.c
M spursrc/vm/cogit.h
M spursrc/vm/cogitARMv5.c
M spursrc/vm/cogitIA32.c
M spursrc/vm/cogitMIPSEL.c
M spursrc/vm/cointerp.c
M spursrc/vm/cointerp.h
M spursrc/vm/cointerpmt.c
M spursrc/vm/cointerpmt.h
M spursrc/vm/gcc3x-cointerp.c
M spursrc/vm/gcc3x-cointerpmt.c
M spurstack64src/vm/gcc3x-interp.c
M spurstack64src/vm/interp.c
M spurstacksrc/vm/gcc3x-interp.c
M spurstacksrc/vm/interp.c
M src/plugins/Squeak3D/Squeak3D.c
M src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c
M src/plugins/SqueakFFIPrims/IA32FFIPlugin.c
M src/plugins/SqueakFFIPrims/X64SysVFFIPlugin.c
M src/plugins/SqueakFFIPrims/X64Win64FFIPlugin.c
M src/vm/cogit.h
M src/vm/cogitARMv5.c
M src/vm/cogitIA32.c
M src/vm/cogitMIPSEL.c
M src/vm/cointerp.c
M src/vm/cointerp.h
M src/vm/cointerpmt.c
M src/vm/cointerpmt.h
M src/vm/gcc3x-cointerp.c
M src/vm/gcc3x-cointerpmt.c
M stacksrc/vm/gcc3x-interp.c
M stacksrc/vm/interp.c
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.2381
General:
** new primitive to compare strings (slang + JIT)
answers negative smi, 0 or positive smi (instead of 1, 2 or 3 in the MiscPlugin)
Spur:
Fix compiler bug with Apple LLVM version 7.0.0 (clang-700.1.76) for 64-bit Spur
segment loading where compiler bug eliminated second version check in segment
load when at -Os. Fix is to never inline the 32-bit word byte reversal.
Fix sign extension in printOop: et al on 64-bit Spur.
FFI Plugin:
Correct a 32bit-hardcoded pointer size in FFI
Correct two copy/paste typos in num32BitUnitsOf:
Nicolas Cellier:
Note: I don't like the FFI code that I just corrected. IMO, it does the wrong
thing.
if I have an argument spec is
MyLib>>foo: aFoo
<cdecl: void foo(Foo *)>
where Foo is some ExternalStructure subclass
(Foo class>>fields ^#((x 'ushort') (y 'ushort')))
and that I try to pass (MyLib new foo: Foo new), it seems to me that the
Foo new getHandle will be (ByteArray new: 4).
What I understand from the code that I just corrected is that we are trying to
pass the contents of the ByteArray re-interpreted as a void pointer.
Scary and wrong...
If I instead pass (MyLib new foo: Foo externalNew), it seems that we don't even
bother to check if the (argSpec anyMask: FFIFlagPointer) and just force passing
the structure by value (thru a memcpy on stack). Scary and wrong...
In general, every one use <cdecl: void foo(void *)> to work around this
ill-behavior, and thus bypass type checks...
Also note that we can't even pass an ExternalData (think an Array of Foo),
because ffiArgument:Spec:Class:in: insists on having
actualArg class inheritsFrom: argType referentClass.
ExternalData does not inherit from Foo, event if its type matches
(ExternalType structTypeNamed: #Foo). That's crazy...
Another reason while people use <cdecl: void foo(void *)>
It's high time to consider a rewrite IMO.
Git:
Add scripts to list modified and untracked files.
**NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/
Functionality will be removed from GitHub.com on January 31st, 2019.
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2381.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2381
Author: eem
Time: 2 May 2018, 6:38:40.242754 pm
UUID: c8fa6961-f14a-4115-aa4c-f445c5f51e6f
Ancestors: VMMaker.oscog-eem.2380
Fix a bug in the refactored conditional define code; a slip caused premature evaluation of the block argument.
Fix a spleeing rorre.
=============== Diff against VMMaker.oscog-eem.2380 ===============
Item was changed:
----- Method: VMMaker class>>generateAllConfigurationsUnderVersionControl (in category 'configurations') -----
generateAllConfigurationsUnderVersionControl
self
executeDisplayingProgress:
(OrderedDictionary
with: 'Generate all newspeak configurations under VCS' -> [ self generateAllNewspeakConfigurationsUnderVersionControl ]
with: 'Generate all squeak cofigurations under VCS' -> [ self generateAllSqueakConfigurationsUnderVersionControl ]
+ with: 'Generate all spur lowcode configurations' -> [ self generateAllSpurLowcodeConfigurations ]
- with: 'Generate all spur lowercode configurations' -> [ self generateAllSpurLowcodeConfigurations ]
with: 'Generate VM plugins' -> [ self generateVMPlugins ])!
Item was changed:
----- Method: VMPluginCodeGenerator>>withGuardAgainstDefinitionOf:on:do: (in category 'C translation') -----
withGuardAgainstDefinitionOf: selector on: aStream do: aBlock
"Evaluate aBlock, surrounded by a define if selector is defined as a macro (i.e. by preDeclareInterpreterProxyOn:"
(self selectorsThatMayBeGeneratedAsMacros includes: selector) ifFalse:
[^aBlock value].
self
withConditionalDefineOf: (self cFunctionNameFor: selector)
comment: nil
on: aStream
+ do: aBlock!
- do: aBlock value!
Hi All, FYI...
On Wed, May 2, 2018 at 1:40 PM, <commits(a)source.squeak.org> wrote:
> Eliot Miranda uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-eem.1021.mcz
>
> ==================== Summary ====================
>
> Name: System-eem.1021
> Author: eem
> Time: 2 May 2018, 1:39:55.407326 pm
> UUID: 727d275e-a337-4208-9616-f887d8fd4576
> Ancestors: System-eem.1020
>
> Move more NativeImageSegment methods up to ImageSegment. Provide a hack
> accessor for testing that a segment can be loaded (forFile:outPointers:,
> which may get deleted once 64-bit native image segments work).
>
It turns out that, at least on Mac OS X, 64-bit image segments do work in
both the debug (-O0) and the assert (-O1) VMs, both Cog and Stack VMs, but
not in the production VM (-Os). Sigh...
=============== Diff against System-eem.1020 ===============
>
> Item was added:
> + ----- Method: ImageSegment class>>folder (in category 'fileIn/Out') -----
> + folder
> + | im |
> + "Full path name of segments folder. Be sure to duplicate and
> rename the folder when you duplicate and rename an image. Is $_ legal in
> all file systems?"
> +
> + im := Smalltalk imageName.
> + ^ (im copyFrom: 1 to: im size - 6 "'.image' size"), '_segs'!
>
> Item was added:
> + ----- Method: ImageSegment>>errorWrongState (in category 'testing') -----
> + errorWrongState
> +
> + ^ self error: 'wrong state'!
>
> Item was added:
> + ----- Method: ImageSegment>>forFile:outPointers: (in category
> 'testing') -----
> + forFile: aFileName outPointers: outPointerArray
> + "An accessor for testing to set up a new image segment to be in a
> state to load from aFileName. After this send install to load."
> + fileName := aFileName.
> + state := #onFile.
> + outPointers := outPointerArray!
>
> Item was added:
> + ----- Method: ImageSegment>>install (in category 'read/write segment')
> -----
> + install
> + "This operation retrieves the segment if necessary from file
> storage, installs it in memory, and replaces (using become:) all the root
> stubs with the reconstructed roots of the segment."
> +
> + | allObjectsInSegment newRoots |
> + state = #onFile ifTrue: [self readFromFile].
> + state = #onFileWithSymbols ifTrue:
> + [self readFromFileWithSymbols].
> + (state = #active) | (state = #imported) ifFalse: [self
> errorWrongState].
> + allObjectsInSegment := self loadSegmentFrom: segment outPointers:
> outPointers.
> + newRoots := allObjectsInSegment first.
> + self checkAndReportLoadError.
> + (state = #imported "just came in from exported file" or:
> [arrayOfRoots isNil "testing..."])
> + ifTrue: [arrayOfRoots := newRoots]
> + ifFalse: [arrayOfRoots elementsForwardIdentityTo:
> newRoots].
> + state := #inactive.
> + Beeper beepPrimitive!
>
> Item was changed:
> ----- Method: ImageSegment>>loadSegmentFrom:outPointers: (in category
> 'read/write segment') -----
> loadSegmentFrom: segment outPointers: outPointers
> "Attempt to load the segment into memory (reify the objects in
> segment
> as real objects), using outPointers to bind references to objects
> not in the
> segment. Answer a collection of all the objects in the segment."
> | segmentFormat |
> + (state == #imported or: [state == #active]) ifTrue:
> + [segmentFormat := self segmentFormatFrom: segment first.
> - state == #imported ifTrue:
> - [segmentFormat := segment first bitAnd: 16rFFFFFF.
> segmentFormat = 6502 ifTrue:
> [LegacyImageSegment adoptInstance: self.
> ^self loadSegmentFrom: segment outPointers:
> outPointers].
> segmentFormat = Smalltalk imageFormatVersion ifTrue:
> [NativeImageSegment adoptInstance: self.
> ^self loadSegmentFrom: segment outPointers:
> outPointers].
> self error: 'no handling for format ', segmentFormat
> asString. ' in a ', Smalltalk imageFormatVersion asString, ' image.'].
> self subclassResponsibility!
>
> Item was added:
> + ----- Method: ImageSegment>>localName (in category 'read/write segment')
> -----
> + localName
> + | segs ind sep |
> + "Return the current file name for this segment, a local name in
> the segments directory."
> +
> + fileName ifNil: [^ nil].
> + "^ fileName"
> +
> + "The following is for backward compatibility. Remove this part
> after June 2000.
> + Check if the fileName is a full path, and make it local.
> Regardless of current or previous file system delimiter."
> +
> + segs := self class folder copyLast: 4. ":=segs"
> + ind := 1.
> + [ind := fileName findString: segs startingAt: ind+1 caseSensitive:
> false.
> + ind = 0 ifTrue: [^ fileName].
> + sep := fileName at: ind + (segs size).
> + sep isAlphaNumeric ] whileTrue. "sep is letter or
> digit, not a separator"
> +
> + ^ fileName := fileName copyFrom: ind+(segs size)+1 "delimiter" to:
> fileName size!
>
> Item was added:
> + ----- Method: ImageSegment>>readFromFile (in category 'read/write
> segment') -----
> + readFromFile
> + "Read in a simple segment. Use folder of this image, even if
> remembered as previous location of this image"
> +
> + | ff realName |
> + realName := self class folder, FileDirectory slash, self localName.
> + ff := FileStream readOnlyFileNamed: realName.
> + segment := ff nextWordsInto: (WordArrayForSegment new: ff size//4).
> + ff close.
> + state := #active!
>
> Item was added:
> + ----- Method: ImageSegment>>segmentFormatFrom: (in category 'private')
> -----
> + segmentFormatFrom: a32BitWord
> + "The first two words of a segment array contain the image format
> version of the system upon which the segment was generated, along with a
> top byte that is either $d or $s (from the 'does' in #doesNotUnderstand:).
> But this may be encoded either in big-endian or little-endian format.
> Since endianness may or may not have been changed, determining what the
> segment format is takes care."
> + | msc lsc |
> + msc := Character value: ((a32BitWord bitShift: -24) bitAnd: 255).
> + lsc := Character value: (a32BitWord bitAnd: 255).
> + (('ds' includes: msc)
> + and: ['ds' includes: lsc]) ifTrue:
> + [self error: 'ambiguous segment format'].
> + ('ds' includes: msc) ifTrue:
> + [^a32BitWord bitAnd: 16rFFFFFF].
> + ^((a32BitWord bitShift: -24) bitAnd: 16rFF)
> + + ((a32BitWord bitShift: -8) bitAnd: 16rFF00)
> + + ((a32BitWord bitShift: 8) bitAnd: 16rFF0000)!
>
> Item was added:
> + ----- Method: LegacyImageSegment>>aComment (in category 'compact
> classes') -----
> + aComment
> + "Compact classes are a potential problem because a pointer to the
> class would not ordinarily show up in the outPointers. We add the classes
> of all compact classes to outPointers, both for local and export segments.
> + Compact classes are never allowed as roots. No compact class may
> be in an Environment that is written out to disk. (In local segments, the
> compact classes array should never have an ImageSegmentRootStub in it. For
> export, fileIn the class first, then load a segment with instances of it.
> The fileIn code can be pasted onto the front of the .extSeg file)
> + For local segments, a class may become compact while its instances
> are out on the disk. Or it may become un-compact. A compact class may
> change shape while some of its instances are on disk. All three cases go
> through (ClassDescription updateInstancesFrom:). If it can't rule out an
> instance being in the segment, it reads it in to fix the instances.
> + See Behavior.becomeCompact for the rules on Compact classes.
> Indexes may not be reused. This is so that an incoming export segment has
> its index available. (Changes may be needed in the way indexes are
> assigned.)
> + For export segments, a compact class may have a different shape.
> The normal class reshape mechanism will catch this. During the
> installation of the segment, objects will have the wrong version of their
> class momentarily. We will change them back before we get caught.
> + For export segments, the last two items in outPointers are the
> number 1717 and an array of the compact classes used in this segment. (The
> classes in the array are converted from DiskProxies by SmartRefStream.) If
> that class is not compact in the new image, the instances are recopied.
> + "!
>
> Item was removed:
> - ----- Method: NativeImageSegment class>>folder (in category
> 'fileIn/Out') -----
> - folder
> - | im |
> - "Full path name of segments folder. Be sure to duplicate and
> rename the folder when you duplicate and rename an image. Is $_ legal in
> all file systems?"
> -
> - im := Smalltalk imageName.
> - ^ (im copyFrom: 1 to: im size - 6 "'.image' size"), '_segs'!
>
> Item was changed:
> ----- Method: NativeImageSegment>>aComment (in category 'compact
> classes') -----
> aComment
> + "Spur does not use compact classes, so an effort has been made to
> excise their use from the code. The previous comment was:
> - "Spur does not use compact classes, so an effort has been made to
> excise their use from the code. Thew previous comment was:
>
> Compact classes are a potential problem because a pointer to the
> class would not ordinarily show up in the outPointers. We add the classes
> of all compact classes to outPointers, both for local and export segments.
> Compact classes are never allowed as roots. No compact class may
> be in an Environment that is written out to disk. (In local segments, the
> compact classes array should never have an ImageSegmentRootStub in it. For
> export, fileIn the class first, then load a segment with instances of it.
> The fileIn code can be pasted onto the front of the .extSeg file)
> For local segments, a class may become compact while its instances
> are out on the disk. Or it may become un-compact. A compact class may
> change shape while some of its instances are on disk. All three cases go
> through (ClassDescription updateInstancesFrom:). If it can't rule out an
> instance being in the segment, it reads it in to fix the instances.
> See Behavior.becomeCompact for the rules on Compact classes.
> Indexes may not be reused. This is so that an incoming export segment has
> its index available. (Changes may be needed in the way indexes are
> assigned.)
> For export segments, a compact class may have a different shape.
> The normal class reshape mechanism will catch this. During the
> installation of the segment, objects will have the wrong version of their
> class momentarily. We will change them back before we get caught.
> + For export segments, the last two items in outPointers are the
> number 1717 and an array of the compact classes used in this segment. (The
> classes in the array are converted from DiskProxies by SmartRefStream.) If
> that class is not compact in the new image, the instances are recopied."!
> - For export segments, the last two items in outPointers are the
> number 1717 and an array of the compact classes used in this segment. (The
> classes in the array are converted from DiskProxies by SmartRefStream.) If
> that class is not compact in the new image, the instances are recopied.
> - "!
>
> Item was removed:
> - ----- Method: NativeImageSegment>>errorWrongState (in category
> 'testing') -----
> - errorWrongState
> -
> - ^ self error: 'wrong state'!
>
> Item was removed:
> - ----- Method: NativeImageSegment>>install (in category 'read/write
> segment') -----
> - install
> - "This operation retrieves the segment if necessary from file
> storage, installs it in memory, and replaces (using become:) all the root
> stubs with the reconstructed roots of the segment."
> -
> - | allObjectsInSegment newRoots |
> - state = #onFile ifTrue: [self readFromFile].
> - state = #onFileWithSymbols ifTrue:
> - [self readFromFileWithSymbols].
> - (state = #active) | (state = #imported) ifFalse: [self
> errorWrongState].
> - allObjectsInSegment := self loadSegmentFrom: segment outPointers:
> outPointers.
> - newRoots := allObjectsInSegment first.
> - self checkAndReportLoadError.
> - state = #imported "just came in from exported file"
> - ifTrue: [arrayOfRoots := newRoots]
> - ifFalse: [arrayOfRoots elementsForwardIdentityTo:
> newRoots].
> - state := #inactive.
> - Beeper beepPrimitive!
>
> Item was removed:
> - ----- Method: NativeImageSegment>>localName (in category 'read/write
> segment') -----
> - localName
> - | segs ind sep |
> - "Return the current file name for this segment, a local name in
> the segments directory."
> -
> - fileName ifNil: [^ nil].
> - "^ fileName"
> -
> - "The following is for backward compatibility. Remove this part
> after June 2000.
> - Check if the fileName is a full path, and make it local.
> Regardless of current or previous file system delimiter."
> -
> - segs := self class folder copyLast: 4. ":=segs"
> - ind := 1.
> - [ind := fileName findString: segs startingAt: ind+1 caseSensitive:
> false.
> - ind = 0 ifTrue: [^ fileName].
> - sep := fileName at: ind + (segs size).
> - sep isAlphaNumeric ] whileTrue. "sep is letter or
> digit, not a separator"
> -
> - ^ fileName := fileName copyFrom: ind+(segs size)+1 "delimiter" to:
> fileName size!
>
> Item was removed:
> - ----- Method: NativeImageSegment>>readFromFile (in category 'read/write
> segment') -----
> - readFromFile
> - "Read in a simple segment. Use folder of this image, even if
> remembered as previous location of this image"
> -
> - | ff realName |
> - realName := self class folder, FileDirectory slash, self localName.
> - ff := FileStream readOnlyFileNamed: realName.
> - segment := ff nextWordsInto: (WordArrayForSegment new: ff size//4).
> - ff close.
> - state := #active!
>
> Item was removed:
> - ----- Method: NativeImageSegment>>segmentFormatFrom: (in category
> 'private') -----
> - segmentFormatFrom: a32BitWord
> - "The first two words of a segment array contain the image format
> version of the system upon which the segment was generated, along with a
> top byte that is either $d or $s (from the 'does' in #doesNotUnderstand:).
> But this may be encoded either in big-endian or little-endian format.
> Since endianness may or may not have been changed, determining what the
> segment format is takes care."
> - | msc lsc |
> - msc := Character value: ((a32BitWord bitShift: -24) bitAnd: 255).
> - lsc := Character value: (a32BitWord bitAnd: 255).
> - (('ds' includes: msc)
> - and: ['ds' includes: lsc]) ifTrue:
> - [self error: 'ambiguous segment format'].
> - ('ds' includes: msc) ifTrue:
> - [^a32BitWord bitAnd: 16rFFFFFF].
> - ^((a32BitWord bitShift: -24) bitAnd: 16rFF)
> - + ((a32BitWord bitShift: -8) bitAnd: 16rFF00)
> - + ((a32BitWord bitShift: 8) bitAnd: 16rFF0000)!
>
>
>
--
_,,,^..^,,,_
best, Eliot