RFR[XS] 8214686 [lworld][c1] Crash when invoking methods on value array
Ioi Lam
ioi.lam at oracle.com
Mon Dec 3 04:22:53 UTC 2018
It seems like ciValueArrayKlass::exact_klass() is never called by C2.
However, C1 does call it when invoking vt_array.clone(), so I
implemented this function.
My question is -- will this change be a potential problem for C2? Is the
ShouldNotCallThis() there to catch problems in C2, or was it just never
implemented because it's not needed?
Thanks
- Ioi
diff -r f19715f86b32 src/hotspot/share/ci/ciValueArrayKlass.cpp
--- a/src/hotspot/share/ci/ciValueArrayKlass.cpp Sun Dec 02 20:00:41
2018 -0800
+++ b/src/hotspot/share/ci/ciValueArrayKlass.cpp Sun Dec 02 20:17:50
2018 -0800
@@ -25,6 +25,7 @@
#include "precompiled.hpp"
#include "ci/ciInstanceKlass.hpp"
#include "ci/ciValueArrayKlass.hpp"
+#include "ci/ciValueKlass.hpp"
#include "ci/ciSymbol.hpp"
#include "ci/ciUtilities.hpp"
#include "ci/ciUtilities.inline.hpp"
@@ -161,6 +162,13 @@
}
ciKlass* ciValueArrayKlass::exact_klass() {
- ShouldNotCallThis();
+ assert(element_klass()->is_valuetype(), "element type must be value
type");
+ if (element_klass()->is_loaded()) {
+ assert(element_klass()->as_value_klass()->exact_klass() != NULL, "must
be");
+ return this;
+ }
+
+ // TODO handle this
+ guarantee(false, "klass not loaded");
return NULL;
}
More information about the valhalla-dev
mailing list