comparison src/share/vm/ci/ciType.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 f95d63e2154a
children f1de9dbc914e
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 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_CITYPE_HPP 25 #ifndef SHARE_VM_CI_CITYPE_HPP
26 #define SHARE_VM_CI_CITYPE_HPP 26 #define SHARE_VM_CI_CITYPE_HPP
27 27
28 #include "ci/ciObject.hpp" 28 #include "ci/ciMetadata.hpp"
29 #include "oops/klassOop.hpp"
30 29
31 // ciType 30 // ciType
32 // 31 //
33 // This class represents either a class (T_OBJECT), array (T_ARRAY), 32 // This class represents either a class (T_OBJECT), array (T_ARRAY),
34 // or one of the primitive types such as T_INT. 33 // or one of the primitive types such as T_INT.
35 class ciType : public ciObject { 34 class ciType : public ciMetadata {
36 CI_PACKAGE_ACCESS 35 CI_PACKAGE_ACCESS
37 friend class ciKlass; 36 friend class ciKlass;
38 friend class ciReturnAddress; 37 friend class ciReturnAddress;
39 38
40 private: 39 private:
41 BasicType _basic_type; 40 BasicType _basic_type;
42 41
43 ciType(BasicType t); // for the primitive types only 42 ciType(BasicType t); // for primitive and unloaded types
44 ciType(KlassHandle k); // for subclasses (reference types) 43 ciType(KlassHandle k); // for subclasses (reference types)
45 ciType(ciKlass* klass); // for unloaded types
46 44
47 const char* type_string() { return "ciType"; } 45 const char* type_string() { return "ciType"; }
48 46
49 void print_impl(outputStream* st); 47 void print_impl(outputStream* st);
50 48
74 bool is_void() const { return basic_type() == T_VOID; } 72 bool is_void() const { return basic_type() == T_VOID; }
75 bool is_one_word() const { return size() == 1; } 73 bool is_one_word() const { return size() == 1; }
76 bool is_two_word() const { return size() == 2; } 74 bool is_two_word() const { return size() == 2; }
77 75
78 // What kind of ciObject is this? 76 // What kind of ciObject is this?
79 bool is_type() { return true; } 77 bool is_type() const { return true; }
80 bool is_classless() const { return is_primitive_type(); } 78 bool is_classless() const { return is_primitive_type(); }
81 79
82 virtual void print_name_on(outputStream* st); 80 virtual void print_name_on(outputStream* st);
83 void print_name() { 81 void print_name() {
84 print_name_on(tty); 82 print_name_on(tty);
104 const char* type_string() { return "ciReturnAddress"; } 102 const char* type_string() { return "ciReturnAddress"; }
105 103
106 void print_impl(outputStream* st); 104 void print_impl(outputStream* st);
107 105
108 public: 106 public:
109 bool is_return_address() { return true; } 107 bool is_return_address() const { return true; }
110 108
111 int bci() { return _bci; } 109 int bci() { return _bci; }
112 110
113 static ciReturnAddress* make(int bci); 111 static ciReturnAddress* make(int bci);
114 }; 112 };