1137N/A/*
1472N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
1137N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1137N/A *
1137N/A * This code is free software; you can redistribute it and/or modify it
1137N/A * under the terms of the GNU General Public License version 2 only, as
1137N/A * published by the Free Software Foundation.
1137N/A *
1137N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1137N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1137N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1137N/A * version 2 for more details (a copy is included in the LICENSE file that
1137N/A * accompanied this code).
1137N/A *
1137N/A * You should have received a copy of the GNU General Public License version
1137N/A * 2 along with this work; if not, write to the Free Software Foundation,
1137N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1137N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
1137N/A *
1137N/A */
1137N/A
1879N/A#ifndef SHARE_VM_CI_CICPCACHE_HPP
1879N/A#define SHARE_VM_CI_CICPCACHE_HPP
1879N/A
1879N/A#include "ci/ciClassList.hpp"
1879N/A#include "ci/ciObject.hpp"
1879N/A#include "oops/cpCacheOop.hpp"
1879N/A
1137N/A// ciCPCache
1137N/A//
1137N/A// This class represents a constant pool cache.
1137N/A//
1137N/A// Note: This class is called ciCPCache as ciConstantPoolCache is used
1137N/A// for something different.
1137N/Aclass ciCPCache : public ciObject {
1522N/Aprivate:
1522N/A constantPoolCacheOop get_cpCacheOop() { // must be called inside a VM_ENTRY_MARK
1522N/A return (constantPoolCacheOop) get_oop();
1522N/A }
1522N/A
1522N/A ConstantPoolCacheEntry* entry_at(int i) {
1522N/A int raw_index = i;
1522N/A if (constantPoolCacheOopDesc::is_secondary_index(i))
1522N/A raw_index = constantPoolCacheOopDesc::decode_secondary_index(i);
1522N/A return get_cpCacheOop()->entry_at(raw_index);
1522N/A }
1522N/A
1137N/Apublic:
1137N/A ciCPCache(constantPoolCacheHandle cpcache) : ciObject(cpcache) {}
1137N/A
1137N/A // What kind of ciObject is this?
1137N/A bool is_cpcache() const { return true; }
1137N/A
1137N/A // Get the offset in bytes from the oop to the f1 field of the
1137N/A // requested entry.
1137N/A size_t get_f1_offset(int index);
1137N/A
1295N/A bool is_f1_null_at(int index);
1295N/A
1522N/A int get_pool_index(int index);
1522N/A
1137N/A void print();
1137N/A};
1879N/A
1879N/A#endif // SHARE_VM_CI_CICPCACHE_HPP