[Vm-dev] VM Maker: VMMaker.oscog-eem.2395.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu May 31 01:11:11 UTC 2018
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2395.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2395
Author: eem
Time: 30 May 2018, 6:10:40.193368 pm
UUID: 18590d2e-a338-43f2-ae2d-98ac73b654c1
Ancestors: VMMaker.oscog-eem.2394
Fix regression in primitiveDisplayString (missed return on short-cut return for empty string).
=============== Diff against VMMaker.oscog-eem.2394 ===============
Item was changed:
----- Method: BitBltSimulation>>primitiveDisplayString (in category 'primitives') -----
primitiveDisplayString
| kernDelta xTable glyphMap stopIndex startIndex sourceString bbObj maxGlyph ascii glyphIndex sourcePtr left quickBlt |
<export: true>
<var: #sourcePtr type: 'char *'>
interpreterProxy methodArgumentCount = 6 ifFalse:
[^interpreterProxy primitiveFail].
kernDelta := interpreterProxy stackIntegerValue: 0.
xTable := interpreterProxy stackValue: 1.
glyphMap := interpreterProxy stackValue: 2.
stopIndex := interpreterProxy stackIntegerValue: 3.
startIndex := interpreterProxy stackIntegerValue: 4.
sourceString := interpreterProxy stackValue: 5.
bbObj := interpreterProxy stackObjectValue: 6.
interpreterProxy failed ifTrue:
[^nil].
((interpreterProxy isArray: xTable)
and: [(interpreterProxy isArray: glyphMap)
and: [(interpreterProxy slotSizeOf: glyphMap) = 256
and: [(interpreterProxy isBytes: sourceString)
and: [startIndex > 0
and: [stopIndex >= 0 "to avoid failing for empty strings..."
and: [stopIndex <= (interpreterProxy byteSizeOf: sourceString)
and: [(self loadBitBltFrom: bbObj)
and: [combinationRule ~= 30 "these two need extra source alpha"
and: [combinationRule ~= 31]]]]]]]]]) ifFalse:
[^interpreterProxy primitiveFail].
stopIndex = 0 ifTrue:
+ [^interpreterProxy pop: 6 "the string is empty; pop args, return rcvr"].
- [interpreterProxy pop: 6. "the string is empty; pop args, return rcvr"].
maxGlyph := (interpreterProxy slotSizeOf: xTable) - 2.
"See if we can go directly into copyLoopPixMap (usually we can)"
quickBlt := destBits ~= 0 "no OS surfaces please"
and:[sourceBits ~= 0 "and again"
and:[noSource = false "needs a source"
and:[sourceForm ~= destForm "no blits onto self"
and:[cmFlags ~= 0
or:[sourceMSB ~= destMSB
or:[sourceDepth ~= destDepth]]]]]]. "no point using slower version"
left := destX.
sourcePtr := interpreterProxy firstIndexableField: sourceString.
startIndex to: stopIndex do:[:charIndex|
ascii := interpreterProxy byteAtPointer: sourcePtr + charIndex - 1.
glyphIndex := interpreterProxy fetchInteger: ascii ofObject: glyphMap.
(glyphIndex < 0 or:[glyphIndex > maxGlyph])
ifTrue:[^interpreterProxy primitiveFail].
sourceX := interpreterProxy fetchInteger: glyphIndex ofObject: xTable.
width := (interpreterProxy fetchInteger: glyphIndex+1 ofObject: xTable) - sourceX.
interpreterProxy failed ifTrue:[^nil].
self clipRange. "Must clip here"
(bbW > 0 and:[bbH > 0]) ifTrue: [
quickBlt ifTrue:[
self destMaskAndPointerInit.
self copyLoopPixMap.
"both, hDir and vDir are known to be > 0"
affectedL := dx.
affectedR := dx + bbW.
affectedT := dy.
affectedB := dy + bbH.
] ifFalse:[self copyBits]].
interpreterProxy failed ifTrue:[^nil].
destX := destX + width + kernDelta.
].
affectedL := left.
self showDisplayBits.
"store destX back"
interpreterProxy storeInteger: BBDestXIndex ofObject: bbObj withValue: destX.
interpreterProxy pop: 6 "pop args, return rcvr"!
More information about the Vm-dev
mailing list