Skip to content

Allow splitting of Truffle::CExt.set_mark_list_on_object. #3541

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

Closed
Closed
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/main/java/org/truffleruby/cext/CExtNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -1887,6 +1887,7 @@ Object addToMarkList(Object guardedObject,
}

@CoreMethod(names = "set_mark_list_on_object", onSingleton = true, required = 1)
@ReportPolymorphism
Copy link
Member

@eregon eregon Apr 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't have any effect because there is a single specialization instance possible for this node, so no way to trigger multiple and Node#reportPolymorphicSpecialize().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that there is no code generated related to the annotation with this change (I used graal master, but I don't think that makes a difference).

Copy link
Collaborator Author

@nirvdrum nirvdrum Apr 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you make WriteObjectFieldNode go polymorphic? I didn't see the extra splits until then. I may very well have it wrong, but I saw a bunch of Integer splits from the argc checks in cext_ruby go away after I made this change. But, I'm misattributing the changes, we can close this out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you make WriteObjectFieldNode go polymorphic?

I didn't try, no, I just looked at whether this annotation changed anything to the generated code and it looked like no, so should have no effect. It's a case Truffle should warn for, I filed an internal issue for that.

The Integer splits sounds strange, maybe something is redefining these Integer methods, even if it installs back the original ones after it will still invalidate the Assumptions permanently.
Could also be some some_integer == some_nonumeric_object somewhere, and that would end up calling some_nonumeric_object == some_integer which could cause splitting.
But for these Integer#{==,>=} calls they should always use Inlined*Node, unless these methods are redefined at some point, and these inline nodes like InlinedEqualNode do not even use IntegerNode.EqualNode and both sides should be clearly int in that code.

public abstract static class SetMarkList extends CoreMethodArrayArgumentsNode {

@Specialization
Expand Down
Loading