Skip to content

Commit

Permalink
Working on the message rewriting
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt committed Dec 20, 2024
1 parent c8fa82e commit 9e55a79
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/IllimaniProfiler/IllAnalyzer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,15 @@ IllAnalyzer >> cleanKernelAllocationSites: aCollection [
{ #category : 'api' }
IllAnalyzer >> doMagic [

| toPretenureSites |
| toPretenureSites allocationSendersList |
self classifyAllocationSites.
toPretenureSites := self pruneAllocationSites select: #isLongOrImmortal.
toPretenureSites := self cleanKernelAllocationSites: toPretenureSites.
toPretenureSites := self removeDoItAllocationSite: toPretenureSites.

pretenurator doMagic: toPretenureSites.

allocationSendersList := toPretenureSites values collect: [ :allocSiteBin |
allocSiteBin allObjects first allocationSenders asMethodWithOffsetObjects ].
pretenurator doMagic: allocationSendersList.
^ pretenurator
]

Expand Down
17 changes: 9 additions & 8 deletions src/IllimaniProfiler/IllPretenurator.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,15 @@ Class {
{ #category : 'as yet unclassified' }
IllPretenurator >> doMagic: toPretenureSites [

[
toPretenureSites valuesDo: [ :allocSiteBin |
toPretenureSites do: [ :allocationSenders |
| sct allocationSenders initialCaller sendersToTransform |
allocationSenders := (allocSiteBin allObjects collect: #allocationSenders as: Set) anyOne
asMethodWithOffsetObjects.
initialCaller := allocationSenders last.
sendersToTransform := allocationSenders allButLast.

sct := SendersChainTransformer new.
codeTransformers add: sct.
sct backupSenders: sendersToTransform caller: initialCaller.
sct transformCallingSenders: sendersToTransform initialCaller: initialCaller ] ]

ensure: [ codeTransformers do: #restoreOriginalState ]
sct transformCallingSenders: sendersToTransform initialCaller: initialCaller ]
]

{ #category : 'initialization' }
Expand All @@ -34,3 +29,9 @@ IllPretenurator >> initialize [
super initialize.
codeTransformers := OrderedCollection new
]

{ #category : 'as yet unclassified' }
IllPretenurator >> restoreOriginalState [

codeTransformers do: #restoreOriginalState
]

0 comments on commit 9e55a79

Please sign in to comment.