< prev index next >

src/hotspot/share/oops/cpCache.inline.hpp

Print this page

  1 /*
  2  * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  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
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *

 72   return (!is_f1_null()) && (_flags & (1 << has_appendix_shift)) != 0;
 73 }
 74 
 75 inline bool ConstantPoolCacheEntry::has_local_signature() const {
 76   return (!is_f1_null()) && (_flags & (1 << has_local_signature_shift)) != 0;
 77 }
 78 
 79 inline intx ConstantPoolCacheEntry::flags_ord() const   { return (intx)Atomic::load_acquire(&_flags); }
 80 
 81 inline bool ConstantPoolCacheEntry::indy_resolution_failed() const {
 82   intx flags = flags_ord();
 83   return (flags & (1 << indy_resolution_failed_shift)) != 0;
 84 }
 85 
 86 // Constructor
 87 inline ConstantPoolCache::ConstantPoolCache(int length,
 88                                             const intStack& inverse_index_map,
 89                                             const intStack& invokedynamic_inverse_index_map,
 90                                             const intStack& invokedynamic_references_map) :
 91                                                   _length(length),
 92                                                   _constant_pool(NULL) {

 93   CDS_JAVA_HEAP_ONLY(_archived_references_index = -1;)
 94   initialize(inverse_index_map, invokedynamic_inverse_index_map,
 95              invokedynamic_references_map);
 96   for (int i = 0; i < length; i++) {
 97     assert(entry_at(i)->is_f1_null(), "Failed to clear?");
 98   }
 99 }
100 
101 inline oop ConstantPoolCache::resolved_references() { return _resolved_references.resolve(); }
102 
103 #endif // SHARE_OOPS_CPCACHE_INLINE_HPP

  1 /*
  2  * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  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
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *

 72   return (!is_f1_null()) && (_flags & (1 << has_appendix_shift)) != 0;
 73 }
 74 
 75 inline bool ConstantPoolCacheEntry::has_local_signature() const {
 76   return (!is_f1_null()) && (_flags & (1 << has_local_signature_shift)) != 0;
 77 }
 78 
 79 inline intx ConstantPoolCacheEntry::flags_ord() const   { return (intx)Atomic::load_acquire(&_flags); }
 80 
 81 inline bool ConstantPoolCacheEntry::indy_resolution_failed() const {
 82   intx flags = flags_ord();
 83   return (flags & (1 << indy_resolution_failed_shift)) != 0;
 84 }
 85 
 86 // Constructor
 87 inline ConstantPoolCache::ConstantPoolCache(int length,
 88                                             const intStack& inverse_index_map,
 89                                             const intStack& invokedynamic_inverse_index_map,
 90                                             const intStack& invokedynamic_references_map) :
 91                                                   _length(length),
 92                                                   _constant_pool(NULL),
 93                                                   _marking_cycle(0) {
 94   CDS_JAVA_HEAP_ONLY(_archived_references_index = -1;)
 95   initialize(inverse_index_map, invokedynamic_inverse_index_map,
 96              invokedynamic_references_map);
 97   for (int i = 0; i < length; i++) {
 98     assert(entry_at(i)->is_f1_null(), "Failed to clear?");
 99   }
100 }
101 
102 inline oop ConstantPoolCache::resolved_references() { return _resolved_references.resolve(); }
103 
104 #endif // SHARE_OOPS_CPCACHE_INLINE_HPP
< prev index next >