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
rename verifier related value-types, rename JVM_SIGNATURE_VALUETYPE, … #83
Conversation
…and a few minor renames
|
@hseigel This change now passes all automated pre-integration checks, type
Since the source branch of this PR was last updated there have been 2 commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge
|
Webrevs
|
/integrate |
@hseigel The following commits have been pushed to lworld since your change was applied:
Your commit was automatically rebased without conflicts. Pushed as commit 66c1d44. |
Harold,
Overall changes look good.
I've commented a few places where naming could be made more consistent (putting an underscore between "inline" and "type"). They are just suggestions, I'll let you decide to change names or not.
Thank you,
Fred
@@ -112,7 +112,7 @@ VerificationType StackMapFrame::set_locals_from_arg( | |||
sig = sig_copy; | |||
} | |||
if (ss.type() == T_VALUETYPE) { | |||
return VerificationType::valuetype_type(sig); | |||
return VerificationType::inlinetype_type(sig); |
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.
VerificationType::inlinetype_type looks weird.
Could we use VerificationType::inline_type instead, which is consistent with VerificationType::reference_type?
@@ -194,7 +194,7 @@ VerificationType StackMapReader::parse_verification_type(u1* flags, TRAPS) { | |||
_stream->stackmap_format_error("TBD something bad happened", THREAD); | |||
return VerificationType::bogus_type(); | |||
} | |||
return VerificationType::valuetype_type(fund_name); | |||
return VerificationType::inlinetype_type(fund_name); |
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.
VerificationType::inlinetype_type -> VerificationType::inline_type ?
assert(is_valuetype(), "called with a non-valuetype type"); | ||
assert(!is_null(), "valuetype is not null"); | ||
return (!from.is_null() && from.is_valuetype() && name() == from.name()); | ||
bool VerificationType::is_inlinetype_assignable_from(const VerificationType& from) const { |
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.
is_inlinetype_assignable_from() -> is_inline_type_assignable_from()
to be more consistent with other names?
return (!from.is_null() && from.is_valuetype() && name() == from.name()); | ||
bool VerificationType::is_inlinetype_assignable_from(const VerificationType& from) const { | ||
// Check that 'from' is not null, is an inline type, and is the same inline type. | ||
assert(is_inlinetype(), "called with a non-inlinetype type"); |
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.
is_inlinetype() -> is_inline_type() ?
@@ -153,8 +153,8 @@ class VerificationType { | |||
// any reference is assignable to reference_check. | |||
static VerificationType reference_check() | |||
{ return VerificationType(ReferenceQuery); } | |||
static VerificationType valuetype_check() | |||
{ return VerificationType(ValueTypeQuery); } | |||
static VerificationType inlinetype_check() |
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.
inlinetype_check() -> inline_type_check() ?
static VerificationType valuetype_type(Symbol* sh) { | ||
// For inline types, store the actual Symbol* and set the 3rd bit. | ||
// Provides a way for an inline type to be distinguished from a reference type. | ||
static VerificationType inlinetype_type(Symbol* sh) { |
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.
inlinetype_type() -> inline_type() ?
@@ -222,7 +222,7 @@ class VerificationType { | |||
return ((_u._data & Category2_2nd) == Category2_2nd); | |||
} | |||
bool is_reference_check() const { return _u._data == ReferenceQuery; } | |||
bool is_valuetype_check() const { return _u._data == ValueTypeQuery; } | |||
bool is_inlinetype_check() const { return _u._data == InlineTypeQuery; } |
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.
is_inlinetype_check() -> is_inline_type_check() ?
@@ -242,11 +242,11 @@ class VerificationType { | |||
bool is_double_array() const { return is_x_array(JVM_SIGNATURE_DOUBLE); } | |||
bool is_object_array() const { return is_x_array(JVM_SIGNATURE_CLASS); } | |||
bool is_array_array() const { return is_x_array(JVM_SIGNATURE_ARRAY); } | |||
bool is_value_array() const { return is_x_array(JVM_SIGNATURE_VALUETYPE); } | |||
bool is_inline_array() const { return is_x_array(JVM_SIGNATURE_INLINE_TYPE); } |
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.
The term "inline" alone can be misleading (is it about the element being an inline type, is it about the elements of the array being inlined in the array, is it about the array being inlined in something else, etc).
Here, the check is about the kind of elements stored in the array, so I would suggest "is_inline_type_array()".
@@ -263,10 +263,10 @@ class VerificationType { | |||
return VerificationType(is_long() ? Long_2nd : Double_2nd); | |||
} | |||
|
|||
static VerificationType change_ref_to_valuetype(VerificationType ref) { | |||
static VerificationType change_ref_to_inlinetype(VerificationType ref) { |
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.
change_ref_to_inlinetype() -> change_ref_to_inline_type() ?
@@ -588,9 +588,9 @@ void ErrorContext::stackmap_details(outputStream* ss, const Method* method) cons | |||
|
|||
// Methods in ClassVerifier | |||
|
|||
VerificationType reference_or_valuetype(InstanceKlass* klass) { | |||
VerificationType reference_or_inlinetype(InstanceKlass* klass) { |
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.
reference_or_inlinetype() -> reference_or_inline_type() ?
Mailing list message from John Rose on valhalla-dev: On Jun 16, 2020, at 6:25 AM, Frederic Parain <fparain at openjdk.java.net> wrote:
I actually have the opposite take on this (but it?s stylistic ? John |
This pull requiest renames JVM_SIGNATURE_VALUETYPE to JVM_SIGNATURE_INLINETYPE, renames verifier related value_type items to inline_type, and has a few other small changes.
Progress
Reviewers
Download
$ git fetch https://git.openjdk.java.net/valhalla pull/83/head:pull/83
$ git checkout pull/83