comparison src/share/vm/ci/ciSymbol.hpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 1d7922586cf6
children e522a00b91aa bd7a7ce2e264
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
23 */ 23 */
24 24
25 #ifndef SHARE_VM_CI_CISYMBOL_HPP 25 #ifndef SHARE_VM_CI_CISYMBOL_HPP
26 #define SHARE_VM_CI_CISYMBOL_HPP 26 #define SHARE_VM_CI_CISYMBOL_HPP
27 27
28 #include "ci/ciBaseObject.hpp"
28 #include "ci/ciObject.hpp" 29 #include "ci/ciObject.hpp"
29 #include "ci/ciObjectFactory.hpp" 30 #include "ci/ciObjectFactory.hpp"
30 #include "classfile/vmSymbols.hpp" 31 #include "classfile/vmSymbols.hpp"
31 #include "oops/symbol.hpp" 32 #include "oops/symbol.hpp"
32 33
33 // ciSymbol 34 // ciSymbol
34 // 35 //
35 // This class represents a Symbol* in the HotSpot virtual 36 // This class represents a Symbol* in the HotSpot virtual
36 // machine. 37 // machine.
37 class ciSymbol : public ResourceObj { 38 class ciSymbol : public ciBaseObject {
38 Symbol* _symbol; 39 Symbol* _symbol;
39 uint _ident;
40 40
41 CI_PACKAGE_ACCESS 41 CI_PACKAGE_ACCESS
42 // These friends all make direct use of get_symbol: 42 // These friends all make direct use of get_symbol:
43 friend class ciEnv; 43 friend class ciEnv;
44 friend class ciInstanceKlass; 44 friend class ciInstanceKlass;
63 const jbyte* base(); 63 const jbyte* base();
64 64
65 // Make a ciSymbol from a C string (implementation). 65 // Make a ciSymbol from a C string (implementation).
66 static ciSymbol* make_impl(const char* s); 66 static ciSymbol* make_impl(const char* s);
67 67
68 void set_ident(uint id) { _ident = id; }
69 public: 68 public:
70 // A number unique to this object.
71 uint ident() { return _ident; }
72
73 // The enumeration ID from vmSymbols, or vmSymbols::NO_SID if none. 69 // The enumeration ID from vmSymbols, or vmSymbols::NO_SID if none.
74 vmSymbols::SID sid() const { return _sid; } 70 vmSymbols::SID sid() const { return _sid; }
75 71
76 // The text of the symbol as a null-terminated utf8 string. 72 // The text of the symbol as a null-terminated utf8 string.
77 const char* as_utf8(); 73 const char* as_utf8();
103 99
104 void print() { 100 void print() {
105 _symbol->print(); 101 _symbol->print();
106 } 102 }
107 103
104 virtual bool is_symbol() const { return true; }
105
108 // Are two ciSymbols equal? 106 // Are two ciSymbols equal?
109 bool equals(ciSymbol* obj) { return this->_symbol == obj->get_symbol(); } 107 bool equals(ciSymbol* obj) { return this->_symbol == obj->get_symbol(); }
110 108
111 bool is_signature_polymorphic_name() const; 109 bool is_signature_polymorphic_name() const;
112 }; 110 };