Ronie Salgado Faila uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-rsf.2185.mcz ==================== Summary ==================== Name: VMMaker.oscog-rsf.2185 Author: rsf Time: 26 March 2017, 3:49:52.367206 pm UUID: 3c227ed5-3dbc-4b48-9de0-38a0978593f8 Ancestors: VMMaker.oscog-eem.2184 Fixing the Lowcode compilation bug. I still have to fix another bug with the new register allocation used with Lowcode. =============== Diff against VMMaker.oscog-eem.2184 =============== Item was changed: ----- Method: CogBytecodeFixup class>>instVarNamesAndTypesForTranslationDo: (in category 'translation') ----- instVarNamesAndTypesForTranslationDo: aBinaryBlock "Enumerate aBinaryBlock with the names and C type strings for the inst vars to include in a BytecodeFixup struct." "self withAllSubclasses collect: [:ea| ea typedef]" self filteredInstVarNames do: [:ivn| aBinaryBlock value: ivn value: (ivn first ~= $# ifTrue: [ivn caseOf: { ['targetInstruction'] -> [#'AbstractInstruction *']. ['mergeSimStack'] -> [#'SimStackEntry *']. ['instructionIndex'] -> [#'unsigned short']. ['simStackPtr'] -> [#char]. + ['simNativeStackPtr'] -> [#'short']. - ['simNativeStackPtr'] -> [#'unsigned short']. ['simNativeStackSize'] -> [#'unsigned short']. ['isReceiverResultRegSelf'] -> [#char] }])]! Item was changed: ----- Method: CogSimStackNativeEntry>>nativeRegisterOrNone (in category 'accessing') ----- nativeRegisterOrNone + ^(type = SSNativeRegister or: [type = SSRegisterPair]) - ^(type = SSRegister or: [type = SSRegisterPair]) ifTrue: [register] ifFalse: [NoReg]! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeFloat2ResultInteger: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeFloat2ResultInteger: aBlock <option: #LowcodeVM> <inline: true> | frNext frTop topRegistersMask rResult | topRegistersMask := 0. frTop := frNext := NoReg. rResult := NoReg. self ssNativeTop nativeFloatRegisterOrNone ~= NoReg ifTrue: [ frTop := self ssNativeTop nativeFloatRegisterOrNone]. (self ssNativeValue: 1) nativeFloatRegisterOrNone ~= NoReg ifTrue: [ topRegistersMask := self registerMaskFor: (frNext := (self ssNativeValue: 1) nativeFloatRegisterOrNone)]. frTop = NoReg ifTrue: [ frTop := self allocateFloatRegNotConflictingWith: topRegistersMask ]. frNext = NoReg ifTrue: [ frNext := self allocateFloatRegNotConflictingWith: (self registerMaskFor: frTop) ]. "Result" rResult := self allocateRegNotConflictingWith: 0. + self deny: (frTop = NoReg or: [frNext = NoReg or: [rResult = NoReg]]). - self deny: (frTop = NoReg or: [frNext = NoReg or: [rResult]]). ^ aBlock value: frTop value: frNext value: rResult ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger2ResultFloat: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger2ResultFloat: aBlock <option: #LowcodeVM> <inline: true> | rNext rTop topRegistersMask frResult | topRegistersMask := 0. rTop := rNext := NoReg. + frResult := NoReg. - frResult := NoReg self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: 1) nativeRegisterOrNone ~= NoReg ifTrue: [ topRegistersMask := self registerMaskFor: (rNext := (self ssNativeValue: 1) nativeRegisterOrNone)]. ]. rTop = NoReg ifTrue: [ rTop := self allocateRegNotConflictingWith: topRegistersMask ]. rNext = NoReg ifTrue: [ rNext := self allocateRegNotConflictingWith: (self registerMaskFor: rTop) ]. "Results" frResult := self allocateFloatRegNotConflictingWith: self emptyRegisterMask. self deny: (rTop = NoReg or: [rNext = NoReg or: [frResult = NoReg]]). ^ aBlock value: rTop value: rNext value: frResult! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger2ResultInteger2: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger2ResultInteger2: aBlock <option: #LowcodeVM> <inline: true> | rNext rTop topRegistersMask rResult rResult2 | topRegistersMask := 0. rTop := rNext := NoReg. + rResult := rResult2 := NoReg. - rResult := rResult2 := NoReg self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: 1) nativeRegisterOrNone ~= NoReg ifTrue: [ topRegistersMask := self registerMaskFor: (rNext := (self ssNativeValue: 1) nativeRegisterOrNone)]. ]. rTop = NoReg ifTrue: [ rTop := self allocateRegNotConflictingWith: topRegistersMask ]. rNext = NoReg ifTrue: [ rNext := self allocateRegNotConflictingWith: (self registerMaskFor: rTop) ]. self deny: (rTop = NoReg or: [rNext = NoReg]). "Results" rResult := self allocateFloatRegNotConflictingWith: (self registerMaskFor: rTop and: rNext). rResult2 := self allocateFloatRegNotConflictingWith: (self registerMaskFor: rTop and: rNext and: rResult). self deny: (rResult = NoReg or: [rResult2 = NoReg]). ^ aBlock value: rTop value: rNext value: rResult value: rResult2! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger2ResultInteger: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger2ResultInteger: aBlock <option: #LowcodeVM> <inline: true> | rNext rTop topRegistersMask rResult | topRegistersMask := 0. rTop := rNext := NoReg. + rResult := NoReg. - rResult := NoReg self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: 1) nativeRegisterOrNone ~= NoReg ifTrue: [ topRegistersMask := self registerMaskFor: (rNext := (self ssNativeValue: 1) nativeRegisterOrNone)]. ]. rTop = NoReg ifTrue: [ rTop := self allocateRegNotConflictingWith: topRegistersMask ]. rNext = NoReg ifTrue: [ rNext := self allocateRegNotConflictingWith: (self registerMaskFor: rTop) ]. self deny: (rTop = NoReg or: [rNext = NoReg]). "Results" rResult := self allocateFloatRegNotConflictingWith: (self registerMaskFor: rTop and: rNext). self deny: (rResult = NoReg). ^ aBlock value: rTop value: rNext value: rResult! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger2ResultOop: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger2ResultOop: aBlock <option: #LowcodeVM> <inline: true> | rNext rTop topRegistersMask rResult | topRegistersMask := 0. rTop := rNext := NoReg. + rResult := NoReg. - rResult := NoReg self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: 1) nativeRegisterOrNone ~= NoReg ifTrue: [ topRegistersMask := self registerMaskFor: (rNext := (self ssNativeValue: 1) nativeRegisterOrNone)]. ]. rTop = NoReg ifTrue: [ rTop := self allocateRegNotConflictingWith: topRegistersMask ]. rNext = NoReg ifTrue: [ rNext := self allocateRegNotConflictingWith: (self registerMaskFor: rTop) ]. self deny: (rTop = NoReg or: [rNext = NoReg]). "Results" rResult := self allocateFloatRegNotConflictingWith: (self registerMaskFor: rTop and: rNext). self deny: (rResult = NoReg). ^ aBlock value: rTop value: rNext value: rResult! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger3: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger3: aBlock <option: #LowcodeVM> <inline: true> + | rNext rNextNext nativeValueIndex rTop nextRegisterMask | - | rNext rNextNext nativeValueIndex rTop registerMask | rTop := rNext := rNextNext := NoReg. nativeValueIndex := 1. self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone. ]. nativeValueIndex := nativeValueIndex + 1 ]. ]. rNextNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. ]. ]. rTop = NoReg ifTrue: [ + nextRegisterMask := 0. + rNext ~= NoReg ifTrue: [ nextRegisterMask := self registerMaskFor: rNext]. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rTop := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := 0. - rNext ~= NoReg ifTrue: [ registerMask := self registerMaskFor: rNext]. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rTop := self allocateRegNotConflictingWith: registerMask ]. rNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rNext := self allocateRegNotConflictingWith: registerMask ]. rNextNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop and: rNext. + rNextNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop and: rNext. - rNextNext := self allocateRegNotConflictingWith: registerMask ]. self deny: (rTop = NoReg or: [rNext = NoReg or: [rNextNext = NoReg]]). ^ aBlock value: rTop value: rNext value: rNextNext ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger3ResultInteger: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger3ResultInteger: aBlock <option: #LowcodeVM> <inline: true> + | rNext rNextNext rResult nativeValueIndex rTop nextRegisterMask | - | rNext rNextNext rResult nativeValueIndex rTop registerMask | rTop := rNext := rNextNext := NoReg. nativeValueIndex := 1. self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone. ]. nativeValueIndex := nativeValueIndex + 1 ]. ]. rNextNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. ]. ]. rTop = NoReg ifTrue: [ + nextRegisterMask := 0. + rNext ~= NoReg ifTrue: [ nextRegisterMask := self registerMaskFor: rNext]. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rTop := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := 0. - rNext ~= NoReg ifTrue: [ registerMask := self registerMaskFor: rNext]. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rTop := self allocateRegNotConflictingWith: registerMask ]. rNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rNext := self allocateRegNotConflictingWith: registerMask ]. rNextNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop and: rNext. + rNextNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop and: rNext. - rNextNext := self allocateRegNotConflictingWith: registerMask ]. self deny: (rTop = NoReg or: [rNext = NoReg or: [rNextNext = NoReg]]). "Allocate the result" rResult := self allocateRegNotConflictingWith: (self registerMaskFor: rTop and: rNext and: rNextNext). self deny: (rResult = NoReg). ^ aBlock value: rTop value: rNext value: rNextNext value: rResult ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger4: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger4: aBlock <option: #LowcodeVM> <inline: true> + | rNext rNextNext rNextNextNext nativeValueIndex rTop nextRegisterMask | - | rNext rNextNext rNextNextNext nativeValueIndex rTop registerMask | rTop := rNext := rNextNext := rNextNextNext := NoReg. nativeValueIndex := 1. self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. ]. nativeValueIndex := nativeValueIndex + 1 ]. ]. rNextNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNextNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone. ]. nativeValueIndex := nativeValueIndex + 1 ]. ]. rNextNextNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNextNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. nativeValueIndex := nativeValueIndex + 1 ]. ]. rTop = NoReg ifTrue: [ + nextRegisterMask := 0. + rNext ~= NoReg ifTrue: [ nextRegisterMask := self registerMaskFor: rNext]. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rTop := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := 0. - rNext ~= NoReg ifTrue: [ registerMask := self registerMaskFor: rNext]. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rTop := self allocateRegNotConflictingWith: registerMask ]. rNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rNext := self allocateRegNotConflictingWith: registerMask ]. rNextNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop and: rNext. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rNextNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop and: rNext. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rNextNext := self allocateRegNotConflictingWith: registerMask ]. rNextNextNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop and: rNext and: rNextNext. + rNextNextNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop and: rNext and: rNextNext. - rNextNextNext := self allocateRegNotConflictingWith: registerMask ]. self deny: (rTop = NoReg or: [rNext = NoReg or: [rNextNext = NoReg or: [rNextNextNext = NoReg]]]). ^ aBlock value: rTop value: rNext value: rNextNext value: rNextNextNext ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger4ResultInteger2: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger4ResultInteger2: aBlock <option: #LowcodeVM> <inline: true> + | rNext rNextNext rNextNextNext nativeValueIndex rTop nextRegisterMask rResult rResult2 | - | rNext rNextNext rNextNextNext nativeValueIndex rTop registerMask rResult rResult2 | rTop := rNext := rNextNext := rNextNextNext := NoReg. rResult := rResult2 := NoReg. nativeValueIndex := 1. self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. ]. nativeValueIndex := nativeValueIndex + 1 ]. ]. rNextNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNextNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone. ]. nativeValueIndex := nativeValueIndex + 1 ]. ]. rNextNextNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNextNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. nativeValueIndex := nativeValueIndex + 1 ]. ]. rTop = NoReg ifTrue: [ + nextRegisterMask := 0. + rNext ~= NoReg ifTrue: [ nextRegisterMask := self registerMaskFor: rNext]. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rTop := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := 0. - rNext ~= NoReg ifTrue: [ registerMask := self registerMaskFor: rNext]. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rTop := self allocateRegNotConflictingWith: registerMask ]. rNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rNext := self allocateRegNotConflictingWith: registerMask ]. rNextNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop and: rNext. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rNextNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop and: rNext. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rNextNext := self allocateRegNotConflictingWith: registerMask ]. rNextNextNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop and: rNext and: rNextNext. + rNextNextNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop and: rNext and: rNextNext. - rNextNextNext := self allocateRegNotConflictingWith: registerMask ]. self deny: (rTop = NoReg or: [rNext = NoReg or: [rNextNext = NoReg or: [rNextNextNext = NoReg]]]). "Result registers" rResult := self allocateRegNotConflictingWith: (self registerMaskFor: rTop and: rNext and: rNextNext and: rNextNextNext). rResult2 := self allocateRegNotConflictingWith: (self registerMaskFor: rTop and: rNext and: rNextNext and: rNextNextNext and: rResult). ^ aBlock value: rTop value: rNext value: rNextNext value: rNextNextNext value: rResult value: rResult2 ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeInteger4ResultInteger: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeInteger4ResultInteger: aBlock <option: #LowcodeVM> <inline: true> + | rNext rNextNext rNextNextNext nativeValueIndex rTop nextRegisterMask rResult | - | rNext rNextNext rNextNextNext nativeValueIndex rTop registerMask rResult | rTop := rNext := rNextNext := rNextNextNext := NoReg. rResult := NoReg. nativeValueIndex := 1. self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. self ssNativeTop nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNext := self ssNativeTop nativeRegisterSecondOrNone] ]. rNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. ]. nativeValueIndex := nativeValueIndex + 1 ]. ]. rNextNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone ~= NoReg ifTrue: [ rNextNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterSecondOrNone. ]. nativeValueIndex := nativeValueIndex + 1 ]. ]. rNextNextNext = NoReg ifTrue: [ (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone ~= NoReg ifTrue: [ rNextNextNext := (self ssNativeValue: nativeValueIndex) nativeRegisterOrNone. nativeValueIndex := nativeValueIndex + 1 ]. ]. rTop = NoReg ifTrue: [ + nextRegisterMask := 0. + rNext ~= NoReg ifTrue: [ nextRegisterMask := self registerMaskFor: rNext]. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rTop := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := 0. - rNext ~= NoReg ifTrue: [ registerMask := self registerMaskFor: rNext]. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rTop := self allocateRegNotConflictingWith: registerMask ]. rNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop. + rNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNext)]. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop. - rNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNext)]. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rNext := self allocateRegNotConflictingWith: registerMask ]. rNextNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop and: rNext. + rNextNextNext ~= NoReg ifTrue: [ nextRegisterMask := nextRegisterMask bitOr: (self registerMaskFor: rNextNextNext)]. + rNextNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop and: rNext. - rNextNextNext ~= NoReg ifTrue: [ registerMask := registerMask bitOr: (self registerMaskFor: rNextNextNext)]. - rNextNext := self allocateRegNotConflictingWith: registerMask ]. rNextNextNext = NoReg ifTrue: [ + nextRegisterMask := self registerMaskFor: rTop and: rNext and: rNextNext. + rNextNextNext := self allocateRegNotConflictingWith: nextRegisterMask - registerMask := self registerMaskFor: rTop and: rNext and: rNextNext. - rNextNextNext := self allocateRegNotConflictingWith: registerMask ]. self deny: (rTop = NoReg or: [rNext = NoReg or: [rNextNext = NoReg or: [rNextNextNext = NoReg]]]). "Result registers" rResult := self allocateRegNotConflictingWith: (self registerMaskFor: rTop and: rNext and: rNextNext and: rNextNextNext). ^ aBlock value: rTop value: rNext value: rNextNext value: rNextNextNext value: rResult ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeIntegerResultFloat: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeIntegerResultFloat: aBlock <option: #LowcodeVM> <inline: true> | rTop frResult| rTop := NoReg. + frResult := NoReg. - frResult := NoReg self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. ]. rTop = NoReg ifTrue: [ rTop := self allocateRegNotConflictingWith: self emptyRegisterMask]. frResult := self allocateFloatRegNotConflictingWith: self emptyRegisterMask. self deny: (rTop = NoReg or: [frResult = NoReg]). ^ aBlock value: rTop value: frResult ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeIntegerResultInteger2: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeIntegerResultInteger2: aBlock <option: #LowcodeVM> <inline: true> | rTop rResult rResult2 | rTop := NoReg. + rResult := rResult := NoReg. - rResult := rResult := NoReg self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. ]. rTop = NoReg ifTrue: [ rTop := self allocateRegNotConflictingWith: self emptyRegisterMask]. rResult := self allocateRegNotConflictingWith: (self registerMaskFor: rTop). rResult2 := self allocateRegNotConflictingWith: (self registerMaskFor: rTop and: rResult). self deny: (rTop = NoReg or: [rResult = NoReg or: [rResult2 = NoReg]]). ^ aBlock value: rTop value: rResult value: rResult2 ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeIntegerResultInteger: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeIntegerResultInteger: aBlock <option: #LowcodeVM> <inline: true> | rTop rResult| rTop := NoReg. + rResult := NoReg. - rResult := NoReg self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. ]. rTop = NoReg ifTrue: [ rTop := self allocateRegNotConflictingWith: self emptyRegisterMask]. rResult := self allocateRegNotConflictingWith: (self registerMaskFor: rTop). self deny: (rTop = NoReg or: [rResult = NoReg]). ^ aBlock value: rTop value: rResult ! Item was changed: ----- Method: StackToRegisterMappingCogit>>allocateRegistersForLowcodeIntegerResultOop: (in category 'inline primitive register allocation') ----- allocateRegistersForLowcodeIntegerResultOop: aBlock <option: #LowcodeVM> <inline: true> | rTop rResult| rTop := NoReg. + rResult := NoReg. - rResult := NoReg self ssNativeTop nativeRegisterOrNone ~= NoReg ifTrue: [ rTop := self ssNativeTop nativeRegisterOrNone. ]. rTop = NoReg ifTrue: [ rTop := self allocateRegNotConflictingWith: self emptyRegisterMask]. rResult := self allocateRegNotConflictingWith: (self registerMaskFor: rTop). self deny: (rTop = NoReg or: [rResult = NoReg]). ^ aBlock value: rTop value: rResult ! Item was changed: ----- Method: StackToRegisterMappingCogit>>ssNativeTop (in category 'simulation stack') ----- ssNativeTop <option: #LowcodeVM> + <inline: true> <returnTypeC: #'CogSimStackNativeEntry *'> self assert: simNativeStackPtr >= 0. ^self simNativeStackAt: simNativeStackPtr! Item was changed: ----- Method: StackToRegisterMappingCogit>>ssNativeValue: (in category 'simulation stack') ----- ssNativeValue: n <returnTypeC: #'CogSimStackNativeEntry *'> <option: #LowcodeVM> + ^self simNativeStackAt: simNativeStackPtr - n! - ^self simNativeStackAt: simStackPtr - n! |
Free forum by Nabble | Edit this page |