Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files
8252494: C2: TypeAryPtr::cast_to_autobox_cache does not use ptr_type
Remove dead definition of ptr_type in TypeAryPtr::cast_to_autobox_cache. Also remove
unnecessary cache parameter (always true) for simplicity.

Reviewed-by: shade, vlivanov, thartmann
  • Loading branch information
robcasloz authored and TobiHartmann committed Sep 11, 2020
1 parent 8777ded commit 9687dcabb65e5d0bad873290550a2b4cffa0eebc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
@@ -250,7 +250,7 @@ const Type* Type::make_from_constant(ciConstant constant, bool require_constant,
guarantee(require_constant || oop_constant->should_be_constant(), "con_type must get computed");
con_type = TypeOopPtr::make_from_constant(oop_constant, require_constant);
if (Compile::current()->eliminate_boxing() && is_autobox_cache) {
con_type = con_type->is_aryptr()->cast_to_autobox_cache(true);
con_type = con_type->is_aryptr()->cast_to_autobox_cache();
if (stable_dimension > 0) {
assert(FoldStableValues, "sanity");
@@ -4203,15 +4203,14 @@ int TypeAryPtr::stable_dimension() const {

const TypeAryPtr* TypeAryPtr::cast_to_autobox_cache(bool cache) const {
if (is_autobox_cache() == cache) return this;
const TypeAryPtr* TypeAryPtr::cast_to_autobox_cache() const {
if (is_autobox_cache()) return this;
const TypeOopPtr* etype = elem()->make_oopptr();
if (etype == NULL) return this;
// The pointers in the autobox arrays are always non-null.
TypePtr::PTR ptr_type = cache ? TypePtr::NotNull : TypePtr::AnyNull;
etype = etype->cast_to_ptr_type(TypePtr::NotNull)->is_oopptr();
const TypeAry* new_ary = TypeAry::make(etype, size(), is_stable());
return make(ptr(), const_oop(), new_ary, klass(), klass_is_exact(), _offset, _instance_id, _speculative, _inline_depth, cache);
return make(ptr(), const_oop(), new_ary, klass(), klass_is_exact(), _offset, _instance_id, _speculative, _inline_depth, /*is_autobox_cache=*/true);

@@ -1226,7 +1226,7 @@ class TypeAryPtr : public TypeOopPtr {
const TypeAryPtr* cast_to_stable(bool stable, int stable_dimension = 1) const;
int stable_dimension() const;

const TypeAryPtr* cast_to_autobox_cache(bool cache) const;
const TypeAryPtr* cast_to_autobox_cache() const;

static jint max_array_length(BasicType etype) ;

0 comments on commit 9687dca

Please sign in to comment.