ClementBera uploaded a new version of VMMaker to project VM Maker: http://source.squeak.org/VMMaker/VMMaker.oscog-cb.2043.mcz ==================== Summary ==================== Name: VMMaker.oscog-cb.2043 Author: cb Time: 19 December 2016, 11:14:17.217588 am UUID: 62a72d10-be64-47ed-bbe5-eb745f0b7516 Ancestors: VMMaker.oscog-eem.2042 Added identityHash code =============== Diff against VMMaker.oscog-eem.2042 =============== Item was changed: ----- Method: SistaCogit>>genUnaryInlinePrimitive: (in category 'inline primitive generators') ----- genUnaryInlinePrimitive: prim "Unary inline primitives." "SistaV1: 248 11111000 iiiiiiii mjjjjjjj Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution. See EncoderForSistaV1's class comment and StackInterpreter>>#unaryInlinePrimitive:" | rcvrReg resultReg | rcvrReg := self allocateRegForStackEntryAt: 0. resultReg := self allocateRegNotConflictingWith: (self registerMaskFor: rcvrReg). prim caseOf: { "00 unchecked class" [1] -> "01 unchecked pointer numSlots" [self ssTop popToReg: rcvrReg. self ssPop: 1. objectRepresentation genGetNumSlotsOf: rcvrReg into: resultReg; genConvertIntegerToSmallIntegerInReg: resultReg]. "02 unchecked pointer basicSize" [3] -> "03 unchecked byte numBytes" [self ssTop popToReg: rcvrReg. self ssPop: 1. objectRepresentation genGetNumBytesOf: rcvrReg into: resultReg; genConvertIntegerToSmallIntegerInReg: resultReg]. "04 unchecked short16Type format numShorts" "05 unchecked word32Type format numWords" "06 unchecked doubleWord64Type format numDoubleWords" [11] -> "11 unchecked fixed pointer basicNew" [self ssTop type ~= SSConstant ifTrue: [^EncounteredUnknownBytecode]. (objectRepresentation genGetInstanceOf: self ssTop constant into: resultReg initializingIf: self extBSpecifiesInitializeInstance) ~= 0 ifTrue: [^ShouldNotJIT]. "e.g. bad class" + self ssPop: 1] . + [20] -> "20 identityHash" + [self ssTop popToReg: rcvrReg. + objectRepresentation genGetHashFieldNonImmOf: rcvrReg asSmallIntegerInto: resultReg. self ssPop: 1] + "21 identityHash (SmallInteger)" + "22 identityHash (Character)" + "23 identityHash (SmallFloat64)" + "24 identityHash (Behavior)" } otherwise: [^EncounteredUnknownBytecode]. extB := 0. self ssPushRegister: resultReg. ^0! Item was changed: ----- Method: StackInterpreter>>unaryInlinePrimitive: (in category 'miscellaneous bytecodes') ----- unaryInlinePrimitive: primIndex "SistaV1: 248 11111000 iiiiiiii mjjjjjjj Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution." <option: #SistaVM> | result | primIndex caseOf: { "1000 unchecked class" [0] -> [result := objectMemory fetchClassOf: self internalStackTop. self internalStackTopPut: result]. "1001 unchecked pointer numSlots" [1] -> [result := objectMemory numSlotsOf: self internalStackTop. self internalStackTopPut: (objectMemory integerObjectOf: result)]. "1002 unchecked pointer basicSize" [2] -> [result := (objectMemory numSlotsOf: self internalStackTop) - (objectMemory fixedFieldsOfClass: (objectMemory fetchClassOfNonImm: self internalStackTop)). self internalStackTopPut: (objectMemory integerObjectOf: result)]. "1003 unchecked byte8Type format numBytes (includes CompiledMethod)" [3] -> [result := objectMemory numBytesOf: self internalStackTop. self internalStackTopPut: (objectMemory integerObjectOf: result)]. "1004 unchecked short16Type format numShorts" [4] -> [result := objectMemory num16BitUnitsOf: self internalStackTop. self internalStackTopPut: (objectMemory integerObjectOf: result)]. "1005 unchecked word32Type format numWords" [5] -> [result := objectMemory num32BitUnitsOf: self internalStackTop. self internalStackTopPut: (objectMemory integerObjectOf: result)]. "1006 unchecked doubleWord64Type format numDoubleWords" [6] -> [result := objectMemory num64BitUnitsOf: self internalStackTop. self internalStackTopPut: (objectMemory integerObjectOf: result)]. "1011 unchecked fixed pointer basicNew" [11] -> [| classObj numSlots | classObj := self internalStackTop. numSlots := objectMemory instanceSizeOf: classObj. result := objectMemory eeInstantiateSmallClass: classObj numSlots: numSlots. (extB noMask: 1) ifTrue: [0 to: numSlots - 1 do: [:i| objectMemory storePointerUnchecked: i ofObject: result withValue: objectMemory nilObject]]. extB := 0. + self internalStackTopPut: result]. + "1020 identityHash" + [20] -> [result := objectMemory hashBitsOf: self internalStackTop. + self internalStackTopPut: (objectMemory integerObjectOf: result)] + "1021 identityHash (SmallInteger)" + "1022 identityHash (Character)" + "1023 identityHash (SmallFloat64)" + "1024 identityHash (Behavior)" + } - self internalStackTopPut: result] } otherwise: [localIP := localIP - 3. self respondToUnknownBytecode]! |
Free forum by Nabble | Edit this page |