Eliot Miranda uploaded a new version of MethodMassage to project VM Maker: http://source.squeak.org/VMMaker/MethodMassage-eem.56.mcz
==================== Summary ====================
Name: MethodMassage-eem.56 Author: eem Time: 11 April 2024, 2:49:11.823981 pm UUID: 6f63df0c-f62a-4d13-b15a-95a0899141f9 Ancestors: MethodMassage-eem.55
Update to deal with the new special constant/sendSpecial bytecode API introduced in Kernel-mt.1543.
Fix some tests for the full blocks regime.
=============== Diff against MethodMassage-eem.55 ===============
Item was changed: ----- Method: AssemblerMethod>>recordVerificationInfoFrom: (in category 'initialize-release') ----- recordVerificationInfoFrom: aMethod "Record header, initialPC and endPC from aMethod for checking." header := aMethod header. endPC := aMethod endPC. initialPC := aMethod initialPC. + source := aMethod isCompiledBlock ifFalse: + [aMethod sourcePointer ~= 0 + ifTrue: [aMethod getSourceFromFile asString] + ifFalse: [aMethod properties at: #source ifAbsent: nil]]. - source := aMethod sourcePointer ~= 0 - ifTrue: [aMethod getSourceFromFile asString] - ifFalse: [aMethod properties at: #source ifAbsent: nil]. allInstVars := aMethod methodClass allInstVarNames!
Item was changed: + ----- Method: BytecodeAssemblerTests>>testBasicBlockLabelsFor: (in category 'junk') ----- - ----- Method: BytecodeAssemblerTests>>testBasicBlockLabelsFor: (in category 'test support') ----- testBasicBlockLabelsFor: aMethod "self new testBasicBlockLabelsFor: self >> #testBasicBlockLabelsFor:" + "N.B. for full blocks regime we can't test much about the block itself." + | labels stream endPC nextPC encoderClass initialExtensionPC | - "N.B> broken for full blocks regime, since labels are not yet sub-method specific." - | labels stream endPC nextPC | labels := (BasicBlockLabellingDisassembler new disassemble: aMethod) labels. aMethod isQuick ifTrue: [^self assert: labels isEmpty]. self assert: (labels select: [:l| aMethod initialPC = l value]) size = 1. + (encoderClass := aMethod encoderClass) supportsFullBlocks ifFalse: + [aMethod embeddedBlockClosures do: + [:closure| + self assert: (labels select: [:l| closure startpc = l value]) size = 1]]. - aMethod embeddedBlockClosures do: - [:closure| - self assert: (labels select: [:l| closure startpc = l value]) size = 1]. stream := InstructionStream on: aMethod. endPC := aMethod endPC. [stream pc <= endPC] whileTrue: + [| byte | + nextPC := stream nextPc: (byte := aMethod at: stream pc). + ((encoderClass isExtension: byte) + and: [initialExtensionPC isNil]) ifTrue: + [initialExtensionPC := stream pc]. - [nextPC := stream nextPc: (aMethod at: stream pc). (stream willJumpIfTrue or: [stream willJumpIfFalse]) ifTrue: ["A conditional jump should have a label following it." self assert: (labels select: [:l| stream followingPc = l value]) size = 1]. + ((encoderClass isExtension: byte) not + and: [initialExtensionPC notNil + and: [stream willJump]]) ifTrue: + [stream pc: initialExtensionPC]. stream interpretJump ifNotNil: [:dist| "There shoud be a label at the target, and, if it is conditional, also one following the jump." self assert: (labels select: [:l| stream pc + dist = l value]) size = 1]. stream pc: nextPC]!
Item was changed: ----- Method: BytecodeCoverageTests>>testCoverageOfTestBasicBlockLabelsForMethod (in category 'tests') ----- testCoverageOfTestBasicBlockLabelsForMethod "[| me | me := self new. [me setUp; testCoverageOfTestBasicBlockLabelsForMethod] ensure: [me tearDown]] timeToRun" "[| me | me := self new. [me setUp; coverTestBasicBlockLabelsForMethod] ensure: [me tearDown]] timeToRun" | theMethod | theMethod := self class >> #testBasicBlockLabelsFor:. + theMethod removeProperty: #coverage. BytecodeCoverer new coverMethod: theMethod. self assert: (theMethod propertyValueAt: #coverage) notNil. self assert: (theMethod propertyValueAt: #coverage) notEmpty.
self coverTestBasicBlockLabelsForMethod.
self assert: (theMethod propertyValueAt: #coverage) isEmpty!
Item was added: + ----- Method: BytecodeEmitter>>methodReturnSpecialConstant: (in category 'assembly') ----- + methodReturnSpecialConstant: aLiteral + ^encoder genReturnSpecialLiteral: aLiteral!
Item was added: + ----- Method: BytecodeEmitter>>sendSpecial:numArgs: (in category 'assembly') ----- + sendSpecial: selector numArgs: nArgs + ^encoder genSendSpecial: (SpecialSelectors at: selector) numArgs: nArgs!
Item was added: + ----- Method: BytecodeSizer>>methodReturnSpecialConstant: (in category 'assembly') ----- + methodReturnSpecialConstant: aLiteral + ^encoder sizeReturnSpecialLiteral: aLiteral!
Item was added: + ----- Method: BytecodeSizer>>sendSpecial:numArgs: (in category 'assembly') ----- + sendSpecial: selector numArgs: nArgs + ^encoder sizeSpecialSend: (SpecialSelectors at: selector) numArgs: nArgs!
vm-dev@lists.squeakfoundation.org