Branch: refs/heads/Cog
Home: https://github.com/OpenSmalltalk/opensmalltalk-vm
Commit: b3607e98110b5610adea647b8de9b3602cb7b0f1
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/b3607e98110b5610ad…
Author: Marcel Taeumel <marcel.taeumel(a)hpi.de>
Date: 2022-11-01 (Tue, 01 Nov 2022)
Changed paths:
M src/v3.cog/cointerp.c
M src/v3.cog/cointerp.h
M src/v3.cog/gcc3x-cointerp.c
M src/v3.stack/gcc3x-interp.c
M src/v3.stack/interp.c
Log Message:
-----------
V3 source as per VMMaker.oscog-mt.3260
Fixes generation of cmacros for one-arg quick-returns.
[ci skip]
Commit: 298215f2d8adc428d26f66626f3708b4f1f9a03f
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/298215f2d8adc428d2…
Author: Marcel Taeumel <marcel.taeumel(a)hpi.de>
Date: 2022-11-01 (Tue, 01 Nov 2022)
Changed paths:
M src/spur32.cog.newspeak/cogit.h
M src/spur32.cog.newspeak/cogitARMv5.c
M src/spur32.cog.newspeak/cogitIA32.c
M src/spur32.cog.newspeak/cointerp.c
M src/spur32.cog.newspeak/cointerp.h
M src/spur32.cog.newspeak/gcc3x-cointerp.c
M src/spur32.stack.newspeak/gcc3x-interp.c
M src/spur32.stack.newspeak/interp.c
M src/spur64.cog.newspeak/cogit.h
M src/spur64.cog.newspeak/cogitARMv8.c
M src/spur64.cog.newspeak/cogitX64SysV.c
M src/spur64.cog.newspeak/cogitX64WIN64.c
M src/spur64.cog.newspeak/cointerp.c
M src/spur64.cog.newspeak/cointerp.h
M src/spur64.cog.newspeak/gcc3x-cointerp.c
M src/spur64.stack.newspeak/gcc3x-interp.c
M src/spur64.stack.newspeak/interp.c
Log Message:
-----------
Newspeak source as per VMMaker.oscog-mt.3260 [ci skip]
Compare: https://github.com/OpenSmalltalk/opensmalltalk-vm/compare/638a348d4b1a...29…
Marcel Taeumel uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-mt.3260.mcz
==================== Summary ====================
Name: VMMaker.oscog-mt.3260
Author: mt
Time: 1 November 2022, 11:52:51.509196 am
UUID: 44ed8e4a-a0d1-dd40-a840-d438405c51af
Ancestors: VMMaker.oscog-mt.3259
Fixes generation of cmacros for one-arg quick-returns.
This fixes a regression from
VMMaker.oscog-eem.3240
VMMaker.oscog-eem.3237
VMMaker.oscog-eem.3236
VMMaker.oscog-eem.3234
:-)
=============== Diff against VMMaker.oscog-mt.3259 ===============
Item was changed:
----- Method: CCodeGenerator>>addMethodFor:selector: (in category 'utilities') -----
addMethodFor: aClass selector: selector
"Add the given method to the code base and answer its translation
or nil if it shouldn't be translated."
| method tmethod |
method := aClass compiledMethodAt: selector.
(method pragmaAt: #doNotGenerate) ifNotNil:
["only remove a previous method if this one overrides it, i.e. this is a subclass method.
If the existing method is in a different hierarchy this method must be merely a redeirect."
(methods at: selector ifAbsent: []) ifNotNil:
[:tm|
(aClass includesBehavior: tm definingClass) ifTrue:
[self removeMethodForSelector: selector]].
^nil].
method isSubclassResponsibility ifTrue:
[^nil].
(self shouldIncludeMethodFor: aClass selector: selector) ifFalse:
[^nil].
tmethod := self compileToTMethodSelector: selector in: aClass.
"Even though we exclude initialize methods, we must consider their
global variable usage, otherwise globals may be incorrectly localized."
selector == #initialize ifTrue:
[self checkForGlobalUsage: (tmethod allReferencedVariablesUsing: self) in: tmethod.
^nil].
self addMethod: tmethod.
"If the method has a macro then add the macro. But keep the method
for analysis purposes (e.g. its variable accesses)."
(method pragmaAt: #cmacro:) ifNotNil:
[:pragma|
self addMacro: (pragma argumentAt: 1) for: selector.
(inlineList includes: selector) ifTrue:
[inlineList := inlineList copyWithout: selector]].
(method pragmaAt: #cmacro) ifNotNil:
[:pragma| | literal | "Method should be just foo ^const"
self assert: (self isValidMacroMethod: method).
literal := (method isQuick or: [method numArgs = 1])
ifTrue: [method decompile quickMethodReturnLiteral]
ifFalse: [method literalAt: 1].
+ self addMacro: (method numArgs = 1 "foo: arg ^const is a useful exception"
+ ifTrue: ['(x) ']
+ ifFalse: ['() ']),
+ (method isReturnField
- self addMacro: '() ', (method isReturnField
ifTrue: [literal]
ifFalse: [self cLiteralFor: literal value name: method selector]) for: selector.
(inlineList includes: selector) ifTrue:
[inlineList := inlineList copyWithout: selector]].
^tmethod!