src/hotspot/share/opto/type.cpp
changeset 51078 fc6cfe40e32a
parent 49594 898ef81cbc0e
child 52441 6082c529aed8
equal deleted inserted replaced
51077:9baa91bc7567 51078:fc6cfe40e32a
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   250         // An oop is not scavengable if it is in the perm gen.
   250         // An oop is not scavengable if it is in the perm gen.
   251         const Type* con_type = NULL;
   251         const Type* con_type = NULL;
   252         ciObject* oop_constant = constant.as_object();
   252         ciObject* oop_constant = constant.as_object();
   253         if (oop_constant->is_null_object()) {
   253         if (oop_constant->is_null_object()) {
   254           con_type = Type::get_zero_type(T_OBJECT);
   254           con_type = Type::get_zero_type(T_OBJECT);
   255         } else if (require_constant || oop_constant->should_be_constant()) {
   255         } else {
       
   256           guarantee(require_constant || oop_constant->should_be_constant(), "con_type must get computed");
   256           con_type = TypeOopPtr::make_from_constant(oop_constant, require_constant);
   257           con_type = TypeOopPtr::make_from_constant(oop_constant, require_constant);
   257           if (con_type != NULL) {
   258           if (Compile::current()->eliminate_boxing() && is_autobox_cache) {
   258             if (Compile::current()->eliminate_boxing() && is_autobox_cache) {
   259             con_type = con_type->is_aryptr()->cast_to_autobox_cache(true);
   259               con_type = con_type->is_aryptr()->cast_to_autobox_cache(true);
   260           }
   260             }
   261           if (stable_dimension > 0) {
   261             if (stable_dimension > 0) {
   262             assert(FoldStableValues, "sanity");
   262               assert(FoldStableValues, "sanity");
   263             assert(!con_type->is_zero_type(), "default value for stable field");
   263               assert(!con_type->is_zero_type(), "default value for stable field");
   264             con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension);
   264               con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension);
       
   265             }
       
   266           }
   265           }
   267         }
   266         }
   268         if (is_narrow_oop) {
   267         if (is_narrow_oop) {
   269           con_type = con_type->make_narrowoop();
   268           con_type = con_type->make_narrowoop();
   270         }
   269         }