Eliot Miranda uploaded a new version of MethodMassage to project VM Maker: http://source.squeak.org/VMMaker/MethodMassage-eem.55.mcz
==================== Summary ====================
Name: MethodMassage-eem.55 Author: eem Time: 24 February 2022, 9:56:47.863914 am UUID: c7d36dd7-ebee-4be9-94eb-6e855cf6f166 Ancestors: MethodMassage-eem.54
Get AssemblerAbsentClassImport to compile in trunk.
Allow pushSpecialConstant:, which is present in more modern InstructionStream, to fall back on pushConstant: support in the emission code.
=============== Diff against MethodMassage-eem.54 ===============
Item was changed: ----- Method: AssemblerAbsentClassImport>>allInstVarNames (in category 'accessing') ----- allInstVarNames + ^instVars ifNil: [#()]! - ^instVars!
Item was added: + ----- Method: AssemblerAbsentClassImport>>decompilerClass (in category 'compiling') ----- + decompilerClass + "Answer a decompiler class appropriate for compiled methods of this class." + + ^ self compilerClass decompilerClass!
Item was added: + ----- Method: AssemblerAbsentClassImport>>newCompiler (in category 'compiling') ----- + newCompiler + "Answer a Compiler suitable for compiling this Behavior" + ^self compilerClass new parser: self newParser!
Item was changed: ----- Method: BytecodeDisassembler>>pushConstant: (in category 'instruction decoding') ----- pushConstant: aLiteral instructions at: thePC put: ((method encoderClass literalIndexOfBytecodeAt: thePC in: method) + ifNil: [self error: 'literal not found'] - ifNil: [Message - selector: #pushSpecialConstant: - argument: aLiteral] ifNotNil: [:index| Message selector: #pushConstantAtIndex: argument: index])!
Item was added: + BytecodeDisassembler subclass: #BytecodeDisassemblerToIdentifyImplicitLiterals + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: 'MethodMassage-Kernel'! + + !BytecodeDisassemblerToIdentifyImplicitLiterals commentStamp: 'eem 9/17/2021 11:39' prior: 0! + A BytecodeDisassemblerToIdentifyImplicitLiterals is a variation on BytecodeDisassembler that identifies if a pushConstant: or send:super:numArgs: is either an implciit literal bytecode or a special selector send. Newer versions of the interpretNextInstructionFor:in: scanners send pushSpecialConstant: and sendSpecial:numArgs: for these, meaning that no work is required. Older versions do not. This class is to cope with those older versions. + + Instance Variables + !
Item was added: + ----- Method: BytecodeDisassemblerToIdentifyImplicitLiterals>>pushConstant: (in category 'instruction decoding') ----- + pushConstant: aLiteral + instructions + at: thePC + put: ((method encoderClass literalIndexOfBytecodeAt: thePC in: method) + ifNil: [Message + selector: #pushSpecialConstant: + argument: aLiteral] + ifNotNil: + [:index| + Message + selector: #pushConstantAtIndex: + argument: index])!
Item was changed: ----- Method: BytecodeEmitter>>pushSpecialConstant: (in category 'assembly') ----- + pushSpecialConstant: aLiteral + "rubbish way of handling special literals" + ^([encoder genPushSpecialLiteral: aLiteral] + on: Error + do: [:ex| ex return: nil]) + ifNotNil: [:result| result] + ifNil: [encoder genPushLiteral: (encoder litIndex: aLiteral)]! - pushSpecialConstant: aLiteral - ^encoder genPushSpecialLiteral: aLiteral!
Item was changed: ----- Method: BytecodeSizer>>pushSpecialConstant: (in category 'assembly') ----- + pushSpecialConstant: aLiteral + ^(encoder sizePushSpecialLiteral: aLiteral) + ifNotNil: [:size| size] + ifNil: [encoder sizePushLiteral: (encoder litIndex: aLiteral)]! - pushSpecialConstant: aLiteral - ^encoder sizePushSpecialLiteral: aLiteral!
vm-dev@lists.squeakfoundation.org