Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context>>executedPC can be packaged in Context #17568

Open
Ducasse opened this issue Dec 27, 2024 · 0 comments
Open

Context>>executedPC can be packaged in Context #17568

Ducasse opened this issue Dec 27, 2024 · 0 comments

Comments

@Ducasse
Copy link
Member

Ducasse commented Dec 27, 2024

executedPC
	"Deeper in the stack the pc was already advanced one bytecode, so we need to go back
	this one bytecode, which can consist of multiple bytes. But on IR, we record the *last*
	bytecode offset as the offset of the IR instruction, which means we can just go back one"

	"if we are at the start, return the startpc"
	(pc == self startpc) ifTrue: [ ^self startpc ].

	"we need to guard for dead contexts (pc is nil)"
	^self isDead ifTrue: [ self endPC - 1] ifFalse: [ pc - 1]

is currently packaged in CompilerCore but this method could be packaged in the Context class package.

  • No need for an extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant