Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
f44284f
Merge branch 'pharo-12' into betterInlining
RenaudFondeur Jun 13, 2025
581da2c
add tests for bugs
Jun 18, 2025
cecaa68
better visitor
RenaudFondeur Jun 18, 2025
ca24c18
change not comitted
RenaudFondeur Jun 18, 2025
dbbff3a
renaming
Jun 18, 2025
50483d8
Merge branch 'betterInlining' of https://github.com/RenaudFondeur/pha…
Jun 18, 2025
8624779
little bit cleaner separation of things in the visitor
Jun 18, 2025
7794151
beaucoup de refactor
RenaudFondeur Jun 20, 2025
8164838
refactor + fix a bug with switch
RenaudFondeur Jun 23, 2025
741b7a2
fin des tests (sans mutation testing)
RenaudFondeur Jun 23, 2025
18eeabf
refactor
RenaudFondeur Jun 24, 2025
30144a9
better tests
RenaudFondeur Jun 25, 2025
2f7b1e9
better push down of returns and assignments
RenaudFondeur Jun 25, 2025
8f03269
rename constant
RenaudFondeur Jun 25, 2025
93cd99b
rename class
RenaudFondeur Jun 25, 2025
2bdbad6
suppress unused strategy
RenaudFondeur Jun 30, 2025
e4cd42f
add a third inliner + small cleaning
RenaudFondeur Jun 30, 2025
f8a1855
Merge branch 'betterInliningStable' into betterInliningMerge
RenaudFondeur Jun 30, 2025
1ec9fbd
clean up merge
RenaudFondeur Jun 30, 2025
13ec180
add comments for goTo treatement
RenaudFondeur Jun 30, 2025
d20bc77
add a few tests
RenaudFondeur Jun 30, 2025
30a4302
few more tests
Jul 2, 2025
d9e4461
correct test
Jul 2, 2025
78f3740
correct a potentiel bug with recursion + correcte documentation
RenaudFondeur Jul 4, 2025
4c9c55c
start to optimising the visitor usage
RenaudFondeur Jul 4, 2025
22e3bd6
fix a bug and advance in optimizing the visitor
RenaudFondeur Jul 7, 2025
5f5a3b9
reuse stable version + advance
RenaudFondeur Jul 8, 2025
f181430
optimizing the visitor almost done
RenaudFondeur Jul 8, 2025
3c59090
remove halts
RenaudFondeur Jul 8, 2025
a35d190
finished optimizing the visitor
RenaudFondeur Jul 9, 2025
52621bb
advance in fixing bug with goTo
RenaudFondeur Jul 9, 2025
1997814
Use parametrized tests for inlining strategies
RenaudFondeur Jul 11, 2025
91c9381
advance in fixing bug
RenaudFondeur Jul 11, 2025
9e246d2
add support for iterative + add tests
RenaudFondeur Jul 15, 2025
4c50f64
transpilation works
RenaudFondeur Jul 15, 2025
351bb40
Merge branch 'pharo-12' into betterInliningMerge
RenaudFondeur Jul 15, 2025
a837a84
keep using stable version
RenaudFondeur Jul 15, 2025
599ee63
bug found with returningIF
RenaudFondeur Jul 15, 2025
4063388
fixing bugs
RenaudFondeur Jul 16, 2025
cb7249f
working generation + news tests
RenaudFondeur Jul 17, 2025
d0ea3eb
use new inliner
RenaudFondeur Jul 18, 2025
3246e06
remove an unused variable
RenaudFondeur Jul 18, 2025
d1f2df6
fix a bug with locals
RenaudFondeur Jul 18, 2025
1fac851
start to handle send that are exit point like error
RenaudFondeur Jul 18, 2025
f1e0b17
restore stacks after invalidation
RenaudFondeur Jul 18, 2025
90bbac0
fix addAllFirst
RenaudFondeur Jul 18, 2025
61f8e4a
Merge branch 'pharo-12' into betterInliningMergeMerge
RenaudFondeur Jul 21, 2025
7e26029
clean merge
RenaudFondeur Jul 21, 2025
387584d
fix bug with conditional receiver inlined + tests for it
RenaudFondeur Jul 21, 2025
e584c01
clean merge
RenaudFondeur Jul 21, 2025
24e4ecc
handle abort in special send
RenaudFondeur Jul 21, 2025
d3e0168
Merge 9037e613b996ca8eb63b880796be7552b9e633ae
RenaudFondeur Jul 23, 2025
b4ffb3d
handle cppIf in returningIf
RenaudFondeur Jul 23, 2025
c6a5f93
fix bug with value selectors preventing inlining
RenaudFondeur Jul 23, 2025
550d12d
remove a now non necessary check
RenaudFondeur Jul 23, 2025
65d6a41
fix bug with goTo ambiguity
RenaudFondeur Jul 25, 2025
bcf5923
test adding now missing else
RenaudFondeur Jul 25, 2025
901adef
test redo old comportment
RenaudFondeur Jul 29, 2025
31852c6
remove uneccesary stmt list
RenaudFondeur Jul 29, 2025
51897bc
fix endsWithReturn
RenaudFondeur Jul 29, 2025
f17d8d8
fix tests + use nil instead of 0 for unit tests
RenaudFondeur Jul 29, 2025
a797823
fix 2 broken tests
RenaudFondeur Jul 29, 2025
92b9140
fix a broken test
RenaudFondeur Jul 30, 2025
46f98db
handle single branch conditional as arguments
RenaudFondeur Jul 30, 2025
236790a
fix broken tests
RenaudFondeur Jul 30, 2025
421be30
generate less unecessary goTo
RenaudFondeur Jul 30, 2025
13ebdb1
commit all the method
RenaudFondeur Jul 30, 2025
90c5aae
correctly supress all the unecessary goTo
RenaudFondeur Jul 31, 2025
ae60a5a
add more generated comments
RenaudFondeur Jul 31, 2025
b4c4d86
fix tests missing the new comments
RenaudFondeur Jul 31, 2025
0c9fd73
clean up the code
RenaudFondeur Jul 31, 2025
9a30503
optimize inlining + get rid of all the non necessary '{}'
RenaudFondeur Aug 1, 2025
c61fc19
optimize the tests to add only the required method and not the full c…
RenaudFondeur Aug 4, 2025
469204e
optimize a bit for conditional inlining + fix a potential bug with TD…
RenaudFondeur Aug 5, 2025
747383f
supress dead code
RenaudFondeur Aug 5, 2025
1c7e6ec
refactoring
RenaudFondeur Aug 5, 2025
c349a85
remove redundant operation
RenaudFondeur Aug 6, 2025
1318243
refactoring + optimize inlining by using isComplete
RenaudFondeur Aug 8, 2025
fdff2b6
refactoring
RenaudFondeur Aug 8, 2025
6fb40ab
fix broken test
RenaudFondeur Aug 8, 2025
e64f0ff
rename goTo methods
RenaudFondeur Aug 8, 2025
a0ebfaa
add tests for perform sends
RenaudFondeur Aug 18, 2025
a0d925e
small refactoring
RenaudFondeur Aug 18, 2025
9df41f9
small refactoring
RenaudFondeur Aug 18, 2025
2f924a9
don't consider arguments of condionals to be in expression by default
RenaudFondeur Aug 19, 2025
afba0d8
clean leftover commented code
RenaudFondeur Aug 20, 2025
9f81034
clean leftover unused variables in tests
RenaudFondeur Aug 20, 2025
e956716
clean leftover comment
RenaudFondeur Aug 21, 2025
44a52a4
clean leftover code for debugging
RenaudFondeur Aug 21, 2025
b55e50c
add a comment
RenaudFondeur Aug 21, 2025
53dab74
fix a bug with iterative (not in the VM) and better tests
RenaudFondeur Aug 25, 2025
3d179bc
Merge branch 'pharo-12' into betterInliningMerge
RenaudFondeur Aug 25, 2025
2606335
better handling of void returning method
RenaudFondeur Aug 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 15 additions & 24 deletions smalltalksrc/Slang-Tests/SLASTTransformationTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ Class {
SLASTTransformationTest >> setUp [

super setUp.
ccg addClass: SLASTTransformationTestClass.
testClass := SLASTTransformationTestClass.
"necessary to get the type of sqInt"
SpurMemoryManager initBytesPerWord: 8.
ccg inferTypes.
sLExpandASTVisitor := SLExpandASTVisitor new
]

{ #category : 'send-transformation' }
SLASTTransformationTest >> testMethodWithBlockValue [

| translation tMethod |
tMethod := ccg methodNamed: #methodWithBlockValue.
tMethod := self addMethodAndMethodCalledBy: #methodWithBlockValue.

sLExpandASTVisitor currentMethod: tMethod .
sLExpandASTVisitor currentMethod: tMethod.
sLExpandASTVisitor expandASTInCurrentMethod.

translation := self translate: tMethod.
Expand All @@ -39,9 +38,7 @@ methodWithBlockValue(void)
{
sqInt arg;

{
2 + 1;
}
2 + 1;
return 0;
}'
]
Expand All @@ -50,7 +47,7 @@ methodWithBlockValue(void)
SLASTTransformationTest >> testMethodWithBlockValueValue [

| translation tMethod |
tMethod := ccg methodNamed: #methodWithBlockValueValue.
tMethod := self addMethodAndMethodCalledBy: #methodWithBlockValueValue.

sLExpandASTVisitor currentMethod: tMethod.
sLExpandASTVisitor expandASTInCurrentMethod.
Expand All @@ -68,9 +65,7 @@ methodWithBlockValueValue(void)
sqInt arg1;
sqInt arg2;

{
2 + 3;
}
2 + 3;
return 0;
}'
]
Expand All @@ -79,7 +74,7 @@ methodWithBlockValueValue(void)
SLASTTransformationTest >> testMethodWithBockInAssignment [

| translation tMethod |
tMethod := ccg methodNamed: #methodWithBockInAssignment.
tMethod := self addMethodAndMethodCalledBy: #methodWithBockInAssignment.

sLExpandASTVisitor currentMethod: tMethod.
sLExpandASTVisitor expandASTInCurrentMethod.
Expand Down Expand Up @@ -108,7 +103,7 @@ methodWithBockInAssignment(void)
SLASTTransformationTest >> testMethodWithBockValueInAssignment [

| translation tMethod |
tMethod := ccg methodNamed: #methodWithBockValueInAssignment.
tMethod := self addMethodAndMethodCalledBy: #methodWithBockValueInAssignment.

sLExpandASTVisitor currentMethod: tMethod.
sLExpandASTVisitor expandASTInCurrentMethod.
Expand All @@ -126,10 +121,8 @@ methodWithBockValueInAssignment(void)
sqInt arg;
sqInt var;

{
emptyMethod(1);
var = 5;
}
emptyMethod(1);
var = 5;
return 0;
}'
]
Expand All @@ -138,7 +131,7 @@ methodWithBockValueInAssignment(void)
SLASTTransformationTest >> testMethodWithBockValueValueInAssignment [

| translation tMethod |
tMethod := ccg methodNamed: #methodWithBockValueValueInAssignment.
tMethod := self addMethodAndMethodCalledBy: #methodWithBockValueValueInAssignment.

sLExpandASTVisitor currentMethod: tMethod.
sLExpandASTVisitor expandASTInCurrentMethod.
Expand All @@ -157,11 +150,9 @@ methodWithBockValueValueInAssignment(void)
sqInt arg2;
sqInt var;

{
emptyMethod(1);
emptyMethod(2);
var = 5;
}
emptyMethod(1);
emptyMethod(2);
var = 5;
return 0;
}'
]
Expand All @@ -170,7 +161,7 @@ methodWithBockValueValueInAssignment(void)
SLASTTransformationTest >> testMethodWithFPrintF [

| translation tMethod |
tMethod := ccg methodNamed: #methodWithFPrintF.
tMethod := self addMethodAndMethodCalledBy: #methodWithFPrintF.

sLExpandASTVisitor currentMethod: tMethod.
sLExpandASTVisitor expandASTInCurrentMethod.
Expand Down
51 changes: 51 additions & 0 deletions smalltalksrc/Slang-Tests/SLAbstractTranslationTestCase.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,55 @@
Class {
#name : 'SLAbstractTranslationTestCase',
#superclass : 'SlangAbstractTestCase',
#instVars : [
'testClass'
],
#category : 'Slang-Tests',
#package : 'Slang-Tests'
}

{ #category : 'helpers' }
SLAbstractTranslationTestCase >> addMethodAndMethodCalledBy: aSelector [

^ self
addMethodAndMethodCalledBy: aSelector
structOrNotBlock: [ :selector |
ccg addMethodFor: testClass selector: selector ]
]

{ #category : 'helpers' }
SLAbstractTranslationTestCase >> addMethodAndMethodCalledBy: aSelector structOrNotBlock: aBlock [

| requiredCalls visited previousSize tMethod classMethodSelectors |
classMethodSelectors := testClass methodDictionary keys.
tMethod := aBlock value: aSelector.
(visited := Set new) add: aSelector.
(requiredCalls := tMethod allCalls) add: tMethod selector.
previousSize := requiredCalls size.

[
requiredCalls do: [ :selector |
((classMethodSelectors includes: selector) and: [
(visited includes: selector) not ]) ifTrue: [
tMethod := aBlock value: selector.
visited add: selector.
requiredCalls addAll: tMethod allCalls ] ].
requiredCalls size > previousSize ] whileTrue: [
previousSize := requiredCalls size ].

ccg inferTypes.
^ ccg methodNamed: aSelector
]

{ #category : 'helpers' }
SLAbstractTranslationTestCase >> addStructMethodAndMethodCalledBy: aSelector [

^ self
addMethodAndMethodCalledBy: aSelector
structOrNotBlock: [ :selector |
ccg addStructMethodFor: testClass selector: selector ]
]

{ #category : 'helpers' }
SLAbstractTranslationTestCase >> astTranslate: tast inStream: aWriteStream [

Expand All @@ -15,6 +60,12 @@ SLAbstractTranslationTestCase >> astTranslate: tast inStream: aWriteStream [
cAST acceptVisitor: prettyPrinter.
]

{ #category : 'helpers' }
SLAbstractTranslationTestCase >> doInliningIn: aTMethod [

ccg doBasicInlining: true
]

{ #category : 'helpers' }
SLAbstractTranslationTestCase >> translate: tast [

Expand Down
Loading