Skip to content

[Runtime] Targetize the layout of ValueWitnessTable. #18205

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

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

dcci
Copy link
Member

@dcci dcci commented Jul 25, 2018

From what I see the only fields are DATA_VALUE_WITNESS which
all have type size_t. I converted them to use the target-dependent
StoredSize. While I was around I fixed also isValueInline()
to do the right thing (it was using ValueBuffer instead of
TargetValueBuffer) and all the getters for the data value witnesses.

rdar://problem/41546568

@dcci dcci requested review from jckarter, rjmccall and DougGregor July 25, 2018 00:38
@dcci
Copy link
Member Author

dcci commented Jul 25, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a843ee999b4a70b1f4ad62fdb9e103947f36d907

@dcci dcci force-pushed the valuewittarget branch from a843ee9 to 787625a Compare July 25, 2018 00:53
@dcci
Copy link
Member Author

dcci commented Jul 25, 2018

Forgot to git add some bits. Updated.

@dcci
Copy link
Member Author

dcci commented Jul 25, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a843ee999b4a70b1f4ad62fdb9e103947f36d907

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a843ee999b4a70b1f4ad62fdb9e103947f36d907

@@ -301,16 +302,19 @@ struct ValueWitnessTable {
value_witness_types::LOWER_ID LOWER_ID;
Copy link
Contributor

@jckarter jckarter Jul 25, 2018

Choose a reason for hiding this comment

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

We'll also need to targetize this part. For the InProcess target these should be function pointers (which are the types in the value_witness_types namespace), otherwise they ought to be StoredPointers of the target pointer size.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yes, I missed these, thanks. It's not obvious to me how to generalize these, the best thing I was able to come up with is creating a new namespace target_value_witness_types with the target dependent types to be used in TargetValueWitnessTable. Would that make sense to you?

From what I see the only fields are DATA_VALUE_WITNESS which
all have type size_t. I converted them to use the target-dependent
`StoredSize`. While I was around I fixed also isValueInline()
to do the right thing (it was using ValueBuffer instead of
TargetValueBuffer) and all the getters for the data value witnesses.

<rdar://problem/41546568>
@dcci dcci force-pushed the valuewittarget branch from 787625a to 1c3c190 Compare July 25, 2018 18:38
@dcci
Copy link
Member Author

dcci commented Jul 25, 2018

Updated as @jckarter suggested. Thanks!

@dcci
Copy link
Member Author

dcci commented Jul 25, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 787625abe57d03627c06d82e5baf0256ef1cdfc2

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 787625abe57d03627c06d82e5baf0256ef1cdfc2

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This looks like a great solution, thanks!

@dcci dcci merged commit 44cccd0 into swiftlang:master Jul 25, 2018
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.

4 participants