Eliot Miranda uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2752.mcz ==================== Summary ==================== Name: VMMaker.oscog-eem.2752 Author: eem Time: 7 May 2020, 8:10:56.388975 pm UUID: 38b47b95-fe1d-4843-a9ec-5cd233270c46 Ancestors: VMMaker.oscog-eem.2751 InterpreterProxy API: Add identityHashOf; the PyBridge needs it to not hack around Spur. Slang: Fix a bug when inlining a send whose result is assigned and which includes a literal block that returns. =============== Diff against VMMaker.oscog-eem.2751 =============== Item was added: + ----- Method: InterpreterPrimitives>>identityHashOf: (in category 'primitive support') ----- + identityHashOf: anOop + "Answer the identity hash of an object, assigning a hash if it doesn't have one. + On Spur refuse to assign a hash to something that looks like a behavior." + <api> + (objectMemory isImmediate: anOop) ifTrue: + [^self + immediateAsInteger: anOop + ifFail: [-1]]. + (objectMemory hasSpurMemoryManagerAPI + and: [(objectMemory rawHashBitsOf: anOop) = 0 + and: [objectMemory objCouldBeClassObj: anOop]]) ifTrue: + [^-1]. + ^objectMemory hashBitsOf: anOop! Item was added: + ----- Method: InterpreterPrimitives>>immediateAsInteger:ifFail: (in category 'primitive support') ----- + immediateAsInteger: anOop ifFail: aBlock + <inline: #always> + (objectMemory isIntegerObject: anOop) ifTrue: + [^objectMemory integerValueOf: anOop]. + (objectMemory isCharacterObject: anOop) ifTrue: + [^objectMemory characterValueOf: anOop]. + (objectMemory isImmediateFloat: anOop) ifTrue: + [^objectMemory rotatedFloatBitsOf: anOop]. + ^aBlock value! Item was changed: ----- Method: InterpreterPrimitives>>primitiveImmediateAsInteger (in category 'arithmetic float primitives') ----- primitiveImmediateAsInteger "For a Smalllnteger, answer itself. For a Character, answer its code as an unsigned integer. For a SmallFloat, answer the signed, but unadjusted bit pattern (so as to keep the result a SmallInteger). This is a good value for an immediate's hash." <option: #SpurObjectMemory> | oop value | oop := self stackTop. + value := self + immediateAsInteger: oop + ifFail: [^self primitiveFailFor: PrimErrBadReceiver]. - (objectMemory isIntegerObject: oop) ifTrue: - [value := objectMemory integerValueOf: oop] ifFalse: - [(objectMemory isCharacterObject: oop) ifTrue: - [value := objectMemory characterValueOf: oop] ifFalse: - [(objectMemory isImmediateFloat: oop) ifTrue: - [value := objectMemory rotatedFloatBitsOf: oop] ifFalse: - [^self primitiveFailFor: PrimErrBadReceiver]]]. self pop: argumentCount + 1 thenPushInteger: value! Item was added: + ----- Method: InterpreterProxy>>identityHashOf: (in category 'object access') ----- + identityHashOf: anObject + "N.B. this method will assign an identityHash to an object that does not already have one." + ^anObject identityHash! Item was changed: ----- Method: TAssignmentNode>>emitValueExpansionOn:level:generator: (in category 'C code generation') ----- emitValueExpansionOn: aStream level: level generator: aCodeGen | stmtList lastStmt copiedStatements | self assert: (expression isSend and: [expression isValueExpansion]). stmtList := expression receiver. lastStmt := stmtList statements last. + (lastStmt = variable or: [lastStmt isReturn]) ifTrue: - lastStmt = variable ifTrue: [^expression emitCCodeOn: aStream level: level generator: aCodeGen]. copiedStatements := stmtList copy. copiedStatements statements at: stmtList statements size put: (TAssignmentNode new setVariable: variable expression: lastStmt). expression copy receiver: copiedStatements; emitCCodeOn: aStream level: level generator: aCodeGen! |
Free forum by Nabble | Edit this page |