[Vm-dev] VM Maker: VMMaker.oscog-nice.1731.mcz

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Fri Mar 18 21:15:11 UTC 2016


Yep, I corrected in 1733

2016-03-18 21:54 GMT+01:00 Eliot Miranda <eliot.miranda at gmail.com>:

>
> Hi Nicolas,
>
>     the right form for that stSizeOf: implementation is
>
> stSizeOf: integerValue
> "hack around the CoInterpreter/ObjectMemory split refactoring"
> <doNotGenerate>
> ^coInterpreter stSizeOf: integerValue
>
> On Thu, Mar 17, 2016 at 2:35 PM, <commits at source.squeak.org> wrote:
>
>>
>> Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
>> http://source.squeak.org/VMMaker/VMMaker.oscog-nice.1731.mcz
>>
>> ==================== Summary ====================
>>
>> Name: VMMaker.oscog-nice.1731
>> Author: nice
>> Time: 17 March 2016, 10:33:40.804 pm
>> UUID: 5a57b844-0803-41bd-b772-73cf6c7dfb0a
>> Ancestors: VMMaker.oscog-dtl.1730
>>
>> Fix a shift in BitBltSimulation. The shift must be signed but the
>> simulator incorrectly makes it unsigned leading to memory exhaustion error.
>>
>> Let FilePlugin>>primitiveDirectoryDelete primitiveFail rather than
>> raising a mustBeBoolean error.
>>
>> Fix 64bits simulation of long64At:put: that would fail for negative put
>> value.
>>
>> Provide a SpurMemoryManager stSizeOf: for simulation purpose (the message
>> is used by some plugins).
>>
>> Restore a more intention revealing literal in reverseDisplayFrom:to:
>>
>> =============== Diff against VMMaker.oscog-dtl.1730 ===============
>>
>> Item was changed:
>>   ----- Method: BitBltSimulation>>rgbMapPixel:flags: (in category 'color
>> mapping') -----
>>   rgbMapPixel: sourcePixel flags: mapperFlags
>>         "Perform the RGBA conversion for the given source pixel"
>>         | val |
>>         <inline: true>
>> +       val :=                  ((sourcePixel bitAnd: (cmMaskTable at:
>> 0)) bitShift: (cmShiftTable at: 0) signedIntFromLong).
>> +       val := val bitOr: ((sourcePixel bitAnd: (cmMaskTable at: 1))
>> bitShift: (cmShiftTable at: 1) signedIntFromLong).
>> +       val := val bitOr: ((sourcePixel bitAnd: (cmMaskTable at: 2))
>> bitShift: (cmShiftTable at: 2) signedIntFromLong).
>> +                 ^val bitOr: ((sourcePixel bitAnd: (cmMaskTable at: 3))
>> bitShift: (cmShiftTable at: 3) signedIntFromLong).
>> -       val :=                  ((sourcePixel bitAnd: (cmMaskTable at:
>> 0)) bitShift: (cmShiftTable at: 0)).
>> -       val := val bitOr: ((sourcePixel bitAnd: (cmMaskTable at: 1))
>> bitShift: (cmShiftTable at: 1)).
>> -       val := val bitOr: ((sourcePixel bitAnd: (cmMaskTable at: 2))
>> bitShift: (cmShiftTable at: 2)).
>> -                 ^val bitOr: ((sourcePixel bitAnd: (cmMaskTable at: 3))
>> bitShift: (cmShiftTable at: 3)).
>>   !
>>
>> Item was changed:
>>   ----- Method: FilePlugin>>primitiveDirectoryDelete (in category
>> 'directory primitives') -----
>>   primitiveDirectoryDelete
>>
>>         | dirName dirNameIndex dirNameSize okToDelete |
>>         <var: #dirNameIndex type: 'char *'>
>>         <export: true>
>>
>>         dirName := interpreterProxy stackValue: 0.
>>         (interpreterProxy isBytes: dirName)
>>                 ifFalse: [^interpreterProxy primitiveFail].
>>         dirNameIndex := interpreterProxy firstIndexableField: dirName.
>>         dirNameSize := interpreterProxy byteSizeOf: dirName.
>>         "If the security plugin can be loaded, use it to check for
>> permission.
>>         If not, assume it's ok"
>>         sCDPfn ~= 0
>> +               ifTrue: [okToDelete := self cCode: ' ((sqInt (*)(char *,
>> sqInt))sCDPfn)(dirNameIndex, dirNameSize)' inSmalltalk: [false].
>> -               ifTrue: [okToDelete := self cCode: ' ((sqInt (*)(char *,
>> sqInt))sCDPfn)(dirNameIndex, dirNameSize)'.
>>                         okToDelete
>>                                 ifFalse: [^interpreterProxy
>> primitiveFail]].
>>         (self
>>                         cCode: 'dir_Delete(dirNameIndex, dirNameSize)'
>>                         inSmalltalk: [false])
>>                 ifFalse: [^interpreterProxy primitiveFail].
>>         interpreterProxy pop: 1!
>>
>> Item was changed:
>>   ----- Method: Spur64BitMMLESimulator>>long64At:put: (in category
>> 'memory access') -----
>>   long64At: byteAddress put: a64BitValue
>>         byteAddress \\ 8 ~= 0 ifTrue: [self unalignedAccessError].
>>         self
>>                 long32At: byteAddress put: (a64BitValue bitAnd:
>> 16rffffffff);
>> +               long32At: byteAddress + 4 put: (a64BitValue >> 32 bitAnd:
>> 16rffffffff).
>> -               long32At: byteAddress + 4 put: a64BitValue >> 32.
>>         ^a64BitValue!
>>
>> Item was added:
>> + ----- Method: SpurMemoryManager>>stSizeOf: (in category 'object
>> access') -----
>> + stSizeOf: oop
>> +       "Return the number of indexable fields in the receiver"
>> +       ^oop basicSize!
>>
>> Item was changed:
>>   ----- Method: StackInterpreter>>reverseDisplayFrom:to: (in category
>> 'I/O primitive support') -----
>>   reverseDisplayFrom: startIndex to: endIndex
>>         "Reverse the given range of Display words (at different bit
>>         depths, this will reverse different numbers of pixels). Used to
>>         give feedback during VM activities such as garbage
>>         collection when debugging. It is assumed that the given
>>         word range falls entirely within the first line of the Display."
>>         | displayObj displayBits w wordStartIndex wordEndIndex
>> primFailCodeValue |
>>         displayObj := objectMemory splObj: TheDisplay.
>>         ((objectMemory isPointers: displayObj) and: [(objectMemory
>> lengthOf: displayObj) >= 4]) ifFalse: [^ nil].
>>         w := objectMemory fetchPointer: 1 ofObject: displayObj.
>>         displayBits := objectMemory fetchPointer: 0 ofObject: displayObj.
>>         ((objectMemory isImmediate: displayBits)
>>         or: [(objectMemory isNonIntegerObject: w)
>>         or: [objectMemory isPointersNonImm: displayBits]]) ifTrue: [^
>> nil].
>>         wordStartIndex := startIndex * 4.
>>         wordEndIndex := endIndex * 4 min: (objectMemory sizeBitsOf:
>> displayBits).
>>         displayBits := displayBits + objectMemory baseHeaderSize.
>>         displayBits + wordStartIndex to: displayBits + wordEndIndex by: 4
>> do:
>>                 [:ptr | | reversed  |
>> +               reversed := (objectMemory long32At: ptr) bitXor:
>> 16rFFFFFFFF.
>> -               reversed := (objectMemory long32At: ptr) bitXor:
>> 4294967295.
>>                 objectMemory long32At: ptr put: reversed].
>>         primFailCodeValue := primFailCode.
>>         self initPrimCall.
>>         self displayBitsOf: displayObj Left: 0 Top: 0 Right:
>> (objectMemory integerValueOf: w) Bottom: 1.
>>         self ioForceDisplayUpdate.
>>         primFailCode := primFailCodeValue!
>>
>>
>
>
> --
> _,,,^..^,,,_
> best, Eliot
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20160318/d3a3fe35/attachment-0001.htm


More information about the Vm-dev mailing list