8212774: Remove dead code touching Klass::_lower_dimension
Summary: Found dead code removal while looking at usage of Compile_lock. This dead code doesn't have Compile_lock but other code touching Klass::_{upper,lower}_dimension do.
Reviewed-by: shade
--- a/src/hotspot/share/oops/arrayKlass.hpp Mon Oct 22 12:43:15 2018 -0700
+++ b/src/hotspot/share/oops/arrayKlass.hpp Mon Oct 22 15:32:50 2018 -0400
@@ -61,11 +61,9 @@
inline Klass* higher_dimension_acquire() const; // load with acquire semantics
void set_higher_dimension(Klass* k) { _higher_dimension = k; }
inline void release_set_higher_dimension(Klass* k); // store with release semantics
- Klass** adr_higher_dimension() { return (Klass**)&this->_higher_dimension;}
Klass* lower_dimension() const { return _lower_dimension; }
void set_lower_dimension(Klass* k) { _lower_dimension = k; }
- Klass** adr_lower_dimension() { return (Klass**)&this->_lower_dimension;}
// offset of first element, including any padding for the sake of alignment
int array_header_in_bytes() const { return layout_helper_header_size(layout_helper()); }
--- a/src/hotspot/share/runtime/reflection.cpp Mon Oct 22 12:43:15 2018 -0700
+++ b/src/hotspot/share/runtime/reflection.cpp Mon Oct 22 15:32:50 2018 -0400
@@ -326,13 +326,6 @@
}
}
-#ifdef ASSERT
-static oop basic_type_arrayklass_to_mirror(Klass* basic_type_arrayklass, TRAPS) {
- BasicType type = TypeArrayKlass::cast(basic_type_arrayklass)->element_type();
- return Universe::java_mirror(type);
-}
-#endif
-
arrayOop Reflection::reflect_new_array(oop element_mirror, jint length, TRAPS) {
if (element_mirror == NULL) {
THROW_0(vmSymbols::java_lang_NullPointerException());
@@ -396,35 +389,6 @@
}
-oop Reflection::array_component_type(oop mirror, TRAPS) {
- if (java_lang_Class::is_primitive(mirror)) {
- return NULL;
- }
-
- Klass* klass = java_lang_Class::as_Klass(mirror);
- if (!klass->is_array_klass()) {
- return NULL;
- }
-
- oop result = java_lang_Class::component_mirror(mirror);
-#ifdef ASSERT
- oop result2 = NULL;
- if (ArrayKlass::cast(klass)->dimension() == 1) {
- if (klass->is_typeArray_klass()) {
- result2 = basic_type_arrayklass_to_mirror(klass, CHECK_NULL);
- } else {
- result2 = ObjArrayKlass::cast(klass)->element_klass()->java_mirror();
- }
- } else {
- Klass* lower_dim = ArrayKlass::cast(klass)->lower_dimension();
- assert(lower_dim->is_array_klass(), "just checking");
- result2 = lower_dim->java_mirror();
- }
- assert(oopDesc::equals(result, result2), "results must be consistent");
-#endif //ASSERT
- return result;
-}
-
static bool under_unsafe_anonymous_host(const InstanceKlass* ik, const InstanceKlass* unsafe_anonymous_host) {
DEBUG_ONLY(int inf_loop_check = 1000 * 1000 * 1000);
for (;;) {
--- a/src/hotspot/share/runtime/reflection.hpp Mon Oct 22 12:43:15 2018 -0700
+++ b/src/hotspot/share/runtime/reflection.hpp Mon Oct 22 15:32:50 2018 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -73,8 +73,6 @@
// Reflective array access. Returns type code. Throws ArrayIndexOutOfBoundsException.
static BasicType array_get(jvalue* value, arrayOop a, int index, TRAPS);
static void array_set(jvalue* value, arrayOop a, int index, BasicType value_type, TRAPS);
- // Returns mirror on array element type (NULL for basic type arrays and non-arrays).
- static oop array_component_type(oop mirror, TRAPS);
// Object creation
static arrayOop reflect_new_array(oop element_mirror, jint length, TRAPS);