-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[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
Conversation
@swift-ci please test |
Build failed |
Forgot to git add some bits. Updated. |
@swift-ci please test |
Build failed |
Build failed |
include/swift/ABI/Metadata.h
Outdated
@@ -301,16 +302,19 @@ struct ValueWitnessTable { | |||
value_witness_types::LOWER_ID LOWER_ID; |
There was a problem hiding this comment.
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 StoredPointer
s of the target pointer size.
There was a problem hiding this comment.
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>
Updated as @jckarter suggested. Thanks! |
@swift-ci please test |
Build failed |
Build failed |
There was a problem hiding this 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!
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