Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Aug 9, 2024

Given a function that maps the old child heap types to new child heap
types, the new API takes care of copying the rest of the structure of a
given heap type into a TypeBuilder slot.

Use the new API in GlobalTypeRewriter::rebuildTypes. It will also be
used in an upcoming type optimization. This refactoring also required
adding the ability to clear the supertype of a TypeBuilder slot, which
was previously not possible.

@tlively tlively requested a review from kripken August 9, 2024 02:08
@tlively
Copy link
Member Author

tlively commented Aug 9, 2024

@kripken, I remember you suggested this recently. Do you remember where?

@tlively tlively force-pushed the type-builder-copy branch from 557138b to d7e09b4 Compare August 9, 2024 21:55
@kripken
Copy link
Member

kripken commented Aug 12, 2024

@tlively

I remember you suggested this recently. Do you remember where?

Ah, I think that was here: #6798 (comment)

// use it unmodified.
return type;
return typeBuilder.getTempRefType(ht, type.getNullability());
}
Copy link
Member

Choose a reason for hiding this comment

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

Did this code path change? Now it always calls getTempRefType, and I'm not sure why.

Copy link
Member Author

Choose a reason for hiding this comment

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

It just simplifies the code a tiny bit to always create a temp type. I can undo this if you prefer; it has no bearing on correctness.

Copy link
Member

Choose a reason for hiding this comment

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

Is it not slower to create a temp type?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess it does do more work compared to just returning the original type. Will revert.

Given a function that maps the old child heap types to new child heap
types, the new API takes care of copying the rest of the structure of a
given heap type into a TypeBuilder slot.

Use the new API in GlobalTypeRewriter::rebuildTypes. It will also be
used in an upcoming type optimization. This refactoring also required
adding the ability to clear the supertype of a TypeBuilder slot, which
was previously not possible.
@tlively tlively force-pushed the type-builder-copy branch from d7e09b4 to 392e83c Compare August 13, 2024 01:36
@tlively tlively merged commit d7955a3 into main Aug 13, 2024
@tlively tlively deleted the type-builder-copy branch August 13, 2024 04:32
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants