Wed, 12 Oct 2011 21:00:13 -0700
7092712: JSR 292: unloaded invokedynamic call sites can lead to a crash with signature types not on BCP
Reviewed-by: jrose, never
twisti@1572 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
twisti@1572 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
twisti@1572 | 4 | * |
twisti@1572 | 5 | * This code is free software; you can redistribute it and/or modify it |
twisti@1572 | 6 | * under the terms of the GNU General Public License version 2 only, as |
twisti@1572 | 7 | * published by the Free Software Foundation. |
twisti@1572 | 8 | * |
twisti@1572 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
twisti@1572 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
twisti@1572 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
twisti@1572 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
twisti@1572 | 13 | * accompanied this code). |
twisti@1572 | 14 | * |
twisti@1572 | 15 | * You should have received a copy of the GNU General Public License version |
twisti@1572 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
twisti@1572 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
twisti@1572 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
twisti@1572 | 22 | * |
twisti@1572 | 23 | */ |
twisti@1572 | 24 | |
stefank@2314 | 25 | #ifndef SHARE_VM_CI_CICPCACHE_HPP |
stefank@2314 | 26 | #define SHARE_VM_CI_CICPCACHE_HPP |
stefank@2314 | 27 | |
stefank@2314 | 28 | #include "ci/ciClassList.hpp" |
stefank@2314 | 29 | #include "ci/ciObject.hpp" |
stefank@2314 | 30 | #include "oops/cpCacheOop.hpp" |
stefank@2314 | 31 | |
twisti@1572 | 32 | // ciCPCache |
twisti@1572 | 33 | // |
twisti@1572 | 34 | // This class represents a constant pool cache. |
twisti@1572 | 35 | // |
twisti@1572 | 36 | // Note: This class is called ciCPCache as ciConstantPoolCache is used |
twisti@1572 | 37 | // for something different. |
twisti@1572 | 38 | class ciCPCache : public ciObject { |
jrose@1957 | 39 | private: |
jrose@1957 | 40 | constantPoolCacheOop get_cpCacheOop() { // must be called inside a VM_ENTRY_MARK |
jrose@1957 | 41 | return (constantPoolCacheOop) get_oop(); |
jrose@1957 | 42 | } |
jrose@1957 | 43 | |
jrose@1957 | 44 | ConstantPoolCacheEntry* entry_at(int i) { |
jrose@1957 | 45 | int raw_index = i; |
jrose@1957 | 46 | if (constantPoolCacheOopDesc::is_secondary_index(i)) |
jrose@1957 | 47 | raw_index = constantPoolCacheOopDesc::decode_secondary_index(i); |
jrose@1957 | 48 | return get_cpCacheOop()->entry_at(raw_index); |
jrose@1957 | 49 | } |
jrose@1957 | 50 | |
twisti@1572 | 51 | public: |
twisti@1572 | 52 | ciCPCache(constantPoolCacheHandle cpcache) : ciObject(cpcache) {} |
twisti@1572 | 53 | |
twisti@1572 | 54 | // What kind of ciObject is this? |
twisti@1572 | 55 | bool is_cpcache() const { return true; } |
twisti@1572 | 56 | |
twisti@1572 | 57 | // Get the offset in bytes from the oop to the f1 field of the |
twisti@1572 | 58 | // requested entry. |
twisti@1572 | 59 | size_t get_f1_offset(int index); |
twisti@1572 | 60 | |
twisti@1730 | 61 | bool is_f1_null_at(int index); |
twisti@1730 | 62 | |
jrose@1957 | 63 | int get_pool_index(int index); |
jrose@1957 | 64 | |
twisti@1572 | 65 | void print(); |
twisti@1572 | 66 | }; |
stefank@2314 | 67 | |
stefank@2314 | 68 | #endif // SHARE_VM_CI_CICPCACHE_HPP |