1 #ifdef USE_PRAGMA_IDENT_SRC
2 #pragma ident "@(#)ciObjectFactory.cpp 1.39 07/05/17 15:50:05 JVM"
3 #endif
4 /*
5 * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
107 symbolHandle sym_handle = vmSymbolHandles::symbol_handle_at((vmSymbols::SID) i);
108 assert(vmSymbols::find_sid(sym_handle()) == i, "1-1 mapping");
109 ciSymbol* sym = new (_arena) ciSymbol(sym_handle);
110 init_ident_of(sym);
111 _shared_ci_symbols[i] = sym;
112 }
113 #ifdef ASSERT
114 for (i = vmSymbols::FIRST_SID; i < vmSymbols::SID_LIMIT; i++) {
115 symbolHandle sym_handle = vmSymbolHandles::symbol_handle_at((vmSymbols::SID) i);
116 ciSymbol* sym = vm_symbol_at((vmSymbols::SID) i);
117 assert(sym->get_oop() == sym_handle(), "oop must match");
118 }
119 assert(ciSymbol::void_class_signature()->get_oop() == vmSymbols::void_class_signature(), "spot check");
120 #endif
121 }
122
123 _ci_objects = new (_arena) GrowableArray<ciObject*>(_arena, 64, 0, NULL);
124
125 for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) {
126 BasicType t = (BasicType)i;
127 if (type2name(t) != NULL && t != T_OBJECT && t != T_ARRAY) {
128 ciType::_basic_types[t] = new (_arena) ciType(t);
129 init_ident_of(ciType::_basic_types[t]);
130 }
131 }
132
133 ciEnv::_null_object_instance = new (_arena) ciNullObject();
134 init_ident_of(ciEnv::_null_object_instance);
135 ciEnv::_method_klass_instance =
136 get(Universe::methodKlassObj())->as_method_klass();
137 ciEnv::_symbol_klass_instance =
138 get(Universe::symbolKlassObj())->as_symbol_klass();
139 ciEnv::_klass_klass_instance =
140 get(Universe::klassKlassObj())->as_klass_klass();
141 ciEnv::_instance_klass_klass_instance =
142 get(Universe::instanceKlassKlassObj())
143 ->as_instance_klass_klass();
144 ciEnv::_type_array_klass_klass_instance =
145 get(Universe::typeArrayKlassKlassObj())
146 ->as_type_array_klass_klass();
147 ciEnv::_obj_array_klass_klass_instance =
|
1 #ifdef USE_PRAGMA_IDENT_SRC
2 #pragma ident "@(#)ciObjectFactory.cpp 1.39 07/05/17 15:50:05 JVM"
3 #endif
4 /*
5 * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 *
8 * This code is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 only, as
10 * published by the Free Software Foundation.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 *
107 symbolHandle sym_handle = vmSymbolHandles::symbol_handle_at((vmSymbols::SID) i);
108 assert(vmSymbols::find_sid(sym_handle()) == i, "1-1 mapping");
109 ciSymbol* sym = new (_arena) ciSymbol(sym_handle);
110 init_ident_of(sym);
111 _shared_ci_symbols[i] = sym;
112 }
113 #ifdef ASSERT
114 for (i = vmSymbols::FIRST_SID; i < vmSymbols::SID_LIMIT; i++) {
115 symbolHandle sym_handle = vmSymbolHandles::symbol_handle_at((vmSymbols::SID) i);
116 ciSymbol* sym = vm_symbol_at((vmSymbols::SID) i);
117 assert(sym->get_oop() == sym_handle(), "oop must match");
118 }
119 assert(ciSymbol::void_class_signature()->get_oop() == vmSymbols::void_class_signature(), "spot check");
120 #endif
121 }
122
123 _ci_objects = new (_arena) GrowableArray<ciObject*>(_arena, 64, 0, NULL);
124
125 for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) {
126 BasicType t = (BasicType)i;
127 if (type2name(t) != NULL && t != T_OBJECT && t != T_ARRAY && t != T_NARROWOOP) {
128 ciType::_basic_types[t] = new (_arena) ciType(t);
129 init_ident_of(ciType::_basic_types[t]);
130 }
131 }
132
133 ciEnv::_null_object_instance = new (_arena) ciNullObject();
134 init_ident_of(ciEnv::_null_object_instance);
135 ciEnv::_method_klass_instance =
136 get(Universe::methodKlassObj())->as_method_klass();
137 ciEnv::_symbol_klass_instance =
138 get(Universe::symbolKlassObj())->as_symbol_klass();
139 ciEnv::_klass_klass_instance =
140 get(Universe::klassKlassObj())->as_klass_klass();
141 ciEnv::_instance_klass_klass_instance =
142 get(Universe::instanceKlassKlassObj())
143 ->as_instance_klass_klass();
144 ciEnv::_type_array_klass_klass_instance =
145 get(Universe::typeArrayKlassKlassObj())
146 ->as_type_array_klass_klass();
147 ciEnv::_obj_array_klass_klass_instance =
|