GsDevKit_home icon indicating copy to clipboard operation
GsDevKit_home copied to clipboard

We could do better on recompiling closures in `upgradeStone`

Open marianopeck opened this issue 7 years ago • 0 comments

Hi @dalehenrich

In upgradeStone you already perform some post upgrade scripts and even for recompiling closures (like the sort blocks). However, I would add at least the following:

"We first try recompiling as much methods/closures as possible.
The #recompile method attempts to recompile Simple blocks in-place if there is
an error during compilation or the block is not simple, an Error is signaled."
[
| allBlocks allBlocksNeedingRecompile blocksFailedToRecompile correctlyRecompiled |
blocksFailedToRecompile := OrderedCollection new.
correctlyRecompiled := OrderedCollection new.
System commit.
allBlocks := ExecBlock allSubInstances.
allBlocksNeedingRecompile := allBlocks select: [:each | each needsRecompile ].
allBlocksNeedingRecompile do: [:each |
	[
		each recompile.
		correctlyRecompiled add: each.
 	] on: Error do: [:ex |
		blocksFailedToRecompile add: each.
	]
].
System commit.
Transcript show: 'Correctly recompiled closures: ',  correctlyRecompiled size asString.
Transcript show: 'Erred recompiled closures: ',  blocksFailedToRecompile size asString.
"The Warning is because else I get: Warning: cannot find key for optimized literal value oop 655362 (a SmallInteger)"
] on: Warning do: [:ex | ex resume  ].

Then, I also had an issue with Seaside Maintainance VM as it was getting an error every one minute!!! The solution was:

        WAGemStoneMaintenanceTask initialize.

marianopeck avatar Feb 03 '17 13:02 marianopeck