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
L/Q again, step two #414
L/Q again, step two #414
Changes from 6 commits
463e9d3
415b20f
1c43608
e88d8a7
01fb495
bd77924
f5d27d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
@@ -30,6 +30,7 @@ | ||
#include "ci/ciTypeArrayKlass.hpp" | ||
#include "ci/ciUtilities.hpp" | ||
#include "ci/ciUtilities.inline.hpp" | ||
#include "oops/inlineKlass.inline.hpp" | ||
|
||
// ciArrayKlass | ||
// | ||
@@ -104,10 +105,27 @@ bool ciArrayKlass::is_leaf_type() { | ||
ciArrayKlass* ciArrayKlass::make(ciType* element_type) { | ||
if (element_type->is_primitive_type()) { | ||
return ciTypeArrayKlass::make(element_type->basic_type()); | ||
} else if (element_type->flatten_array()) { | ||
return ciFlatArrayKlass::make(element_type->as_klass()); | ||
} else { | ||
return ciObjArrayKlass::make(element_type->as_klass()); | ||
return make(element_type->as_klass(), element_type->is_null_free()); | ||
} | ||
} | ||
|
||
ciArrayKlass* ciArrayKlass::make(ciKlass* klass, bool null_free) { | ||
if (null_free && klass->is_loaded()) { | ||
GUARDED_VM_ENTRY( | ||
EXCEPTION_CONTEXT; | ||
Klass* ak = InlineKlass::cast(klass->get_Klass())->null_free_inline_array_klass(THREAD); | ||
if (HAS_PENDING_EXCEPTION) { | ||
CLEAR_PENDING_EXCEPTION; | ||
} else { | ||
if (ak != NULL && ak->is_flatArray_klass()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Code updated. |
||
return ciFlatArrayKlass::make(klass); | ||
} | ||
} | ||
) | ||
return ciObjArrayKlass::make(klass, true); | ||
} else { | ||
return ciObjArrayKlass::make(klass, null_free); | ||
} | ||
} | ||
|
||
@@ -475,7 +475,8 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass, | ||
require_local); | ||
if (elem_klass != NULL && elem_klass->is_loaded()) { | ||
// Now make an array for it | ||
return ciArrayKlass::make(elem_klass); | ||
bool null_free_array = sym->is_Q_array_signature() && sym->char_at(1) == JVM_SIGNATURE_INLINE_TYPE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with is_Q_array_signature() is that it returns true for arrays of any dimension with the last dimension element klass being a null-free primitive class. It returns true for [QFoo; but also for [[[QFoo;. But for the [[[QFoo; array, the first two dimensions are regular nullable object arrays, only the last array is a null-free array (possibly flattened). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, right. Thanks for the explanation! |
||
return ciArrayKlass::make(elem_klass, null_free_array); | ||
} | ||
} | ||
|
||
@@ -47,6 +47,7 @@ class ciKlass : public ciType { | ||
friend class ciReceiverTypeData; | ||
friend class ciSignature; | ||
friend class ciFlatArrayKlass; | ||
friend class ciArrayKlass; | ||
|
||
private: | ||
ciSymbol* _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.
Would you mind making the same change in
c1_CodeStubs_aarch64.cpp
to keep them in sync?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.
Sure, sorry for the breakage of the aarch64 platform.
Fred