From 4e1dd4daba5a619bbbc9720fdd509e609d6f0032 Mon Sep 17 00:00:00 2001 From: Marc Chevalier Date: Thu, 7 May 2026 07:28:52 +0000 Subject: [PATCH] 8383851: TypeInstPtr::get_const_boxed_value is unused since JDK-8149813 Reviewed-by: aseoane, thartmann --- src/hotspot/share/opto/type.cpp | 23 ----------------------- src/hotspot/share/opto/type.hpp | 3 --- 2 files changed, 26 deletions(-) diff --git a/src/hotspot/share/opto/type.cpp b/src/hotspot/share/opto/type.cpp index f05cc5ae1e0..6dd0cc183e1 100644 --- a/src/hotspot/share/opto/type.cpp +++ b/src/hotspot/share/opto/type.cpp @@ -4066,29 +4066,6 @@ const TypeInterfaces* TypePtr::interfaces(ciKlass*& k, bool klass, bool interfac return TypeAryPtr::_array_interfaces; } -/** - * Create constant type for a constant boxed value - */ -const Type* TypeInstPtr::get_const_boxed_value() const { - assert(is_ptr_to_boxed_value(), "should be called only for boxed value"); - assert((const_oop() != nullptr), "should be called only for constant object"); - ciConstant constant = const_oop()->as_instance()->field_value_by_offset(offset()); - BasicType bt = constant.basic_type(); - switch (bt) { - case T_BOOLEAN: return TypeInt::make(constant.as_boolean()); - case T_INT: return TypeInt::make(constant.as_int()); - case T_CHAR: return TypeInt::make(constant.as_char()); - case T_BYTE: return TypeInt::make(constant.as_byte()); - case T_SHORT: return TypeInt::make(constant.as_short()); - case T_FLOAT: return TypeF::make(constant.as_float()); - case T_DOUBLE: return TypeD::make(constant.as_double()); - case T_LONG: return TypeLong::make(constant.as_long()); - default: break; - } - fatal("Invalid boxed value type '%s'", type2name(bt)); - return nullptr; -} - //------------------------------cast_to_ptr_type------------------------------- const TypeInstPtr* TypeInstPtr::cast_to_ptr_type(PTR ptr) const { if( ptr == _ptr ) return this; diff --git a/src/hotspot/share/opto/type.hpp b/src/hotspot/share/opto/type.hpp index 8ee0f06688b..79777c82cc7 100644 --- a/src/hotspot/share/opto/type.hpp +++ b/src/hotspot/share/opto/type.hpp @@ -1586,9 +1586,6 @@ public: return make(ptr, k, interfaces, xk, o, offset, instance_id); } - /** Create constant type for a constant boxed value */ - const Type* get_const_boxed_value() const; - // If this is a java.lang.Class constant, return the type for it or null. // Pass to Type::get_const_type to turn it to a type, which will usually // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc.