David T. Lewis uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker-dtl.415.mcz ==================== Summary ==================== Name: VMMaker-dtl.415 Author: dtl Time: 19 April 2020, 5:30:30.208 pm UUID: 747f8591-57e6-4950-858a-c7fbc22ad1c2 Ancestors: VMMaker-dtl.414 VMMaker 4.19.1 Required for Squeak trunk Collections-eem.885 and above. Install primitiveArrayBecomeOneWayNoCopyHash as primitive 248, replacing obsolete primitiveInvokeObjectAsMethod. Fix 128 primitiveArrayBecome to match oscog logic. This a fix from VMMaker.oscog-eem.647 which Eliot explained as follows: Fix primitiveArrayBecome (the two-way become); it should /not/ specify copyHash. ObjectMemory ignores the copyHash flag when doing a two-way become, hence the wrong sense of the flag had no effect. Hence correctly evaluate testBecomeIdentityHash. The primitives now do this: primitive 72: twoWay: false copyHash: true primitive 128: twoWay: true copyHash: false primitive 248: twoWay: false copyHash: false primitive 249: twoWay: false copyHash: <arg 3 value> =============== Diff against VMMaker-dtl.414 =============== Item was changed: ----- Method: ContextInterpreter>>primitiveInvokeObjectAsMethod (in category 'control primitives') ----- primitiveInvokeObjectAsMethod "Primitive. 'Invoke' an object like a function, sending the special message run: originalSelector with: arguments in: aReceiver. + Installed as primitive 248 prior to VMMaker 4.19.1" - " | runSelector runReceiver runArgs newReceiver lookupClass | runArgs := objectMemory instantiateClass: (objectMemory splObj: ClassArray) indexableSize: argumentCount. objectMemory beRootIfOld: runArgs. "do we really need this?" self transfer: argumentCount from: stackPointer - ((argumentCount - 1) * objectMemory bytesPerWord) to: runArgs + objectMemory baseHeaderSize. runSelector := messageSelector. runReceiver := self stackValue: argumentCount. self pop: argumentCount+1. "stack is clean here" newReceiver := newMethod. messageSelector := objectMemory splObj: SelectorRunWithIn. argumentCount := 3. self push: newReceiver. self push: runSelector. self push: runArgs. self push: runReceiver. lookupClass := objectMemory fetchClassOf: newReceiver. self findNewMethodInClass: lookupClass. self executeNewMethodFromCache. "Recursive xeq affects primFailCode" self initPrimCall. ! Item was changed: ----- Method: Interpreter class>>initializePrimitiveTable (in category 'initialization') ----- (excessive size, no diff calculated) Item was changed: ----- Method: InterpreterPrimitives>>primitiveArrayBecome (in category 'object access primitives') ----- primitiveArrayBecome "We must flush the method cache here, to eliminate stale references to mutated classes and/or selectors." | arg rcvr | arg := self stackTop. rcvr := self stackValue: 1. + self success: (objectMemory become: rcvr with: arg twoWay: true copyHash: false). - self success: (objectMemory become: rcvr with: arg twoWay: true copyHash: true). self successful ifTrue: [ self pop: 1 ].! Item was added: + ----- Method: InterpreterPrimitives>>primitiveArrayBecomeOneWayNoCopyHash (in category 'object access primitives') ----- + primitiveArrayBecomeOneWayNoCopyHash + "Similar to primitiveArrayBecomeOneWay but does /not/ copy the receiver's + elements identity hashes over the argument's elements identity hashes." + + | arg rcvr | + arg := self stackTop. + rcvr := self stackValue: 1. + self success: (objectMemory become: rcvr with: arg twoWay: false copyHash: false). + self successful ifTrue: [ self pop: 1 ].! Item was changed: ----- Method: InterpreterPrimitives>>primitiveInvokeObjectAsMethod (in category 'control primitives') ----- primitiveInvokeObjectAsMethod "Primitive. 'Invoke' an object like a function, sending the special message run: originalSelector with: arguments in: aReceiver. + Installed as primitive 248 prior to VMMaker 4.19.1" - " self subclassResponsibility! Item was changed: ----- Method: StackInterpreter class>>initializePrimitiveTable (in category 'initialization') ----- (excessive size, no diff calculated) Item was changed: ----- Method: StackInterpreterPrimitives>>primitiveInvokeObjectAsMethod (in category 'control primitives') ----- primitiveInvokeObjectAsMethod "Primitive. 'Invoke' an object like a function, sending the special message run: originalSelector with: arguments in: aReceiver. + Installed as primitive 248 prior to VMMaker 4.19.1" - " <returnTypeC: #void> | runReceiver runArgs lookupClass | runArgs := objectMemory eeInstantiateClass: (objectMemory splObj: ClassArray) indexableSize: argumentCount. argumentCount - 1 to: 0 by: -1 do: [:i| objectMemory storePointerUnchecked: i ofObject: runArgs withValue: self popStack]. runReceiver := self popStack. "setup send of newMethod run: originalSelector with: runArgs in: runReceiver" self push: newMethod. "newReceiver" self push: messageSelector "original selector". self push: runArgs. self push: runReceiver. "stack is clean here" messageSelector := objectMemory splObj: SelectorRunWithIn. argumentCount := 3. lookupClass := objectMemory fetchClassOf: newMethod. self findNewMethodInClass: lookupClass. self executeNewMethod. "Recursive xeq affects successFlag" self initPrimCall! Item was changed: ----- Method: VMMaker class>>versionString (in category 'version testing') ----- versionString "VMMaker versionString" + ^'4.19.1'! - ^'4.18.1'! |
Free forum by Nabble | Edit this page |