Skip to content

Commit

Permalink
Merge pull request #886 from tesonep/fixing-classTag-tests
Browse files Browse the repository at this point in the history
fixing-classTag-tests
  • Loading branch information
guillep authored Dec 23, 2024
2 parents 61b8bdd + f00c60d commit 7e88a6d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ CogOutOfLineLiteralsARMCompiler >> rewriteInlineCacheAt: callSiteReturnAddress t
objectMemory
unsignedLongAt: (self instructionAddressBefore: callSiteReturnAddress ) put: call;
unsignedLongAt: (self pcRelativeAddressAt: callSiteReturnAddress - 8) put: cacheTag.
self assert: (self inlineCacheTagAt: callSiteReturnAddress) = cacheTag.
self assert: (self inlineCacheTagAt: callSiteReturnAddress) = (cacheTag signedIntFromLong bitAnd:
1 << objectMemory classIndexFieldWidth - 1).
"self cCode: ''
inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 8 to: (self pcRelativeAddressAt: callSiteReturnAddress - 8)]."
^4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ CogOutOfLineLiteralsARMv8Compiler >> rewriteInlineCacheAt: callSiteReturnAddress
objectMemory
uint32AtPointer: (self instructionAddressBefore: callSiteReturnAddress ) put: call;
unsignedLong64At: (self pcRelativeAddressAt: callSiteReturnAddress - 8) put: cacheTag signedIntToLong64.
self assert: (self inlineCacheTagAt: callSiteReturnAddress) = cacheTag signedIntToLong64.
self assert: (self inlineCacheTagAt: callSiteReturnAddress) = (cacheTag signedIntToLong64 bitAnd:
1 << objectMemory classIndexFieldWidth - 1) .
"self cCode: ''
inSmalltalk: [cogit disassembleFrom: callSiteReturnAddress - 8 to: (self pcRelativeAddressAt: callSiteReturnAddress - 8)]."
^4
Expand Down
5 changes: 3 additions & 2 deletions smalltalksrc/VMMakerTests/VMClassTagInlineReadTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ VMClassTagInlineReadTest >> testLinkingWithEntryOffset [
jitMethod: (self findMethod: #yourself)
selector: memory trueObject.

callSiteReturn := sendingMethod address + 16r98.
cogit sendSitesIn: sendingMethod do: [ :annotation :pc | callSiteReturn := pc ].

cogit
linkSendAt: callSiteReturn
Expand All @@ -41,11 +41,12 @@ VMClassTagInlineReadTest >> testLinkingWithEntryOffsetLargeClassIndex [
jitMethod: (self findMethod: #methodWithSend)
selector: memory nilObject.

cogit sendSitesIn: sendingMethod do: [ :annotation :pc | callSiteReturn := pc ].

targetMethod := self
jitMethod: (self findMethod: #yourself)
selector: memory trueObject.

callSiteReturn := sendingMethod address + 16r98.

obj := self newZeroSizedObject.
memory setClassIndexOf: obj to: (1 << memory classIndexFieldWidth - 5).
Expand Down

0 comments on commit 7e88a6d

Please sign in to comment.