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

Add supernode for comparing a literal string #196

Merged
merged 7 commits into from
Dec 3, 2023

Conversation

smarr
Copy link
Member

@smarr smarr commented Dec 3, 2023

This PR is based on #185, and extracts the supernodes for the comparison with literal strings:

  • "someString" = var and var = "someString"
  • the various variations with locals, arguments, non-locals, and fields
  • fields for local and non-local access to self

…string comparions.

For the nil case in the string comparison, we store `nil` in a local static field to avoid type restrictions of the DSL.

Signed-off-by: Stefan Marr <[email protected]>

# Conflicts:
#	src/trufflesom/src/trufflesom/compiler/ParserAst.java
This node inlines the argument and field reading and does the string equal.
There's theoretical an early abort for non-object fields.
Though, we don't have those in our benchmarks.
Well, perhaps uninitialized fields.
Though, the structure of the lookup, and caching makes that tricky. Not sure it's worth optimizing that.

Signed-off-by: Stefan Marr <[email protected]>
Should be ensured in the caller.

Signed-off-by: Stefan Marr <[email protected]>
@smarr smarr mentioned this pull request Dec 3, 2023
4 tasks
@smarr smarr merged commit 1defdd7 into SOM-st:master Dec 3, 2023
2 checks passed
@smarr smarr deleted the supernode/string-equal branch December 3, 2023 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant