[Vm-dev] VM Maker: VMMaker.oscog-eem.3013.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Aug 2 06:35:07 UTC 2021
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.3013.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.3013
Author: eem
Time: 1 August 2021, 11:34:55.89867 pm
UUID: 386c33d9-c0f2-44c4-bfd3-84910f485b03
Ancestors: VMMaker.oscog-eem.3012
Eliminate a Slang warning.
=============== Diff against VMMaker.oscog-eem.3012 ===============
Item was changed:
----- Method: Cogit>>generateCogMethod: (in category 'generate machine code') -----
generateCogMethod: selector
"We handle jump sizing simply. First we make a pass that asks each
instruction to compute its maximum size. Then we make a pass that
sizes jumps based on the maxmimum sizes. Then we make a pass
that fixes up jumps. When fixing up a jump the jump is not allowed to
choose a smaller offset but must stick to the size set in the second pass."
<returnTypeC: #'CogMethod *'>
| codeSize headerSize mapSize totalSize startAddress result |
- <var: #method type: #'CogMethod *'>
headerSize := self sizeof: CogMethod.
methodLabel address: methodZone freeStart.
self computeMaximumSizes.
methodLabel concretizeAt: methodZone freeStart.
codeSize := self generateInstructionsAt: methodLabel address + headerSize.
mapSize := self generateMapAt: nil start: methodLabel address + cmNoCheckEntryOffset.
totalSize := methodZone roundUpLength: headerSize + codeSize + mapSize.
totalSize > MaxMethodSize ifTrue:
[^self cCoerceSimple: MethodTooBig to: #'CogMethod *'].
startAddress := methodZone allocate: totalSize.
startAddress = 0 ifTrue:
[^self cCoerceSimple: InsufficientCodeSpace to: #'CogMethod *'].
self assert: startAddress + cmEntryOffset = entry address.
self assert: startAddress + cmNoCheckEntryOffset = noCheckEntry address.
result := self outputInstructionsAt: startAddress + headerSize.
self assert: startAddress + headerSize + codeSize = result.
backEnd padIfPossibleWithStopsFrom: result to: startAddress + totalSize - mapSize - 1.
self generateMapAt: startAddress + totalSize - 1 start: startAddress + cmNoCheckEntryOffset.
self fillInBlockHeadersAt: startAddress.
self fillInMethodHeader: (self writableMethodFor: startAddress)
size: totalSize
selector: selector.
"This also implicitly flushes the read/write mapped dual zone to the read/execute zone."
backEnd flushICacheFrom: startAddress to: startAddress + totalSize.
^self cCoerceSimple: startAddress to: #'CogMethod *'!
More information about the Vm-dev
mailing list