Skip to content

Commit

Permalink
- Removing unused variables
Browse files Browse the repository at this point in the history
- Removing some display functions that are not used anymore
- Removing desiredDisplayExtent
  • Loading branch information
tesonep committed Jul 31, 2023
1 parent 1c3a3ca commit 7c33c35
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 120 deletions.
25 changes: 4 additions & 21 deletions smalltalksrc/VMMaker/BitBltSimulation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,6 @@ BitBltSimulation class >> warpBitsFrom: aBitBlt [
bb setInterpreter: proxy.
proxy success: (bb loadWarpBltFrom: aBitBlt).
bb warpBits.
proxy failed ifFalse:[
proxy showDisplayBits: aBitBlt destForm Left: bb affectedLeft Top: bb affectedTop Right: bb affectedRight Bottom: bb affectedBottom].
^proxy stackValue: 0
]

Expand Down Expand Up @@ -1285,7 +1283,7 @@ BitBltSimulation >> copyBitsFrom: startX to: stopX at: yValue [
sourceX := startX.
width := (stopX - startX).
self copyBits.
self showDisplayBits.

]

{ #category : #setup }
Expand Down Expand Up @@ -1880,7 +1878,6 @@ BitBltSimulation >> drawLoopX: xDelta Y: yDelta [
["If affected rectangle gets large, update it in chunks"
affectedL := affL. affectedR := affR.
affectedT := affT. affectedB := affB.
self showDisplayBits.
affL := affT := 9999. "init null rectangle"
affR := affB := -9999]].
]]]
Expand All @@ -1907,7 +1904,6 @@ BitBltSimulation >> drawLoopX: xDelta Y: yDelta [
["If affected rectangle gets large, update it in chunks"
affectedL := affL. affectedR := affR.
affectedT := affT. affectedB := affB.
self showDisplayBits.
affL := affT := 9999. "init null rectangle"
affR := affB := -9999]].
]]].
Expand Down Expand Up @@ -3005,7 +3001,6 @@ BitBltSimulation >> primitiveCopyBits [
[^interpreterProxy primitiveFail].
self copyBits.
interpreterProxy failed ifTrue: [^nil].
self showDisplayBits.
interpreterProxy failed ifTrue: [^nil].
(combinationRule = 22 or: [combinationRule = 32])
ifTrue: [interpreterProxy methodReturnInteger: bitCount]
Expand Down Expand Up @@ -3089,7 +3084,7 @@ BitBltSimulation >> primitiveDisplayString [
affectedL := left.
quickBlt ifFalse:
[self unlockSurfaces].
self showDisplayBits.

"store destX back"
interpreterProxy storeInteger: BBDestXIndex ofObject: bbObj withValue: destX.
interpreterProxy pop: 6 "pop args, return rcvr"
Expand All @@ -3105,8 +3100,7 @@ BitBltSimulation >> primitiveDrawLoop [
yDelta := interpreterProxy stackIntegerValue: 0.
(self loadBitBltFrom: rcvr) ifFalse:[^interpreterProxy primitiveFail].
interpreterProxy failed ifFalse:[
self drawLoopX: xDelta Y: yDelta.
self showDisplayBits].
self drawLoopX: xDelta Y: yDelta].
interpreterProxy failed ifFalse:[interpreterProxy pop: 2].
]

Expand Down Expand Up @@ -3166,7 +3160,7 @@ BitBltSimulation >> primitiveWarpBits [
ifFalse:[^interpreterProxy primitiveFail].
self warpBits.
interpreterProxy failed ifTrue:[^nil].
self showDisplayBits.

interpreterProxy failed ifTrue:[^nil].
interpreterProxy methodReturnReceiver
]
Expand Down Expand Up @@ -3844,17 +3838,6 @@ BitBltSimulation >> setupColorMasksFrom: srcBits to: targetBits [

]

{ #category : #'interpreter interface' }
BitBltSimulation >> showDisplayBits [
self ensureDestAndSourceFormsAreValid.
interpreterProxy
showDisplayBits: destForm
Left: affectedL
Top: affectedT
Right: affectedR
Bottom: affectedB
]

{ #category : #setup }
BitBltSimulation >> sourceSkewAndPointerInit [
"This is only used when source and dest are same depth,
Expand Down
3 changes: 1 addition & 2 deletions smalltalksrc/VMMaker/CoInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ Class {
'lastUncoggableInterpretedBlockMethod',
'flagInterpretedMethods',
'maxLiteralCountForCompile',
'minBackwardJumpCountForCompile',
'initialMemoryAddress'
'minBackwardJumpCountForCompile'
],
#classVars : [
'HasBeenReturnedFromMCPC',
Expand Down
13 changes: 0 additions & 13 deletions smalltalksrc/VMMaker/CogVMSimulator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -488,14 +488,6 @@ CogVMSimulator >> desiredCogCodeSize: anInteger [
desiredCogCodeSize := anInteger
]

{ #category : #UI }
CogVMSimulator >> desiredDisplayExtent [
^(savedWindowSize
ifNil: [640@480]
ifNotNil: [savedWindowSize >> 16 @ (savedWindowSize bitAnd: 16rFFFF)])
min: Display extent * 2 // 3
]

{ #category : #initialization }
CogVMSimulator >> desiredEdenBytes: anInteger [
desiredEdenBytes := anInteger
Expand Down Expand Up @@ -1879,11 +1871,6 @@ CogVMSimulator >> saneFunctionPointerForFailureOfPrimIndex: primIndex [
^super saneFunctionPointerForFailureOfPrimIndex: primIndex
]

{ #category : #'I/O primitives' }
CogVMSimulator >> savedWindowSize [
^savedWindowSize ifNil: [0]
]

{ #category : #accessing }
CogVMSimulator >> setBreakCount: anInteger [
breakCount := anInteger
Expand Down
5 changes: 2 additions & 3 deletions smalltalksrc/VMMaker/InterpreterPrimitives.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ Class {
'profileProcess',
'profileSemaphore',
'nextProfileTick',
'preemptionYields',
'ffiExceptionResponse'
'preemptionYields'
],
#classVars : [
'CrossedX',
Expand Down Expand Up @@ -267,7 +266,7 @@ InterpreterPrimitives >> initPrimCall [
InterpreterPrimitives >> initialize [

"Here we can initialize the variables C initializes to zero. #initialize methods do /not/ get translated."
argumentCount := primFailCode := nextProfileTick := osErrorCode := exceptionPC := ffiExceptionResponse := 0
argumentCount := primFailCode := nextProfileTick := osErrorCode := exceptionPC := 0
]

{ #category : #'simulation support' }
Expand Down
7 changes: 0 additions & 7 deletions smalltalksrc/VMMaker/InterpreterProxy.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1011,13 +1011,6 @@ InterpreterProxy >> sendInvokeCallbackContext: vmCallbackContext [
self notYetImplemented
]

{ #category : #other }
InterpreterProxy >> showDisplayBits: aForm Left: l Top: t Right: r Bottom: b [
aForm == Display ifTrue:[
Display class isDeferringUpdates ifTrue: [^ nil].
Display forceToScreen: (Rectangle left: l right: r top: t bottom: b)].
]

{ #category : #'callback support' }
InterpreterProxy >> signalNoResume: aSemaphore [
^self notYetImplementedError
Expand Down
7 changes: 0 additions & 7 deletions smalltalksrc/VMMaker/SpurMemoryManager.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11833,13 +11833,6 @@ SpurMemoryManager >> shouldRemapOop: oop [
and: [self shouldRemapObj: oop]
]

{ #category : #'simulation only' }
SpurMemoryManager >> showDisplayBits: aForm Left: l Top: t Right: r Bottom: b [
"hack around the CoInterpreter/ObjectMemory split refactoring"
<doNotGenerate>
^coInterpreter showDisplayBits: aForm Left: l Top: t Right: r Bottom: b
]

{ #category : #'free space' }
SpurMemoryManager >> shrinkThreshold [
^shrinkThreshold
Expand Down
55 changes: 1 addition & 54 deletions smalltalksrc/VMMaker/StackInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,7 @@ Class {
'nextWakeupUsecs',
'nextPollUsecs',
'interruptPending',
'savedWindowSize',
'imageHeaderFlags',
'fullScreenFlag',
'extraVMMemory',
'interpreterProxy',
'primitiveTable',
Expand All @@ -359,7 +357,6 @@ Class {
'classNameIndex',
'thisClassIndex',
'metaclassNumSlots',
'interruptCheckChain',
'suppressHeartbeatFlag',
'breakSelector',
'breakSelectorLength',
Expand All @@ -376,17 +373,12 @@ Class {
'tempOop2',
'metaAccessorDepth',
'theUnknownShort',
'the2ndUnknownShort',
'imageFloatsBigEndian',
'maxExtSemTabSizeSet',
'lastMethodCacheProbeWrite',
'gcSemaphoreIndex',
'classByteArrayCompactIndex',
'checkedPluginName',
'displayBits',
'displayWidth',
'displayHeight',
'displayDepth',
'statForceInterruptCheck',
'statStackOverflow',
'statStackPageDivorce',
Expand All @@ -401,7 +393,6 @@ Class {
'maxStackMessagePrinted',
'libFFI',
'codeGeneratorToComputeAccessorDepth',
'showSurfaceFn',
'imageReader',
'imageWriter',
'pendingFinalizationSignals',
Expand Down Expand Up @@ -578,9 +569,7 @@ If ffi is put as a separate header, slang will sort the header and put it outsid
type: 'signed char'
sizeString: 'MaxPrimitiveIndex + 2 /* ', (MaxPrimitiveIndex + 2) printString, ' */'
array: vmClass primitiveAccessorDepthTable.
aCCodeGenerator
var: #displayBits type: #'void *'.
self declareC: #(displayWidth displayHeight displayDepth) as: #int in: aCCodeGenerator.

aCCodeGenerator
var: #primitiveFunctionPointer
declareC: 'void (*primitiveFunctionPointer)()';
Expand Down Expand Up @@ -4974,12 +4963,6 @@ StackInterpreter >> dispatchFunctionPointer: aFunctionPointer [

]

{ #category : #simulation }
StackInterpreter >> displayBits [
<doNotGenerate>
^displayBits
]

{ #category : #'frame access' }
StackInterpreter >> divorceAllFrames [
| activeContext |
Expand Down Expand Up @@ -7022,11 +7005,6 @@ StackInterpreter >> getExtraVMMemory [
^ extraVMMemory
]

{ #category : #'plugin primitive support' }
StackInterpreter >> getFullScreenFlag [
^fullScreenFlag
]

{ #category : #'object memory support' }
StackInterpreter >> getGCMode [
"This is a no-op in the StackVM"
Expand Down Expand Up @@ -7536,7 +7514,6 @@ StackInterpreter >> initialize [
nextWakeupUsecs := 0.
tempOop := tempOop2 := theUnknownShort := 0.
maxStacksToPrint := 0.
displayBits := displayWidth := displayHeight := displayDepth := 0.
pendingFinalizationSignals := 0.
globalSessionID := 0.
jmpDepth := 0.
Expand Down Expand Up @@ -14036,12 +14013,6 @@ StackInterpreter >> shortUnconditionalJump [
self jump: (currentBytecode bitAnd: 7) + 1.
]

{ #category : #'I/O primitive support' }
StackInterpreter >> showDisplayBits: aForm Left: l Top: t Right: r Bottom: b [
"Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object."
self updateDisplayLeft: l Top: t Right: r Bottom: b
]

{ #category : #'send bytecodes' }
StackInterpreter >> shuffleArgumentsAndStoreAbsentReceiver: theReceiver [
"For the absent receiver sends move the arguments up the stack and store the supplied receiver."
Expand Down Expand Up @@ -15734,30 +15705,6 @@ StackInterpreter >> unknownShortOrCodeSizeInKs [
^theUnknownShort
]

{ #category : #'I/O primitive support' }
StackInterpreter >> updateDisplayLeft: l Top: t Right: r Bottom: b [
"Repaint the portion of the Smalltalk screen bounded by the affected rectangle.
Used to synchronize the screen after a Bitblt to the Smalltalk Display object."
| left right top bottom surfaceHandle |
left := l max: 0.
right := r min: displayWidth.
top := t max: 0.
bottom := b min: displayHeight.
(left <= right and: [top <= bottom]) ifFalse: [^nil].
(objectMemory isIntegerObject: displayBits asInteger)
ifTrue:
[surfaceHandle := objectMemory integerValueOf: displayBits asInteger.
showSurfaceFn = 0 ifTrue:
[showSurfaceFn := self ioLoadFunction: 'ioShowSurface' From: 'SurfacePlugin'.
showSurfaceFn = 0 ifTrue: [^self primitiveFailFor: PrimErrNotFound]].
self show: surfaceHandle Sur: left fa: top ce: right - left Fn: bottom - top]
ifFalse:
[self assert: (objectMemory isNonImmediate: displayBits asInteger).
self ioShow: displayBits asInteger
D: displayWidth i: displayHeight s: displayDepth
p: left l: right a: top y: bottom]
]

{ #category : #'image save/restore' }
StackInterpreter >> updateObjectsPostByteSwap [

Expand Down
13 changes: 0 additions & 13 deletions smalltalksrc/VMMaker/StackInterpreterSimulator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,6 @@ StackInterpreterSimulator >> currentBytecode: anInteger [
currentBytecode := anInteger
]

{ #category : #UI }
StackInterpreterSimulator >> desiredDisplayExtent [
^(savedWindowSize
ifNil: [640@480]
ifNotNil: [savedWindowSize >> 16 @ (savedWindowSize bitAnd: 16rFFFF)])
min: Display extent * 2 // 3
]

{ #category : #initialization }
StackInterpreterSimulator >> desiredEdenBytes: anInteger [
desiredEdenBytes := anInteger
Expand Down Expand Up @@ -1546,11 +1538,6 @@ StackInterpreterSimulator >> runForNBytes: nBytecodes [
"undo the pre-increment of IP before returning"
]

{ #category : #'I/O primitives' }
StackInterpreterSimulator >> savedWindowSize [
^savedWindowSize ifNil: [0]
]

{ #category : #accessing }
StackInterpreterSimulator >> setBreakCount: anInteger [
breakCount := anInteger
Expand Down

0 comments on commit 7c33c35

Please sign in to comment.