This week (49/2022) on the Pharo Issue Tracker

MD
Marcus Denker
Fri, Dec 9, 2022 7:32 AM

This week we merged 20 PRs.

Blocks

Status: All tests green when compiling with ConstantBlockClosure (but the option is not yet enabled by default)
Work continues to reducing the use of #home, this week by using #homeMethod instead of "home method"

Refactoring Engine

Features

Fixes

Cleanup

Pharo10

This week we merged 20 PRs. Blocks ====== Status: All tests green when compiling with ConstantBlockClosure (but the option is not yet enabled by default) Work continues to reducing the use of #home, this week by using #homeMethod instead of "home method" - 12008-Blocks-check-senders-of-compiledCode-can-we-use-homeMethod #12032 https://github.com/pharo-project/pharo/pull/12032 - Context-use-homeMethod #12007 https://github.com/pharo-project/pharo/pull/12007 - some trivial improvements batched (Compiler / Context / Blocks) #12035 https://github.com/pharo-project/pharo/pull/12035 - ConstantBlocks-fix-testIsNotTerminatedWhenItIsInsideLastTerminationMethod #12026 https://github.com/pharo-project/pharo/pull/12026 - ConstantBlocks-Fix-Announcement-Tests #12027 https://github.com/pharo-project/pharo/pull/12027 - Disablequickreturn in blocks #12053 https://github.com/pharo-project/pharo/pull/12053 Refactoring Engine ================== - Refactor make class abstract #12060 https://github.com/pharo-project/pharo/pull/12060 Features ===== - Environment: comment #allMethods, add #methods #12028 https://github.com/pharo-project/pharo/pull/12028 - help method for converting integers into corresp… #11800 https://github.com/pharo-project/pharo/pull/11800 - Extend DiffMorph to make it navigable accross differences #11641 https://github.com/pharo-project/pharo/pull/11641 Fixes ===== - 12049-CI-failure-in-build-testSetUpMethodInSUnitTestsNeedsToBeInRunningProtocol #12051 https://github.com/pharo-project/pharo/pull/12051 - Fix #11995: Handle attempted creation of existing package gracefully #12048 https://github.com/pharo-project/pharo/pull/12048 - Should fix issue 11915 - Pharo compound shortcuts #11954 https://github.com/pharo-project/pharo/pull/11954 - [fix] Pharo issue # 11390: Browsing implementors/senders from source code editors doesn't browse expected selector #1298 https://github.com/pharo-spec/Spec/pull/1298 - Using version v3.0.4 of libgit to fix the 1.4.4 version in linux #1643 https://github.com/pharo-vcs/iceberg/pull/1643 - Fix Crash when invalid credentials #1642 https://github.com/pharo-vcs/iceberg/pull/1642 Cleanup ======= - Replacing baseColor method call from class to instance side #12030 https://github.com/pharo-project/pharo/pull/12030 - Fix lint issues #11978 https://github.com/pharo-project/pharo/pull/11978 - 12046 has non standard palette is always returning false #12047 https://github.com/pharo-project/pharo/pull/12047 Pharo10 ======= - [backport] CompiledCode: add #bytecodes #12031 https://github.com/pharo-project/pharo/pull/12031
MD
Marcus Denker
Fri, Dec 9, 2022 7:56 AM

Blocks

Status: All tests green when compiling with ConstantBlockClosure (but the option is not yet enabled by default)
Work continues to reducing the use of #home, this week by using #homeMethod instead of "home method”

And there are more in need of review, for example:

11965-Implement-ContextactiveHome-without-using-home #12063
https://github.com/pharo-project/pharo/pull/12063

#activeHome returns the #home if it is currently on the stack, the debugger uses that to check if a “save and proceed”
is possible when editing code in a Block. It is implemented to search up the sender chain until it finds the #home:

activeHome
| methodReturnContext |
self isBlockContext ifFalse: [^self].
self sender ifNil: [^nil].
methodReturnContext := self methodReturnContext.
^self sender findContextSuchThat: [:ctxt | ctxt = methodReturnContext]

But it can be rewritten to do the same, but checking for the #homeMethod:

activeHome
| homeMethod |
self isBlockContext ifFalse: [^self].
homeMethod := self homeMethod.
^self findMethodContextSuchThat: [:ctxt | ctxt method == homeMethod]

With #homeMethod being implemented to delegate to the bock:

Context>>homeMethod
"Answer the method in which the receiver was defined, i.e. the context from which an ^-return ] should return from. Note: implemented to not need #home"

^ closureOrNil ifNil: [ self method ] ifNotNil: [ :closure | closure homeMethod ]

Where, if no #outerContext is available, it asks the CompiledBlock:

BlockClosure>>homeMethod
"return the home method. If no #home is available due to no outerContext, use the compiledBlock"
^ (self home
ifNotNil: [ :homeContext | homeContext ]
ifNil: [ self compiledBlock ]) method

Which uses the static  #outerCode chain (CompiledBlocks encode have a back-pointer to the enclosing block or method),
with #method following #outerCode until it reaches a CompiledMethod:

CompiledBlock>>method
"answer the compiled method that I am installed in, or nil if none.”
^self outerCode method

> > Blocks > ====== > Status: All tests green when compiling with ConstantBlockClosure (but the option is not yet enabled by default) > Work continues to reducing the use of #home, this week by using #homeMethod instead of "home method” > And there are more in need of review, for example: 11965-Implement-ContextactiveHome-without-using-home #12063 https://github.com/pharo-project/pharo/pull/12063 #activeHome returns the #home if it is currently on the stack, the debugger uses that to check if a “save and proceed” is possible when editing code in a Block. It is implemented to search up the sender chain until it finds the #home: activeHome | methodReturnContext | self isBlockContext ifFalse: [^self]. self sender ifNil: [^nil]. methodReturnContext := self methodReturnContext. ^self sender findContextSuchThat: [:ctxt | ctxt = methodReturnContext] But it can be rewritten to do the same, but checking for the #homeMethod: activeHome | homeMethod | self isBlockContext ifFalse: [^self]. homeMethod := self homeMethod. ^self findMethodContextSuchThat: [:ctxt | ctxt method == homeMethod] With #homeMethod being implemented to delegate to the bock: Context>>homeMethod "Answer the method in which the receiver was defined, i.e. the context from which an ^-return ] should return from. Note: implemented to not need #home" ^ closureOrNil ifNil: [ self method ] ifNotNil: [ :closure | closure homeMethod ] Where, if no #outerContext is available, it asks the CompiledBlock: BlockClosure>>homeMethod "return the home method. If no #home is available due to no outerContext, use the compiledBlock" ^ (self home ifNotNil: [ :homeContext | homeContext ] ifNil: [ self compiledBlock ]) method Which uses the static #outerCode chain (CompiledBlocks encode have a back-pointer to the enclosing block or method), with #method following #outerCode until it reaches a CompiledMethod: CompiledBlock>>method "answer the compiled method that I am installed in, or nil if none.” ^self outerCode method