[Vm-dev] VM Maker: VMMaker.oscog-eem.2357.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Mar 15 23:11:10 UTC 2018
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2357.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.2357
Author: eem
Time: 15 March 2018, 4:10:33.968265 pm
UUID: 884a7b42-b594-4b54-844a-58a5cec1dd36
Ancestors: VMMaker.oscog-cb.2356
Fix regression introduced in VMMaker.oscog-eem.2333 or thereabouts when improving comoilation breakpoint. maybeSelectorOfMethod can answer nil so a guard is needed.
=============== Diff against VMMaker.oscog-cb.2356 ===============
Item was changed:
----- Method: Cogit>>cog:selector: (in category 'jit - api') -----
cog: aMethodObj selector: aSelectorOop
"Attempt to produce a machine code method for the bytecode method
object aMethodObj. N.B. If there is no code memory available do *NOT*
attempt to reclaim the method zone. Certain clients (e.g. ceSICMiss:)
depend on the zone remaining constant across method generation."
<api>
<returnTypeC: #'CogMethod *'>
| selector cogMethod |
<var: #cogMethod type: #'CogMethod *'>
(self exclude: aMethodObj selector: aSelectorOop) ifTrue:
[^nil].
"In Newspeak we support anonymous accessors and hence tolerate the same
method being cogged multiple times. But only if the method class association is nil."
NewspeakVM
ifTrue:
[(coInterpreter methodHasCogMethod: aMethodObj) ifTrue:
[cogMethod := coInterpreter cogMethodOf: aMethodObj.
self deny: cogMethod selector = aSelectorOop.
cogMethod selector = aSelectorOop ifTrue:
[^cogMethod].
(coInterpreter methodClassAssociationOf: aMethodObj) ~= objectMemory nilObject ifTrue:
[self cCode: 'extern void *firstIndexableField(sqInt)'. "Slang, au natural"
self warnMultiple: cogMethod selectors: aSelectorOop.
^nil]]]
ifFalse: [self deny: (coInterpreter methodHasCogMethod: aMethodObj)].
self deny: (objectMemory isOopCompiledMethod: (coInterpreter ultimateLiteralOf: aMethodObj)).
selector := aSelectorOop = objectMemory nilObject
ifTrue: [coInterpreter maybeSelectorOfMethod: aMethodObj]
ifFalse: [aSelectorOop].
"coInterpreter stringOf: selector"
+ selector ifNotNil:
+ [coInterpreter
+ compilationBreak: selector
+ point: (objectMemory lengthOf: selector)
+ isMNUCase: false].
- coInterpreter
- compilationBreak: selector
- point: (objectMemory lengthOf: selector)
- isMNUCase: false.
aMethodObj = breakMethod ifTrue: [self halt: 'Compilation of breakMethod'].
NewspeakVM ifTrue:
[cogMethod := methodZone findPreviouslyCompiledVersionOf: aMethodObj with: aSelectorOop.
cogMethod ifNotNil:
[(coInterpreter methodHasCogMethod: aMethodObj) not ifTrue:
[self assert: (coInterpreter rawHeaderOf: aMethodObj) = cogMethod methodHeader.
cogMethod methodObject: aMethodObj.
coInterpreter rawHeaderOf: aMethodObj put: cogMethod asInteger].
^cogMethod]].
"If the generators for the alternate bytecode set are missing then interpret."
(coInterpreter methodUsesAlternateBytecodeSet: aMethodObj)
ifTrue:
[(self numElementsIn: generatorTable) <= 256 ifTrue:
[^nil].
bytecodeSetOffset := 256]
ifFalse:
[bytecodeSetOffset := 0].
objectRepresentation ensureNoForwardedLiteralsIn: aMethodObj.
methodObj := aMethodObj.
methodHeader := objectMemory methodHeaderOf: aMethodObj.
receiverTags := objectMemory receiverTagBitsForMethod: methodObj.
cogMethod := self compileCogMethod: aSelectorOop.
(cogMethod asInteger between: MaxNegativeErrorCode and: -1) ifTrue:
[cogMethod asInteger = InsufficientCodeSpace ifTrue:
[coInterpreter callForCogCompiledCodeCompaction].
self maybeFreeCounters.
"Right now no errors should be reported, so nothing more to do."
"self reportError: (self cCoerceSimple: cogMethod to: #sqInt)."
^nil].
"self cCode: ''
inSmalltalk:
[coInterpreter printCogMethod: cogMethod.
""coInterpreter symbolicMethod: aMethodObj.""
self assertValidMethodMap: cogMethod."
"self disassembleMethod: cogMethod."
"printInstructions := clickConfirm := true""]."
^cogMethod!
More information about the Vm-dev
mailing list