Tue, 23 Nov 2010 13:22:55 -0800
6989984: Use standard include model for Hospot
Summary: Replaced MakeDeps and the includeDB files with more standardized solutions.
Reviewed-by: coleenp, kvn, kamg
duke@435 | 1 | /* |
stefank@2314 | 2 | * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 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. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
stefank@2314 | 25 | #ifndef SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP |
stefank@2314 | 26 | #define SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP |
stefank@2314 | 27 | |
stefank@2314 | 28 | #include "oops/constantPoolOop.hpp" |
stefank@2314 | 29 | #include "utilities/hashtable.hpp" |
stefank@2314 | 30 | |
duke@435 | 31 | class ResolutionErrorEntry; |
duke@435 | 32 | |
duke@435 | 33 | // ResolutionError objects are used to record errors encountered during |
duke@435 | 34 | // constant pool resolution (JVMS 5.4.3). |
duke@435 | 35 | |
duke@435 | 36 | class ResolutionErrorTable : public Hashtable { |
duke@435 | 37 | |
duke@435 | 38 | public: |
duke@435 | 39 | ResolutionErrorTable(int table_size); |
duke@435 | 40 | |
duke@435 | 41 | ResolutionErrorEntry* new_entry(int hash, constantPoolOop pool, int cp_index, symbolOop error); |
duke@435 | 42 | |
duke@435 | 43 | ResolutionErrorEntry* bucket(int i) { |
duke@435 | 44 | return (ResolutionErrorEntry*)Hashtable::bucket(i); |
duke@435 | 45 | } |
duke@435 | 46 | |
duke@435 | 47 | ResolutionErrorEntry** bucket_addr(int i) { |
duke@435 | 48 | return (ResolutionErrorEntry**)Hashtable::bucket_addr(i); |
duke@435 | 49 | } |
duke@435 | 50 | |
duke@435 | 51 | void add_entry(int index, ResolutionErrorEntry* new_entry) { |
duke@435 | 52 | Hashtable::add_entry(index, (HashtableEntry*)new_entry); |
duke@435 | 53 | } |
duke@435 | 54 | |
duke@435 | 55 | void add_entry(int index, unsigned int hash, |
duke@435 | 56 | constantPoolHandle pool, int which, symbolHandle error); |
duke@435 | 57 | |
duke@435 | 58 | |
duke@435 | 59 | // find error given the constant pool and constant pool index |
duke@435 | 60 | ResolutionErrorEntry* find_entry(int index, unsigned int hash, |
duke@435 | 61 | constantPoolHandle pool, int cp_index); |
duke@435 | 62 | |
duke@435 | 63 | |
duke@435 | 64 | unsigned int compute_hash(constantPoolHandle pool, int cp_index) { |
duke@435 | 65 | return (unsigned int) pool->identity_hash() + cp_index; |
duke@435 | 66 | } |
duke@435 | 67 | |
duke@435 | 68 | // purges unloaded entries from the table |
duke@435 | 69 | void purge_resolution_errors(BoolObjectClosure* is_alive); |
duke@435 | 70 | |
duke@435 | 71 | // this table keeps symbolOops alive |
duke@435 | 72 | void always_strong_classes_do(OopClosure* blk); |
duke@435 | 73 | |
duke@435 | 74 | // GC support. |
duke@435 | 75 | void oops_do(OopClosure* f); |
duke@435 | 76 | }; |
duke@435 | 77 | |
duke@435 | 78 | |
duke@435 | 79 | class ResolutionErrorEntry : public HashtableEntry { |
duke@435 | 80 | private: |
duke@435 | 81 | int _cp_index; |
duke@435 | 82 | symbolOop _error; |
duke@435 | 83 | |
duke@435 | 84 | public: |
duke@435 | 85 | constantPoolOop pool() const { return (constantPoolOop)literal(); } |
duke@435 | 86 | constantPoolOop* pool_addr() { return (constantPoolOop*)literal_addr(); } |
duke@435 | 87 | |
duke@435 | 88 | int cp_index() const { return _cp_index; } |
duke@435 | 89 | void set_cp_index(int cp_index) { _cp_index = cp_index; } |
duke@435 | 90 | |
duke@435 | 91 | symbolOop error() const { return _error; } |
duke@435 | 92 | void set_error(symbolOop e) { _error = e; } |
duke@435 | 93 | symbolOop* error_addr() { return &_error; } |
duke@435 | 94 | |
duke@435 | 95 | ResolutionErrorEntry* next() const { |
duke@435 | 96 | return (ResolutionErrorEntry*)HashtableEntry::next(); |
duke@435 | 97 | } |
duke@435 | 98 | |
duke@435 | 99 | ResolutionErrorEntry** next_addr() { |
duke@435 | 100 | return (ResolutionErrorEntry**)HashtableEntry::next_addr(); |
duke@435 | 101 | } |
duke@435 | 102 | |
duke@435 | 103 | // GC support |
duke@435 | 104 | void oops_do(OopClosure* blk); |
duke@435 | 105 | }; |
stefank@2314 | 106 | |
stefank@2314 | 107 | #endif // SHARE_VM_CLASSFILE_RESOLUTIONERRORS_HPP |