ClementBera uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-cb.1912.mcz
==================== Summary ====================
Name: VMMaker.oscog-cb.1912 Author: cb Time: 28 July 2016, 11:10:23.800381 am UUID: 43b9cbdf-2d05-4102-82c8-65b20fba0017 Ancestors: VMMaker.oscog-cb.1911
Fixed a register spill for remote inst var access. Improved error code returns
=============== Diff against VMMaker.oscog-cb.1911 ===============
Item was changed: ----- Method: StackToRegisterMappingCogit>>genGenericStorePop:MaybeContextSlotIndex:needsStoreCheck:needsRestoreRcvr:needsImmutabilityCheck: (in category 'bytecode generator stores') ----- genGenericStorePop: popBoolean MaybeContextSlotIndex: slotIndex needsStoreCheck: needsStoreCheck needsRestoreRcvr: needsRestoreReceiver needsImmutabilityCheck: needsImmCheck "Generates a store into an object that *may* be a context. Multiple settings: - needsStoreCheck (young into old object check) - needRestoreRcvr (ensures the recevier is live across the store) - needsImmCheck (do the call-back if the receiver is immutable)" <inline: true> | jmpSingle jmpDone | <var: #jmpSingle type: #'AbstractInstruction *'> <var: #jmpDone type: #'AbstractInstruction *'> "The reason we need a frame here is that assigning to an inst var of a context may involve wholesale reorganization of stack pages, and the only way to preserve the execution state of an activation in that case is if it has a frame." "Context stores do not require Imm checks as contexts can't be immutable" self assert: needsFrame. self ssPop: 1. self ssAllocateCallReg: ClassReg and: SendNumArgsReg. "for ceStoreContextInstVarTrampoline" self ssPush: 1. objectRepresentation genLoadSlot: SenderIndex sourceReg: ReceiverResultReg destReg: TempReg. self ssStoreAndReplacePop: popBoolean toReg: ClassReg. jmpSingle := objectRepresentation genJumpNotSmallIntegerInScratchReg: TempReg. self MoveCq: slotIndex R: SendNumArgsReg. self CallRT: ceStoreContextInstVarTrampoline. jmpDone := self Jump: 0. jmpSingle jmpTarget: self Label. (IMMUTABILITY and: [needsImmCheck]) ifTrue: [objectRepresentation genStoreWithImmutabilityCheckSourceReg: ClassReg slotIndex: slotIndex destReg: ReceiverResultReg scratchReg: TempReg needsStoreCheck: needsStoreCheck + needRestoreRcvr: needsRestoreReceiver] - needRestoreRcvr: true] ifFalse: [objectRepresentation genStoreSourceReg: ClassReg slotIndex: slotIndex destReg: ReceiverResultReg scratchReg: TempReg inFrame: true needsStoreCheck: needsStoreCheck]. jmpDone jmpTarget: self Label. ^0!
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:LiteralVariable: (in category 'bytecode generator stores') ----- genStorePop: popBoolean LiteralVariable: litVarIndex + <inline: true> - <inline: false> ^self genStorePop: popBoolean LiteralVariable: litVarIndex needsStoreCheck: self ssTopNeedsStoreCheck needsImmutabilityCheck: true "The generic store checks for IMMUTABILITY flag" !
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:LiteralVariable:needsStoreCheck:needsImmutabilityCheck: (in category 'bytecode generator stores') ----- genStorePop: popBoolean LiteralVariable: litVarIndex needsStoreCheck: needsStoreCheck needsImmutabilityCheck: needsImmCheck <inline: false> "We need a frame because the association has to be in ReceiverResultReg for the various trampolines and ReceiverResultReg holds only the receiver in frameless methods." self assert: needsFrame. self genLoadLiteralVariable: litVarIndex in: ReceiverResultReg. + ^self - self genGenericStorePop: popBoolean slotIndex: ValueIndex destReg: ReceiverResultReg needsStoreCheck: needsStoreCheck needsRestoreRcvr: false + needsImmutabilityCheck: needsImmCheck - needsImmutabilityCheck: needsImmCheck. - ^ 0 !
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:MaybeContextReceiverVariable: (in category 'bytecode generator stores') ----- genStorePop: popBoolean MaybeContextReceiverVariable: slotIndex + <inline: true> - <inline: false> ^self genStorePop: popBoolean MaybeContextReceiverVariable: slotIndex needsStoreCheck: self ssTopNeedsStoreCheck needsImmutabilityCheck: true "The generic store checks for IMMUTABILITY flag"!
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:MaybeContextReceiverVariable:needsStoreCheck:needsImmutabilityCheck: (in category 'bytecode generator stores') ----- genStorePop: popBoolean MaybeContextReceiverVariable: slotIndex needsStoreCheck: needsStoreCheck needsImmutabilityCheck: needsImmCheck <inline: false> "The reason we need a frame here is that assigning to an inst var of a context may involve wholesale reorganization of stack pages, and the only way to preserve the execution state of an activation in that case is if it has a frame." self assert: needsFrame. self ssFlushUpThroughReceiverVariable: slotIndex. self ensureReceiverResultRegContainsSelf. + ^self - self genGenericStorePop: popBoolean MaybeContextSlotIndex: slotIndex needsStoreCheck: needsStoreCheck needsRestoreRcvr: true + needsImmutabilityCheck: needsImmCheck! - needsImmutabilityCheck: needsImmCheck. - ^ 0!
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:MaybeContextRemoteInstVar:ofObjectAt:needsStoreCheck:needsImmutabilityCheck: (in category 'bytecode generator stores') ----- genStorePop: popBoolean MaybeContextRemoteInstVar: slotIndex ofObjectAt: objectIndex needsStoreCheck: needsStoreCheck needsImmutabilityCheck: needsImmCheck <inline: false> "The reason we need a frame here is that assigning to an inst var of a context may involve wholesale reorganization of stack pages, and the only way to preserve the execution state of an activation in that case is if it has a frame." self assert: needsFrame. self genLoadTemp: objectIndex in: ReceiverResultReg. + ^self - self genGenericStorePop: popBoolean MaybeContextSlotIndex: slotIndex needsStoreCheck: needsStoreCheck needsRestoreRcvr: false + needsImmutabilityCheck: needsImmCheck! - needsImmutabilityCheck: needsImmCheck. - ^ 0!
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:ReceiverVariable: (in category 'bytecode generator stores') ----- genStorePop: popBoolean ReceiverVariable: slotIndex + <inline: true> - <inline: false> ^self genStorePop: popBoolean ReceiverVariable: slotIndex needsStoreCheck: self ssTopNeedsStoreCheck needsImmutabilityCheck: true "The generic store checks for IMMUTABILITY flag" !
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:ReceiverVariable:needsStoreCheck:needsImmutabilityCheck: (in category 'bytecode generator stores') ----- genStorePop: popBoolean ReceiverVariable: slotIndex needsStoreCheck: needsStoreCheck needsImmutabilityCheck: needsImmCheck <inline: false> self ssFlushUpThroughReceiverVariable: slotIndex. self ensureReceiverResultRegContainsSelf. "In two path compilation the receiver is young AND mutable, hence no store check nor immutability check is needed" + ^self - self genGenericStorePop: popBoolean slotIndex: slotIndex destReg: ReceiverResultReg needsStoreCheck: (useTwoPaths not and: [needsStoreCheck]) needsRestoreRcvr: true "ReceiverResultReg is kept live with the receiver across the operation" + needsImmutabilityCheck: (needsImmCheck and: [useTwoPaths not]) - needsImmutabilityCheck: (needsImmCheck and: [useTwoPaths not]). - ^ 0 !
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:RemoteInstVar:ofObjectAt:needsStoreCheck:needsImmutabilityCheck: (in category 'bytecode generator stores') ----- genStorePop: popBoolean RemoteInstVar: slotIndex ofObjectAt: objectIndex needsStoreCheck: needsStoreCheck needsImmutabilityCheck: needsImmCheck <inline: false> self assert: needsFrame. self genLoadTemp: objectIndex in: ReceiverResultReg. + ^self - self genGenericStorePop: popBoolean slotIndex: slotIndex destReg: ReceiverResultReg needsStoreCheck: needsStoreCheck needsRestoreRcvr: false + needsImmutabilityCheck: needsImmCheck! - needsImmutabilityCheck: needsImmCheck. - ^ 0!
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:RemoteTemp:At: (in category 'bytecode generator stores') ----- genStorePop: popBoolean RemoteTemp: slotIndex At: remoteTempIndex + <inline: true> - <inline: false> ^ self genStorePop: popBoolean RemoteTemp: slotIndex At: remoteTempIndex needsStoreCheck: self ssTopNeedsStoreCheck!
Item was changed: ----- Method: StackToRegisterMappingCogit>>genStorePop:RemoteTemp:At:needsStoreCheck: (in category 'bytecode generator stores') ----- genStorePop: popBoolean RemoteTemp: slotIndex At: remoteTempIndex needsStoreCheck: needsStoreCheck <inline: false> "The only reason we assert needsFrame here is that in a frameless method ReceiverResultReg must and does contain only self, but the ceStoreCheck trampoline expects the target of the store to be in ReceiverResultReg. So in a frameless method we would have a conflict between the receiver and the temote temp store, unless we we smart enough to realise that ReceiverResultReg was unused after the literal variable store, unlikely given that methods return self by default." self assert: needsFrame. "N.B. No need to check the stack for references because we generate code for remote temp loads that stores the result in a register, deferring only the register push." self ssAllocateRequiredReg: ReceiverResultReg. optStatus isReceiverResultRegLive: false. self MoveMw: (self frameOffsetOfTemporary: remoteTempIndex) r: FPReg R: ReceiverResultReg. + ^self - self genGenericStorePop: popBoolean slotIndex: slotIndex destReg: ReceiverResultReg needsStoreCheck: needsStoreCheck needsRestoreRcvr: false "We don't keep ReceiverResultReg live with the receiver across this operation" + needsImmutabilityCheck: false "never do immutability check on temp vectors"! - needsImmutabilityCheck: false. "never do immutability check on temp vectors" - ^ 0!
vm-dev@lists.squeakfoundation.org