Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CogVM source as per VMMaker.oscog-eem.2211
StackInterpreter: Simplify and make robust display bitmap access for display update. The old code required platforms that needed to redraw at arbitrary times to have to access the display bits through interpreterProxy->displayObject, decoding it each time. There exists a small window during compaction, etc, during whiuch such access will fail and cause a VM crash. The new code provides four variables to reference the display, displayBits, displayWidth, displayHeight and displayDepth, which are assigned appropriately in the primitiveBeDisplay primitive. After a GC the interpreter checks if the displayBits have changed location and if so calls ioNoteDisplayChanged:width:height:depth: (ioNoteDisplayChangedwidthheightdepth) to inform the platform of the change (currently all platforms implement this as a null function). On Spur the primitiveBeDIsplay primitive also pins the display bits. This scheme allows displayBitsOf:Left:Top:Right:Bottom: to be simplified to updateDisplayLeft:Top:Right:Bottom:. On Mac OS X and X11, replace access to the display Dits via displayObject with direct access to displayBits, displayWidth, displayHeight and displayDepth vars. Spur: Fix cloneInOldSpaceForPinning: to handle failed allocations correctly. Have pinObject: only clone an old space object that is 1Mb or less, simply pinning larger objects (whioch would include the display bitmap) where it sits. Lift the limits on Spur image segments. There is now no limit on the number of objects in a segment, but the classes in the segment must occupy no more than 2 ^ 21 bytes (maxIdentityHash / 2 * 8 - which allows for about 1.4 million 11 slot classes), and the segment can have no more than 2 ^ 21 out pointers (again maxIdentityHash / 2. Tested for simple examples. Manages to export a project but not load it yet. Fail if the segment store args that are mutated are either immutable or pinned. Fix bad bug in shorten:toIndexableSize: (which could affect Scorch/Sista). The old code for addressAfter: would be fooled by an object with overflow slows but fewer slots than numSlotsMask. So fix addressAfter: so it will still add the overflow header if there is one. Rewrite objectBytesForSlots: to follow the fixed addressAfter:. The code should be cleaner. Fix checkInterpreterIntegrity in the case of the primitiveDoPrimtiive code setting newMethod to an integer. Fix some translation-timer warnings by tweaking storeLiteralVariable:withValue:, storePointerImmutabilityCheck:ofObject:withValue: & primitiveGetenv.
- Loading branch information