[Vm-dev] VM Maker: VMMaker.oscog-eem.198.mcz
commits at source.squeak.org
commits at source.squeak.org
Fri Aug 10 21:00:17 UTC 2012
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.198.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.198
Author: eem
Time: 10 August 2012, 1:58:46.571 pm
UUID: 03c8603b-bb83-42f6-8e04-a161f808aace
Ancestors: VMMaker.oscog-lw.197
Make overflowing the youngReferrers list a hard error (appears to
happen quite often in Newspeak code).
Clarify remapNSIfObjectRef:pc:hasYoung:.
=============== Diff against VMMaker.oscog-lw.197 ===============
Item was changed:
----- Method: CogMethodZone>>addToYoungReferrers: (in category 'young referers') -----
addToYoungReferrers: cogMethod
<var: #cogMethod type: #'CogMethod *'>
self assert: youngReferrers <= limitAddress.
- self assert: self roomOnYoungReferrersList.
self assert: (self occurrencesInYoungReferrers: cogMethod) = 0.
self assert: cogMethod cmRefersToYoung.
+ (self asserta: self roomOnYoungReferrersList) ifFalse:
+ [self error: 'no room on youngReferrers list'].
youngReferrers := youngReferrers - BytesPerWord.
objectMemory longAt: youngReferrers put: cogMethod asUnsignedInteger!
Item was changed:
----- Method: Cogit>>remapNSIfObjectRef:pc:hasYoung: (in category 'garbage collection') -----
remapNSIfObjectRef: annotation pc: mcpc hasYoung: hasYoungPtr
<option: #NewspeakVM>
<var: #mcpc type: #'char *'>
<var: #targetMethod type: #'CogMethod *'>
annotation = IsObjectReference ifTrue:
[| literal mappedLiteral |
literal := backEnd literalBeforeFollowingAddress: mcpc asInteger.
(objectRepresentation couldBeObject: literal) ifTrue:
[mappedLiteral := objectMemory remap: literal.
literal ~= mappedLiteral ifTrue:
[backEnd storeLiteral: mappedLiteral beforeFollowingAddress: mcpc asInteger.
codeModified := true].
(hasYoungPtr ~= 0
and: [objectMemory isYoung: mappedLiteral]) ifTrue:
[(self cCoerceSimple: hasYoungPtr to: #'sqInt *') at: 0 put: true]]].
(self isSendAnnotation: annotation) ifTrue:
[| cacheTag mappedCacheTag entryPoint |
cacheTag := backEnd inlineCacheTagAt: mcpc asInteger.
(objectRepresentation couldBeObject: cacheTag) ifTrue:
[mappedCacheTag := objectMemory remap: cacheTag.
cacheTag ~= mappedCacheTag ifTrue:
[backEnd rewriteInlineCacheTag: mappedCacheTag at: mcpc asInteger.
codeModified := true].
(hasYoungPtr ~= 0
and: [objectMemory isYoung: mappedCacheTag]) ifTrue:
[(self cCoerceSimple: hasYoungPtr to: #'sqInt *') at: 0 put: true]].
entryPoint := backEnd callTargetFromReturnAddress: mcpc asInteger.
+ entryPoint = ceImplicitReceiverTrampoline
+ ifTrue:
+ [| pc oop mappedOop |
+ pc := mcpc asInteger + backEnd jumpShortByteSize.
- entryPoint = ceImplicitReceiverTrampoline ifTrue:
- [| pc oop mappedOop |
- pc := mcpc asInteger + backEnd jumpShortByteSize.
- (oop := backEnd unalignedLongAt: pc) ~= 0 ifTrue:
- [mappedOop := objectMemory remap: oop.
- mappedOop ~= oop ifTrue:
- [backEnd unalignedLongAt: pc put: mappedOop].
- (hasYoungPtr ~= 0
- and: [objectMemory isYoung: mappedOop]) ifTrue:
- [(self cCoerceSimple: hasYoungPtr to: #'sqInt *') at: 0 put: true].
- pc := mcpc asInteger + backEnd jumpShortByteSize + BytesPerOop.
(oop := backEnd unalignedLongAt: pc) ~= 0 ifTrue:
[mappedOop := objectMemory remap: oop.
mappedOop ~= oop ifTrue:
[backEnd unalignedLongAt: pc put: mappedOop].
+ (hasYoungPtr ~= 0
+ and: [objectMemory isYoung: mappedOop]) ifTrue:
+ [(self cCoerceSimple: hasYoungPtr to: #'sqInt *') at: 0 put: true].
+ pc := mcpc asInteger + backEnd jumpShortByteSize + BytesPerOop.
+ (oop := backEnd unalignedLongAt: pc) ~= 0 ifTrue:
+ [mappedOop := objectMemory remap: oop.
+ mappedOop ~= oop ifTrue:
+ [backEnd unalignedLongAt: pc put: mappedOop].
+ (hasYoungPtr ~= 0
+ and: [objectMemory isYoung: mappedOop]) ifTrue:
+ [(self cCoerceSimple: hasYoungPtr to: #'sqInt *') at: 0 put: true]]]]
+ ifFalse:
+ [hasYoungPtr ~= 0 ifTrue:
+ [| offset targetMethod |
+ "Since the unlinking routines may rewrite the cacheTag to the send's selector, and
+ since they don't have the cogMethod to hand and can't add it to youngReferrers,
+ the method must remain in youngReferrers if the targetMethod's selector is young."
+ entryPoint > methodZoneBase ifTrue: "It's a linked send."
+ [offset := (entryPoint bitAnd: entryPointMask) = checkedEntryAlignment
+ ifTrue: [cmEntryOffset]
+ ifFalse: [cmNoCheckEntryOffset].
+ targetMethod := self cCoerceSimple: entryPoint - offset to: #'CogMethod *'.
+ (objectMemory isYoung: targetMethod selector) ifTrue:
+ [(self cCoerceSimple: hasYoungPtr to: #'sqInt *') at: 0 put: true]]]]].
- (hasYoungPtr ~= 0
- and: [objectMemory isYoung: mappedOop]) ifTrue:
- [(self cCoerceSimple: hasYoungPtr to: #'sqInt *') at: 0 put: true]]]].
- hasYoungPtr ~= 0 ifTrue:
- [| offset targetMethod |
- "Since the unlinking routines may rewrite the cacheTag to the send's selector, and
- since they don't have the cogMethod to hand and can't add it to youngReferrers,
- the method must remain in youngReferrers if the targetMethod's selector is young."
- entryPoint > methodZoneBase ifTrue: "It's a linked send."
- [offset := (entryPoint bitAnd: entryPointMask) = checkedEntryAlignment
- ifTrue: [cmEntryOffset]
- ifFalse: [cmNoCheckEntryOffset].
- targetMethod := self cCoerceSimple: entryPoint - offset to: #'CogMethod *'.
- (objectMemory isYoung: targetMethod selector) ifTrue:
- [(self cCoerceSimple: hasYoungPtr to: #'sqInt *') at: 0 put: true]]]].
^0 "keep scanning"!
More information about the Vm-dev
mailing list