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

commits at source.squeak.org commits at source.squeak.org
Thu Nov 21 22:51:45 UTC 2019


Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-nice.2587.mcz

==================== Summary ====================

Name: VMMaker.oscog-nice.2587
Author: nice
Time: 21 November 2019, 11:50:39.765774 pm
UUID: 0f96b8ad-4155-4a08-93e1-66bd1fcfff72
Ancestors: VMMaker.oscog-eem.2586

Attempt to fix https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/447

if dx dy sx sy are declared int but initialized with usqInt destX etc..., then occurrence of integer overflow might occur, and do occur.

These variables must be signed in order to perform correct arithmetic, but as large as the original sourceX destX etc..., thus sqInt

=============== Diff against VMMaker.oscog-eem.2586 ===============

Item was changed:
  ----- Method: BitBltSimulation class>>declareCVarsIn: (in category 'translation') -----
  declareCVarsIn: aCCodeGenerator
  
  	"add option of  fast path BitBLT code header"
  	aCCodeGenerator
  		addHeaderFile:'"sqAssert.h"';
  		addHeaderFile:'#ifdef ENABLE_FAST_BLT
  #include "BitBltDispatch.h"
  #else
  // to handle the unavoidable decl in the spec of copyBitsFallback();
  #define operation_t void
  #endif'.
  		
  	aCCodeGenerator var: 'opTable'
  		declareC: 'void *opTable[' , OpTableSize printString , ']'.
  	aCCodeGenerator var: 'maskTable'
  		declareC:'int maskTable[33] = {
  0, 1, 3, 0, 15, 31, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 65535,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1
  }'.
  	aCCodeGenerator var: 'ditherMatrix4x4'
  		declareC:'const int ditherMatrix4x4[16] = {
  0,	8,	2,	10,
  12,	4,	14,	6,
  3,	11,	1,	9,
  15,	7,	13,	5
  }'.
  	aCCodeGenerator var: 'ditherThresholds16'
  		declareC:'const int ditherThresholds16[8] = { 0, 2, 4, 6, 8, 12, 14, 16 }'.
  	aCCodeGenerator var: 'ditherValues16'
  		declareC:'const int ditherValues16[32] = {
  0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
  }'.
  
  	aCCodeGenerator var: 'warpBitShiftTable'
  		declareC:'int warpBitShiftTable[32]'.
  
  	aCCodeGenerator var:'cmShiftTable' 
  		type:'int *'.
  	aCCodeGenerator var:'cmMaskTable' 
  		type:'unsigned int *'.
  	aCCodeGenerator var:'cmLookupTable' 
  		type:'unsigned int *'.
  
  	aCCodeGenerator var: 'dither8Lookup'
  		declareC:' unsigned char dither8Lookup[4096]'.
  
  	aCCodeGenerator var:'ungammaLookupTable' 
  		type: 'unsigned char *'.
  	aCCodeGenerator var:'gammaLookupTable' 
  		type: 'unsigned char *'.
  
  	aCCodeGenerator
  		var: 'querySurfaceFn' declareC: 'int (*querySurfaceFn)(sqIntptr_t, int*, int*, int*, int*)';
  		var: 'lockSurfaceFn' declareC: 'sqIntptr_t (*lockSurfaceFn)(sqIntptr_t, int*, int, int, int, int)';
  		var: 'unlockSurfaceFn' declareC: 'int (*unlockSurfaceFn)(sqIntptr_t, int, int, int, int)'.
  	
+ 	#(sourcePitch sourceWidth sourceHeight sourceDepth sourceMSB
+ 		destPitch destWidth destHeight destDepth destMSB bbW bbH)
- 	#(sourcePitch sourceWidth sourceHeight sourceDepth sourceMSB sx sy
- 		destPitch destWidth destHeight destDepth destMSB dx dy bbW bbH)
  		do: [:ivar | aCCodeGenerator var: ivar type: #int].
  
+ 	#(dx dy sx sy) do:
+ 		[:ivar| aCCodeGenerator var: ivar type: #sqInt].
+ 	
  	#('sourceIndex' 'destIndex' 'endOfDestination' 'endOfSource') do:
  		[:ivar| aCCodeGenerator var: ivar type: #usqInt]!



More information about the Vm-dev mailing list