comparison src/share/vm/ci/ciType.cpp @ 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 070d523b96a7
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.
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "ci/ciEnv.hpp"
26 #include "ci/ciType.hpp" 27 #include "ci/ciType.hpp"
27 #include "ci/ciUtilities.hpp" 28 #include "ci/ciUtilities.hpp"
28 #include "classfile/systemDictionary.hpp" 29 #include "classfile/systemDictionary.hpp"
29 #include "oops/oop.inline.hpp" 30 #include "oops/oop.inline.hpp"
30 31
36 // or one of the primitive types such as T_INT. 37 // or one of the primitive types such as T_INT.
37 38
38 // ------------------------------------------------------------------ 39 // ------------------------------------------------------------------
39 // ciType::ciType 40 // ciType::ciType
40 // 41 //
41 ciType::ciType(BasicType basic_type) : ciObject() { 42 ciType::ciType(BasicType basic_type) : ciMetadata() {
42 assert(basic_type >= T_BOOLEAN && basic_type <= T_CONFLICT, "range check"); 43 assert(basic_type >= T_BOOLEAN && basic_type <= T_CONFLICT, "range check");
43 assert(basic_type != T_OBJECT && basic_type != T_ARRAY, "not a reference type");
44 _basic_type = basic_type; 44 _basic_type = basic_type;
45 } 45 }
46 46
47 ciType::ciType(KlassHandle k) : ciObject(k) { 47 ciType::ciType(KlassHandle k) : ciMetadata(k()) {
48 _basic_type = Klass::cast(k())->oop_is_array() ? T_ARRAY : T_OBJECT; 48 _basic_type = Klass::cast(k())->oop_is_array() ? T_ARRAY : T_OBJECT;
49 }
50
51 ciType::ciType(ciKlass* klass) : ciObject(klass) {
52 _basic_type = klass->is_array_klass_klass() ? T_ARRAY : T_OBJECT;
53 } 49 }
54 50
55 51
56 // ------------------------------------------------------------------ 52 // ------------------------------------------------------------------
57 // ciType::is_subtype_of 53 // ciType::is_subtype_of
85 // ------------------------------------------------------------------ 81 // ------------------------------------------------------------------
86 // ciType::java_mirror 82 // ciType::java_mirror
87 // 83 //
88 ciInstance* ciType::java_mirror() { 84 ciInstance* ciType::java_mirror() {
89 VM_ENTRY_MARK; 85 VM_ENTRY_MARK;
90 return CURRENT_THREAD_ENV->get_object(Universe::java_mirror(basic_type()))->as_instance(); 86 return CURRENT_THREAD_ENV->get_instance(Universe::java_mirror(basic_type()));
91 } 87 }
92 88
93 // ------------------------------------------------------------------ 89 // ------------------------------------------------------------------
94 // ciType::box_klass 90 // ciType::box_klass
95 // 91 //
98 94
99 // Void is "boxed" with a null. 95 // Void is "boxed" with a null.
100 if (basic_type() == T_VOID) return NULL; 96 if (basic_type() == T_VOID) return NULL;
101 97
102 VM_ENTRY_MARK; 98 VM_ENTRY_MARK;
103 return CURRENT_THREAD_ENV->get_object(SystemDictionary::box_klass(basic_type()))->as_instance_klass(); 99 return CURRENT_THREAD_ENV->get_instance_klass(SystemDictionary::box_klass(basic_type()));
104 } 100 }
105 101
106 102
107 // ------------------------------------------------------------------ 103 // ------------------------------------------------------------------
108 // ciType::make 104 // ciType::make