src/share/vm/ci/ciMetadata.hpp

Tue, 18 Jun 2013 12:31:07 -0700

author
johnc
date
Tue, 18 Jun 2013 12:31:07 -0700
changeset 5277
01522ca68fc7
parent 4267
bd7a7ce2e264
child 6876
710a3c8b516e
permissions
-rw-r--r--

8015237: Parallelize string table scanning during strong root processing
Summary: Parallelize the scanning of the intern string table by having each GC worker claim a given number of buckets. Changes were also reviewed by Per Liden <per.liden@oracle.com>.
Reviewed-by: tschatzl, stefank, twisti

coleenp@4037 1 /*
coleenp@4037 2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
coleenp@4037 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
coleenp@4037 4 *
coleenp@4037 5 * This code is free software; you can redistribute it and/or modify it
coleenp@4037 6 * under the terms of the GNU General Public License version 2 only, as
coleenp@4037 7 * published by the Free Software Foundation.
coleenp@4037 8 *
coleenp@4037 9 * This code is distributed in the hope that it will be useful, but WITHOUT
coleenp@4037 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
coleenp@4037 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
coleenp@4037 12 * version 2 for more details (a copy is included in the LICENSE file that
coleenp@4037 13 * accompanied this code).
coleenp@4037 14 *
coleenp@4037 15 * You should have received a copy of the GNU General Public License version
coleenp@4037 16 * 2 along with this work; if not, write to the Free Software Foundation,
coleenp@4037 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
coleenp@4037 18 *
coleenp@4037 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
coleenp@4037 20 * or visit www.oracle.com if you need additional information or have any
coleenp@4037 21 * questions.
coleenp@4037 22 *
coleenp@4037 23 */
coleenp@4037 24
coleenp@4037 25 #ifndef SHARE_VM_CI_CIMETADATA_HPP
coleenp@4037 26 #define SHARE_VM_CI_CIMETADATA_HPP
coleenp@4037 27
coleenp@4037 28 #include "ci/ciBaseObject.hpp"
coleenp@4037 29 #include "ci/ciClassList.hpp"
coleenp@4037 30 #include "memory/allocation.hpp"
coleenp@4037 31 #include "runtime/handles.hpp"
coleenp@4037 32 #include "runtime/jniHandles.hpp"
coleenp@4037 33
coleenp@4037 34 // ciMetadata
coleenp@4037 35 //
coleenp@4037 36 // Compiler interface to metadata object in the VM, not Java object.
coleenp@4037 37
coleenp@4037 38 class ciMetadata: public ciBaseObject {
coleenp@4037 39 CI_PACKAGE_ACCESS
coleenp@4037 40 friend class ciEnv;
coleenp@4037 41
coleenp@4037 42 protected:
coleenp@4037 43 Metadata* _metadata;
coleenp@4037 44
coleenp@4037 45 ciMetadata(): _metadata(NULL) {}
coleenp@4037 46 ciMetadata(Metadata* o): _metadata(o) {}
coleenp@4037 47
coleenp@4037 48 virtual bool is_classless() const { return false; }
coleenp@4037 49 public:
coleenp@4037 50 bool is_loaded() const { return _metadata != NULL || is_classless(); }
coleenp@4037 51
coleenp@4037 52 virtual bool is_metadata() const { return true; }
coleenp@4037 53
coleenp@4037 54 virtual bool is_type() const { return false; }
coleenp@4037 55 virtual bool is_cpcache() const { return false; }
coleenp@4037 56 virtual bool is_return_address() const { return false; }
coleenp@4037 57 virtual bool is_method() const { return false; }
coleenp@4037 58 virtual bool is_method_data() const { return false; }
coleenp@4037 59 virtual bool is_klass() const { return false; }
coleenp@4037 60 virtual bool is_instance_klass() const { return false; }
coleenp@4037 61 virtual bool is_array_klass() const { return false; }
coleenp@4037 62 virtual bool is_obj_array_klass() const { return false; }
coleenp@4037 63 virtual bool is_type_array_klass() const { return false; }
minqi@4267 64 virtual void dump_replay_data(outputStream* st) { /* do nothing */ }
coleenp@4037 65
coleenp@4037 66 ciMethod* as_method() {
coleenp@4037 67 assert(is_method(), "bad cast");
coleenp@4037 68 return (ciMethod*)this;
coleenp@4037 69 }
coleenp@4037 70 ciMethodData* as_method_data() {
coleenp@4037 71 assert(is_method_data(), "bad cast");
coleenp@4037 72 return (ciMethodData*)this;
coleenp@4037 73 }
coleenp@4037 74 ciSymbol* as_symbol() {
coleenp@4037 75 assert(is_symbol(), "bad cast");
coleenp@4037 76 return (ciSymbol*)this;
coleenp@4037 77 }
coleenp@4037 78 ciType* as_type() {
coleenp@4037 79 assert(is_type(), "bad cast");
coleenp@4037 80 return (ciType*)this;
coleenp@4037 81 }
coleenp@4037 82 ciReturnAddress* as_return_address() {
coleenp@4037 83 assert(is_return_address(), "bad cast");
coleenp@4037 84 return (ciReturnAddress*)this;
coleenp@4037 85 }
coleenp@4037 86 ciKlass* as_klass() {
coleenp@4037 87 assert(is_klass(), "bad cast");
coleenp@4037 88 return (ciKlass*)this;
coleenp@4037 89 }
coleenp@4037 90 ciInstanceKlass* as_instance_klass() {
coleenp@4037 91 assert(is_instance_klass(), "bad cast");
coleenp@4037 92 return (ciInstanceKlass*)this;
coleenp@4037 93 }
coleenp@4037 94 ciArrayKlass* as_array_klass() {
coleenp@4037 95 assert(is_array_klass(), "bad cast");
coleenp@4037 96 return (ciArrayKlass*)this;
coleenp@4037 97 }
coleenp@4037 98 ciObjArrayKlass* as_obj_array_klass() {
coleenp@4037 99 assert(is_obj_array_klass(), "bad cast");
coleenp@4037 100 return (ciObjArrayKlass*)this;
coleenp@4037 101 }
coleenp@4037 102 ciTypeArrayKlass* as_type_array_klass() {
coleenp@4037 103 assert(is_type_array_klass(), "bad cast");
coleenp@4037 104 return (ciTypeArrayKlass*)this;
coleenp@4037 105 }
coleenp@4037 106
coleenp@4037 107 Metadata* constant_encoding() { return _metadata; }
coleenp@4037 108
coleenp@4037 109 bool equals(ciMetadata* obj) const { return (this == obj); }
coleenp@4037 110
coleenp@4037 111 int hash() { return ident() * 31; } // ???
coleenp@4037 112
coleenp@4037 113 void print(outputStream* st);
coleenp@4037 114 virtual void print_impl(outputStream* st) {}
coleenp@4037 115 virtual const char* type_string() { return "ciMetadata"; }
coleenp@4037 116
coleenp@4037 117 void print() { print(tty); }
coleenp@4037 118 void print_metadata(outputStream* st = tty);
coleenp@4037 119
coleenp@4037 120 };
coleenp@4037 121 #endif // SHARE_VM_CI_CIMETADATA_HPP

mercurial