Skip to content

Commit

Permalink
50065
Browse files Browse the repository at this point in the history
15606 Reflectivity: Add more reifications
	https://pharo.fogbugz.com/f/cases/15606

15604 Clean up OldClassBuilderAdapter more...
	https://pharo.fogbugz.com/f/cases/15604

http://files.pharo.org/image/50/50065.zip
  • Loading branch information
Jenkins Build Server authored and ci committed May 25, 2015
1 parent 4436520 commit f1385d7
Show file tree
Hide file tree
Showing 55 changed files with 200 additions and 65 deletions.
@@ -1,15 +1,15 @@
subclass: t instanceVariableNames: f classVariableNames: d poolDictionaries: s category: cat
"This is the standard initialization message for creating a new class as a
subclass of an existing class (the receiver)."
| class |
class := self classBuilder
name: t
inEnvironment: self environment
subclassOf: self
type: self typeOfClass
instanceVariableNames: f
classVariableNames: d
poolDictionaries: s
category: cat.
class ifNotNil: [ class setTraitComposition: {} asTraitComposition ].
^ class
^ PharoClassInstaller make: [ :builder |
builder
superclass: self;
name: t;
layoutClass: (ObjectLayout layoutForType: self typeOfClass);
slots: f asSlotCollection;
sharedVariablesFromString: d;
sharedPools: s;
category: cat;
environment: self environment;
copyTraitCompositionFromExistingClass;
copyClassSlotsFromExistingClass ].
1 change: 1 addition & 0 deletions Reflectivity.package/RFLinkReification.class/README.md
@@ -0,0 +1 @@
I reify the link itself.
@@ -0,0 +1,2 @@
key
^#link
@@ -0,0 +1,2 @@
nodes
^{RBProgramNode}
5 changes: 5 additions & 0 deletions Reflectivity.package/RFLinkReification.class/definition.st
@@ -0,0 +1,5 @@
RFReification subclass: #RFLinkReification
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Reflectivity-Links'
@@ -0,0 +1,2 @@
genForRBProgramNode
^link asLiteralNode
1 change: 1 addition & 0 deletions Reflectivity.package/RFNewValueReification.class/README.md
@@ -0,0 +1 @@
the assigned value of an assignment
@@ -0,0 +1,2 @@
key
^#newValue
@@ -0,0 +1,2 @@
nodes
^{RBAssignmentNode}
@@ -0,0 +1,5 @@
RFReification subclass: #RFNewValueReification
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Reflectivity-Links'
@@ -0,0 +1,2 @@
genForRBAssignmentNode
^node value
1 change: 1 addition & 0 deletions Reflectivity.package/RFNodeReification.class/README.md
@@ -0,0 +1 @@
I am the node that the link is installed on
@@ -0,0 +1,2 @@
key
^#node
@@ -0,0 +1,2 @@
nodes
^{RBProgramNode}.
5 changes: 5 additions & 0 deletions Reflectivity.package/RFNodeReification.class/definition.st
@@ -0,0 +1,5 @@
RFReification subclass: #RFNodeReification
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Reflectivity-Links'
@@ -0,0 +1,2 @@
genForRBProgramNode
^node asLiteralNode
@@ -0,0 +1,2 @@
genForRBAssignmentNode
^self genForRBProgramNode
@@ -0,0 +1,2 @@
genForRBBlockNode
^self genForRBProgramNode
@@ -0,0 +1,2 @@
genForRBCascadeNode
^self genForRBProgramNode
@@ -0,0 +1,2 @@
genForRBLiteralNode
^self genForRBProgramNode
@@ -0,0 +1,2 @@
genForRBProgramNode
self subclassResponsibility
@@ -0,0 +1,2 @@
genForRBReturnNode
^self genForRBProgramNode
@@ -0,0 +1,2 @@
genForRBSequenceNode
^self genForRBProgramNode
@@ -0,0 +1,2 @@
genForRBVariableNode
^self genForRBProgramNode
1 change: 1 addition & 0 deletions Reflectivity.package/RFSelectorReification.class/README.md
@@ -0,0 +1 @@
I am the selector of a message send or method
@@ -0,0 +1,2 @@
key
^#selector
@@ -0,0 +1,2 @@
nodes
^{RBMessageNode. RBMethodNode}
@@ -0,0 +1,5 @@
RFReification subclass: #RFSelectorReification
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Reflectivity-Links'
@@ -0,0 +1,2 @@
genForRBMessageNode
^node selector asLiteralNode
@@ -0,0 +1,2 @@
genForRBMethodNode
^node selector asLiteralNode
@@ -0,0 +1 @@
I reify the arguments of a message send
@@ -0,0 +1,2 @@
key
^#arguments
@@ -0,0 +1,2 @@
nodes
^{RBMessageNode. RBMethodNode. RBBlockNode}
@@ -0,0 +1,5 @@
RFReification subclass: #RFTArgumentsReification
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Reflectivity-Links'
@@ -0,0 +1,16 @@
genForRBProgramNode
node numArgs = 0
ifTrue: [ ^ #() asLiteralNode ].
node numArgs <= 4
ifTrue: [ ^ RBMessageNode receiver: Array asLiteralNode selector: (#braceWith numArgs: node numArgs) arguments: node arguments ].
node numArgs > 4
ifTrue: [
| stream messages |
stream := RBMessageNode
receiver: Array asLiteralNode
selector: #braceStream:
argument: node arguments size asLiteralNode.
messages := (node arguments collect: [ :each | RBMessageNode receiver: stream selector: #nextPut: argument: each ])
asOrderedCollection.
messages add: (RBMessageNode receiver: stream selector: #braceArray).
^ RBCascadeNode messages: messages ]
@@ -0,0 +1 @@
I can be used to pass the context to the meta object
@@ -0,0 +1,2 @@
key
^#context
@@ -0,0 +1,2 @@
nodes
^{RBProgramNode}
@@ -0,0 +1,5 @@
RFReification subclass: #RFThisContextReification
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Reflectivity-Links'
@@ -0,0 +1,2 @@
genForRBProgramNode
^RBVariableNode named: 'thisContext'
1 change: 1 addition & 0 deletions Reflectivity.package/RFValueReification.class/README.md
@@ -0,0 +1 @@
value of a variable read or assignment
@@ -0,0 +1,2 @@
key
^#value
@@ -0,0 +1,2 @@
nodes
^{RBVariableNode. RBAssignmentNode}
5 changes: 5 additions & 0 deletions Reflectivity.package/RFValueReification.class/definition.st
@@ -0,0 +1,5 @@
RFReification subclass: #RFValueReification
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Reflectivity-Links'
@@ -0,0 +1,2 @@
genForRBAssignmentNode
^node variable
@@ -0,0 +1,2 @@
genForRBTempVariableNode
^node copy.
@@ -0,0 +1,3 @@
genForRBVariableNode
node isGlobal ifTrue: [^node binding value asLiteralNode].
^node copy.
@@ -1,4 +1,4 @@
script50064
script50065

^ 'AST-Core-TheIntegrator.294.mcz
AST-Tests-Core-TheIntegrator.68.mcz
Expand Down Expand Up @@ -114,7 +114,7 @@ HudsonBuildTools20-TheIntegrator.65.mcz
IssueTracking-TheIntegrator.6.mcz
IssueTracking-Tests-TheIntegrator.3.mcz
Jobs-EstebanLorenzano.4.mcz
Kernel-TheIntegrator.2035.mcz
Kernel-TheIntegrator.2037.mcz
KernelTests-TheIntegrator.776.mcz
Keymapping-Core-EstebanLorenzano.195.mcz
Keymapping-KeyCombinations-TheIntegrator.48.mcz
Expand Down Expand Up @@ -224,7 +224,7 @@ Refactoring-Tests-Changes-MarcusDenker.38.mcz
Refactoring-Tests-Core-TheIntegrator.123.mcz
Refactoring-Tests-Critics-TheIntegrator.31.mcz
Refactoring-Tests-Environment-StephaneDucasse.11.mcz
Reflectivity-TheIntegrator.48.mcz
Reflectivity-TheIntegrator.50.mcz
Reflectivity-Tests-TheIntegrator.34.mcz
Regex-Core-MarcusDenker.33.mcz
Regex-Help-MarcusDenker.5.mcz
Expand Down Expand Up @@ -314,7 +314,7 @@ Tool-TxWorkspace-TorstenBergmann.5.mcz
Tool-Workspace-TheIntegrator.24.mcz
Tools-TheIntegrator.1503.mcz
ToolsTest-MarcusDenker.denker.71.mcz
Traits-TheIntegrator.771.mcz
Traits-TheIntegrator.773.mcz
Transcript-TheIntegrator.34.mcz
TxText-Athens-SeanDeNigris.50.mcz
TxText-AthensTests-SeanDeNigris.10.mcz
Expand Down

This file was deleted.

@@ -0,0 +1,9 @@
update50065
"self new update50065"
self withUpdateLog: '15606 Reflectivity: Add more reifications
https://pharo.fogbugz.com/f/cases/15606
15604 Clean up OldClassBuilderAdapter more...
https://pharo.fogbugz.com/f/cases/15604'.
self loadTogether: self script50065 merge: false.
self flushCaches.
@@ -1,5 +1,6 @@
commentForCurrentUpdate
^ '15605 Update Rubric
https://pharo.fogbugz.com/f/cases/15605
^ '15606 Reflectivity: Add more reifications
https://pharo.fogbugz.com/f/cases/15606
'
15604 Clean up OldClassBuilderAdapter more...
https://pharo.fogbugz.com/f/cases/15604'
Expand Up @@ -10,12 +10,16 @@ variableByteSubclass: t instanceVariableNames: f
and: [oldClassOrNil typeOfClass == #compiledMethod])
ifTrue: [#compiledMethod]
ifFalse: [#bytes].
^self classBuilder
name: t
inEnvironment: self environment
subclassOf: self
type: actualType
instanceVariableNames: f
classVariableNames: d
poolDictionaries: s
category: cat

^ PharoClassInstaller make: [ :builder |
builder
superclass: self;
name: t;
layoutClass: (ObjectLayout layoutForType: actualType);
slots: f asSlotCollection;
sharedVariablesFromString: d;
sharedPools: s;
category: cat;
environment: self environment;
copyTraitCompositionFromExistingClass;
copyClassSlotsFromExistingClass ].
Expand Up @@ -2,13 +2,16 @@ variableSubclass: t instanceVariableNames: f classVariableNames: d poolDictionar
"This is the standard initialization message for creating a new class as a
subclass of an existing class (the receiver) in which the subclass is to
have indexable pointer variables."

^ self classBuilder
name: t
inEnvironment: self environment
subclassOf: self
type: #variable
instanceVariableNames: f
classVariableNames: d
poolDictionaries: s
category: cat

^ PharoClassInstaller make: [ :builder |
builder
superclass: self;
name: t;
layoutClass: (ObjectLayout layoutForType: #variable);
slots: f asSlotCollection;
sharedVariablesFromString: d;
sharedPools: s;
category: cat;
environment: self environment;
copyTraitCompositionFromExistingClass;
copyClassSlotsFromExistingClass ].
Expand Up @@ -3,12 +3,15 @@ variableWordSubclass: t instanceVariableNames: f
"This is the standard initialization message for creating a new class as a
subclass of an existing class (the receiver) in which the subclass is to
have indexable word-sized nonpointer variables."
^self classBuilder
name: t
inEnvironment: self environment
subclassOf: self
type: #words
instanceVariableNames: f
classVariableNames: d
poolDictionaries: s
category: cat
^ PharoClassInstaller make: [ :builder |
builder
superclass: self;
name: t;
layoutClass: (ObjectLayout layoutForType: #words);
slots: f asSlotCollection;
sharedVariablesFromString: d;
sharedPools: s;
category: cat;
environment: self environment;
copyTraitCompositionFromExistingClass;
copyClassSlotsFromExistingClass ].

0 comments on commit f1385d7

Please sign in to comment.