RoelTyper

ASampleClass
An ASampleClass is xxxxxxxxx.
Instance Variables
a: <Object>
b: <Object>
c: <Object>
d: <Object>
e: <Object>
f: <Object>
a
- xxxxx
b
- xxxxx
c
- xxxxx
d
- xxxxx
e
- xxxxx
f
- xxxxx
a
b
blockTyping
(TypeCollector typeTmpsIn: (self>>#blockTyping) ofClass: self)
byParam
byParam:
c
return
(TypeCollector typeTmpsIn: (self>>#return) ofClass: self)
tmpTyping
(TypeCollector typeTmpsIn: (self>>#tmpTyping) ofClass: self)
useReturn
(TypeCollector typeInstvar: #f ofClass: self) types
AbstractMerger
An AbstractMerger is xxxxxxxxx.
Instance Variables
mergeInterfaceTypes:assignmentTypes:
interfaceTypes is a set of trees of types reconstructed by looking at the interfaces.
assignmentTypes is a set of trees of types reconstructed by looking at the assignments.
The receiver takes these sets as input and needs to return one set of trees of types that combines both.
AbstractMergerTests
An AbstractMergerTests is xxxxxxxxx.
Instance Variables
mergeClass
test1
test10
Dictionary and Array are in unrelated hierarchies -> keep both.
test11
Dictionary and Array are in unrelated hierarchies -> keep both.
test12
Dictionary and Array are in unrelated hierarchies -> keep both. Collection bites the dust because it is superclass.
test13
Dictionary and Array are in unrelated hierarchies -> keep both. Collection bites the dust because it is superclass.
test14
test2
test3
test4
test5
test6
Dictionary and Array are in unrelated hierarchies -> keep both
test7
test8
Dictionary and Array are in unrelated hierarchies -> keep both
AbstractType
An AbstractType is xxxxxxxxx.
Instance Variables
ivarClass: <Object>
ivarName: <Object>
nbOfCorrectTypes: <Object>
nbOfIncorrectTypes: <Object>
tag: <Object>
ivarClass
- xxxxx
ivarName
- xxxxx
nbOfCorrectTypes
- xxxxx
nbOfIncorrectTypes
- xxxxx
tag
- xxxxx
conflictingAssignmentsWith:
conflictingSelectorsWith:
forInstvar:inClass:
initialize
Do nothing, but give subclasses the chance to override.
is:
isExtractedResult
isObjectType
isSingularType
ivarClass
ivarClass:
ivarName
ivarName:
liveExtractType
new
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
printTypesOn:
types
AssignmentsFirstMerger
An AssignmentsFirstMerger is xxxxxxxxx.
Instance Variables
mergeInterfaceTypes:assignmentTypes:
interfaceTypes is a set of trees of types reconstructed by looking at the interfaces.
assignmentTypes is a set of trees of types reconstructed by looking at the assignments.
The receiver takes these sets as input and needs to return one set of trees of types that combines both.
AssignmentsFirstMergerTests
An AssignmentsFirstMergerTests is xxxxxxxxx.
Instance Variables
mergeClass
test1
test10
Dictionary and Array are in unrelated hierarchies -> keep both.
test11
Dictionary and Array are in unrelated hierarchies -> keep both.
test12
Dictionary and Array are in unrelated hierarchies -> keep both. Collection bites the dust because it is superclass.
test13
Dictionary and Array are in unrelated hierarchies -> keep both. Collection bites the dust because it is superclass.
test14
test2
test3
test4
test5
test6
Dictionary and Array are in unrelated hierarchies -> keep both
test7
test8
Dictionary and Array are in unrelated hierarchies -> keep both
CommonCollection
A CommonCollection is xxxxxxxxx.
Instance Variables
collection: <Object>
collection
- xxxxx
collection
collection:
do:
doesNotUnderstand:
Handle the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message (typically sent from the machine when a message is sent to the receiver and no method is defined for that selector).
fusionWith:
fusionWithCollection:
on:
size
Primitive. Answer the number of indexable variables in the receiver.
This value is the same as the largest legal subscript. Essential. See Object
documentation whatIsAPrimitive.
CommonCollectionTest
A CommonCollectionTest is xxxxxxxxx.
Instance Variables
testFusionWith
testRedirectionOfMessages
ConcreteMerger
A ConcreteMerger is xxxxxxxxx.
Instance Variables
mergeInterfaceTypes:assignmentTypes:
interfaceTypes is a set of trees of types reconstructed by looking at the interfaces.
assignmentTypes is a set of trees of types reconstructed by looking at the assignments.
The receiver takes these sets as input and needs to return one set of trees of types that combines both.
ConcreteMergerTests
A ConcreteMergerTests is xxxxxxxxx.
Instance Variables
mergeClass
test1
assignment type Array is subtype of interface type Collection
-> folding keeps Array and loses Collection
test10
Dictionary and Array are in unrelated hierarchies -> keep both.
test11
Dictionary and Array are in unrelated hierarchies -> keep both.
test12
Dictionary and Array are in unrelated hierarchies -> keep both. Collection bites the dust because it is superclass.
test13
Dictionary and Array are in unrelated hierarchies -> keep both. Collection bites the dust because it is superclass.
test14
test2
interface type Array is subclass of assignment type Collection
-> folding keeps Array and loses Collection
test3
test4
test5
test6
Dictionary and Array are in unrelated hierarchies -> keep both
test7
test8
Dictionary and Array are in unrelated hierarchies -> keep both
ExtractedType
An ExtractedType is xxxxxxxxx.
Instance Variables
assignments: <Object>
extractedTypes: <Object>
interface: <Object>
links: <Object>
assignments
- xxxxx
extractedTypes
- xxxxx
interface
- xxxxx
links
- xxxxx
addAssignment:
addLinkedExtractedType:
addReverseLinkedExtractedType:
addSend:
assignments
basicExtractedTypes
cleanedAssignments
contents
flattenLinks
foldInterfaceTypes:withAssignmentTypes:
^interfaceClasses asOrderedCollection
forInstvar:inClass:interface:assignments:
hasEmptyAssignments
hasEmptyInterface
initialize
Do nothing, but give subclasses the chance to override.
interface
interface:assignments:
isEmpty
isExtractedResult
links
mergeTypes
mergerClass
printInterfaceAndAssigments
printInterfaceAndAssigmentsOn:
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
rootsUnderstanding:
When the set of selectors is not empty, answer a set of the highest possible classes in the system that implement all the selectors.
When the set of selectors is empty, return the empty set.
types
ExtractedTypeForBlockArg
An ExtractedTypeForBlockArg is xxxxxxxxx.
Instance Variables
compiledMethod: <Object>
lives: <Object>
compiledMethod
- xxxxx
lives
- xxxxx
asBlockArgInTypeCollector:
compiledMethod:
doesNotUnderstand:
Handle the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message (typically sent from the machine when a message is sent to the receiver and no method is defined for that selector).
forOffset:ofCompiledMethod:inClass:
initialize
Do nothing, but give subclasses the chance to override.
interface
liveExtractType
newLive
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
tempOffset:
types
ExtractedTypeForTmp
An ExtractedTypeForTmp is xxxxxxxxx.
Instance Variables
compiledMethod: <Object>
compiledMethod
- xxxxx
asBlockArgInTypeCollector:
compiledMethod
compiledMethod:
forTmpOffset:ofCompiledMethod:inClass:
new
tempOffset
tempOffset:
ExtractedTypeTest
An ExtractedTypeTest is xxxxxxxxx.
Instance Variables
testFlattenLinks
InstvarInterfaceExtractor
I am responsible for extracting the messages sent to an instance variable and the assignments done to an instance variable. I am supposed to work together with a TypeCollector.
Instance Variables:
collector <TypeCollector> description of collector
copied <Array> description of copied
initialStack <Collection | KeyBindingsList | MethodFilterAnd | MethodFilterOr> description of initialStack
input <InstructionStream> description of input
method <CompiledInitializer | CompiledMethod> description of method
saveStacks <Dictionary> description of saveStacks
stack <(OrderedCollection of: Object)> description of stack
copied:
dupFirst
extractInterfacesFrom:addTo:
initialize
Subclasses should redefine this method to perform initializations on instance creation
input
method:
nativeSend:numArgs:
pop
pushConstant:
Push Constant, value, on Top Of Stack bytecode.
pushContext
pushInst:
pushReceiver
Push Active Context's Receiver on Top Of Stack bytecode.
pushStatic:
assoc can be an association OR a variable binding. I just push the complete association, since it does not interest me for the moment.
readBlock:copied:
reloadStack
saveStacks
send:numArgs:
InstvarInterfaceExtractorTest
An InstvarInterfaceExtractorTest is xxxxxxxxx.
Instance Variables
a: <Object>
b: <Object>
c: <Object>
u: <Object>
v: <Object>
w: <Object>
x: <Object>
y: <Object>
z: <Object>
a
- xxxxx
b
- xxxxx
c
- xxxxx
u
- xxxxx
v
- xxxxx
w
- xxxxx
x
- xxxxx
y
- xxxxx
z
- xxxxx
assertAssignments:in:
assertSends:in:
denyAssignments:in:
empty:atIndexes:
emptyAssigment:atIndexes:
emptyInterface:atIndexes:
processMethod:
Fail by default. Needs to be overridden by subclasses to trigger the base testing backbone.
testArithmetic
self run: #testArithmetic
testArithmeticValueSpecialisation
testArrayAssignment
testCascaded1
testCascaded2
testComplicated1
testComplicated2
testComplicated3
self run: #testComplicated3
testEquality
testIdentity
testIftrue
testIndirectAssignments
testInstanceAssignment
testInstanceAssignmentIndirect
testInstvarAssignment1
testInstvarAssignment2
testMetaClassAssignment
testSuperivarAssignment
testSuperivarSend
testblockindirectxy
testblockuwx
testblockwithargs
testblockxy
testblockyab
#'ifTrue:ifFalse: is sent to a, but is not Captured by the extractor
testindirectx
testu
testuxyw
testxyw
testzuv
PharoInstvarInterfaceExtractor
A PharoInstvarInterfaceExtractor is xxxxxxxxx.
Instance Variables
blockTempsMapping: <Object>
blockTempsMapping
- xxxxx
blockMapping
blockReturnTop
Return Top Of Stack bytecode.
extractInterfacesFrom:addTo:
inABlock
initialize
Subclasses should redefine this method to perform initializations on instance creation
newBlockMapping
popIntoRemoteTemp:inVectorAt:
Remove Top Of Stack And Store Into Offset of Temp Vector bytecode.
popIntoTemporaryVariable:
Remove Top Of Stack And Store Into Temporary Variable bytecode.
pushClosureCopyNumCopiedValues:numArgs:blockSize:
Push Closure bytecode.
pushConsArrayWithElements:
Push Cons Array of size numElements popping numElements items from the stack into the array bytecode.
pushNewArrayOfSize:
Push New Array of size numElements bytecode.
pushRemoteTemp:inVectorAt:
Push Contents at Offset in Temp Vector bytecode.
pushTemporaryVariable:
Push Contents Of Temporary Variable Whose Index Is the
argument, offset, On Top Of Stack bytecode.
removeBlockMapping
send:numArgs:
storeIntoTemporaryVariable:
Store Top Of Stack Into Temporary Variable Of Method bytecode.
PharoTypeCollector
A PharoTypeCollector is xxxxxxxxx.
Instance Variables
langueSpecificPushSendOf:to:args:
newExtractor
Return a new extractor class. This is typically Smalltalk dialect dependent, so subclasses have to override to choose the one they want.
RoelTypingTestRoot
A RoelTypingTestRoot is xxxxxxxxx.
Instance Variables
dummyVariable: <Object>
for: <Object>
offsetTest: <Object>
dummyVariable
- xxxxx
for
- xxxxx
offsetTest
- xxxxx
doForSource:
processMethod:
Fail by default. Needs to be overridden by subclasses to trigger the base testing backbone.
SqueakInstvarInterfaceExtractor
A SqueakInstvarInterfaceExtractor is xxxxxxxxx.
Instance Variables
blockReturnTop
Return Top Of Stack bytecode.
doDup
Duplicate Top Of Stack bytecode.
doPop
Remove Top Of Stack bytecode.
jump:
Unconditional Jump bytecode.
jump:if:
Conditional Jump bytecode.
methodReturnConstant:
Return Constant bytecode.
methodReturnReceiver
Return Self bytecode.
methodReturnTop
Return Top Of Stack bytecode.
popIntoLiteralVariable:
Remove Top Of Stack And Store Into Literal Variable bytecode.
popIntoReceiverVariable:
Remove Top Of Stack And Store Into Instance Variable bytecode.
popIntoTemporaryVariable:
Remove Top Of Stack And Store Into Temporary Variable bytecode.
pushActiveContext
Push Active Context On Top Of Its Own Stack bytecode.
pushLiteralVariable:
Push Contents Of anAssociation On Top Of Stack bytecode.
pushReceiverVariable:
Push Contents Of the Receiver's Instance Variable Whose Index
is the argument, offset, On Top Of Stack bytecode.
pushTemporaryVariable:
Push Contents Of Temporary Variable Whose Index Is the
argument, offset, On Top Of Stack bytecode.
send:numArgs:
send:super:numArgs:
Send Message With Selector, selector, bytecode. The argument,
supered, indicates whether the receiver of the message is specified with
'super' in the source method. The arguments of the message are found in
the top numArguments locations on the stack and the receiver just
below them.
sendSuper:numArgs:
sqReturnTop
In VW, method returnTop is inherited from instructionClient and does nothing.
storeIntoLiteralVariable:
Store Top Of Stack Into Literal Variable Of Method bytecode.
storeIntoReceiverVariable:
Store Top Of Stack Into Instance Variable Of Method bytecode.
storeIntoTemporaryVariable:
Store Top Of Stack Into Temporary Variable Of Method bytecode.
SqueakTypeCollector
A SqueakTypeCollector is xxxxxxxxx.
Instance Variables
assignmentTypeOf:
langueSpecificPushSendOf:to:args:
newExtractor
Return a new extractor class. This is typically Smalltalk dialect dependent, so subclasses have to override to choose the one they want.
TypeCollector
I collect and assemble the types sent to instance variables for a certain class (I use the InterfaceExtractor for that), And use them to create and return TypingResults.
Instance Variables:
assignments <Object> description of assignments
instVarOffset <Object> description of instVarOffset
instVars <(Palette of: (ExceptionSet | GenericException | SequenceableCollection | Signal)) | (SequenceableCollection of: (ExceptionSet | GenericException | SequenceableCollection | Signal))> description of instVars
sends <Object> description of sends
theClass <ClassDescription> description of theClass
absoluteIndexForVar:
Note: works for Squeak and VisualWorks. If it would be only for VW, you could just use instVarIndexFor: instead.
addAssignment:to:
addAssignment:toReturnOf:
addAssignment:toTmp:
addAssignment:toTmp:in:
addAssignmentForReturn:
addAssignmentForReturnSelf
addSend:onReturnOfSelfMethod:
Add a range check to filter out sends to instvars defined in superclasses, etc.
addSend:to:
Add a range check to filter out sends to instvars defined in superclasses, etc.
addSend:toTmp:
Add a range check to filter out sends to instvars defined in superclasses, etc.
allInstVarTypes
allTmpTypes
self typingResults do: [:each | each types].
allTypes
assignmentTypeOf:
assignmentsTo:
collectorAfterTypeInstvarsOfClass:
currentExtractedMethod
currentExtractedMethod:
extractedTypeForReturnInMethod:
handleAssignment:for:
handleAssignment:forTmp:
Cannot use ifNotNil: with argument in Squeak, so use a temporary instead.
handleAssignment:forTmp:in:
Cannot use ifNotNil: with argument in Squeak, so use a temporary instead.
langueSpecificPushSendOf:to:args:
lastAssignmentForIndex:
lastAssignmentForTmpIndex:
new
newExtractor
Return a new extractor class. This is typically Smalltalk dialect dependent, so subclasses have to override to choose the one they want.
newForPlatform
onClass:
packagedResults
packagedResultsForCompiledMethod:
pushSendOf:to:args:
Needs to be optimized
sendsTo:
^self sends at: (self indexForVar: instVarName)
theClass
transformAsBlockArg:
transformAsBlockArgTheTmpOffset:
transformAsBlockArgTheTmpOffset:in:
tryUsing:for:ifNotUse:
If receiver has a type, and the selector is understood by that type, pass that type. If not, use aClass as type.
typeInstvar:ofClass:
typeInstvar:ofClassWithLookup:
typeInstvarsOfClass:
typeTmpsIn:ofClass:
typingResults
typingResultsFor:
versionString
withTranslatedIndex:do:
TypeCollectorTests
A TypeCollectorTests is xxxxxxxxx.
Instance Variables
testPoint
TypeMerger
A TypeMerger is xxxxxxxxx.
Instance Variables
cleanBooleansIn:
Remove all occurences of True, False and Boolean in the given collection. If any element was removed, add Boolean
interfaceTypes:assignmentTypes:
mergeInterfaceTypes:assignmentTypes:
interfaceTypes is a set of trees of types reconstructed by looking at the interfaces.
assignmentTypes is a set of trees of types reconstructed by looking at the assignments.
The receiver takes these sets as input and needs to return one set of trees of types that combines both.
TypeMergerTestsRoot
A TypeMergerTestsRoot is xxxxxxxxx.
Instance Variables
mergeResult: <Object>
mergeResult
- xxxxx
mergeClass
mergeInterfaceTypes:assignmentTypes:
TypingResultKeeper
A TypingResultKeeper is xxxxxxxxx.
Instance Variables
timeTaken: <Object>
typeResults: <Object>
timeTaken
- xxxxx
typeResults
- xxxxx
addCollectorResult:
addTypingResult:
benchmarkImage
calculateTypesForClass:
forClasses:
forImage
forImageExpanded
initialize
Subclasses should redefine this method to perform initializations on instance creation
new
nrObjectTypes
nrUniqueTypes
resetTypesForClass:
resultsForClass:instvar:ifAbsent:
sameTypesAs:
timeTaken
typeResults
typesForClass:
typesForClass:instvar:
withAllInstvarResultsDo: