Mercurial > hg > truffle
comparison src/share/vm/ci/ciEnv.hpp @ 1339:09ac706c2623
Merge
author | asaha |
---|---|
date | Wed, 24 Mar 2010 17:16:33 -0700 |
parents | 6deeaebad47a |
children | b4776199210f |
comparison
equal
deleted
inserted
replaced
1338:f5dd08ad65df | 1339:09ac706c2623 |
---|---|
1 /* | 1 /* |
2 * Copyright 1999-2009 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1999-2010 Sun Microsystems, Inc. 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. |
55 | 55 |
56 // Cache Jvmti state | 56 // Cache Jvmti state |
57 bool _jvmti_can_hotswap_or_post_breakpoint; | 57 bool _jvmti_can_hotswap_or_post_breakpoint; |
58 bool _jvmti_can_examine_or_deopt_anywhere; | 58 bool _jvmti_can_examine_or_deopt_anywhere; |
59 bool _jvmti_can_access_local_variables; | 59 bool _jvmti_can_access_local_variables; |
60 bool _jvmti_can_post_exceptions; | 60 bool _jvmti_can_post_on_exceptions; |
61 | 61 |
62 // Cache DTrace flags | 62 // Cache DTrace flags |
63 bool _dtrace_extended_probes; | 63 bool _dtrace_extended_probes; |
64 bool _dtrace_monitor_probes; | 64 bool _dtrace_monitor_probes; |
65 bool _dtrace_method_probes; | 65 bool _dtrace_method_probes; |
72 static ciKlassKlass* _klass_klass_instance; | 72 static ciKlassKlass* _klass_klass_instance; |
73 static ciInstanceKlassKlass* _instance_klass_klass_instance; | 73 static ciInstanceKlassKlass* _instance_klass_klass_instance; |
74 static ciTypeArrayKlassKlass* _type_array_klass_klass_instance; | 74 static ciTypeArrayKlassKlass* _type_array_klass_klass_instance; |
75 static ciObjArrayKlassKlass* _obj_array_klass_klass_instance; | 75 static ciObjArrayKlassKlass* _obj_array_klass_klass_instance; |
76 | 76 |
77 static ciInstanceKlass* _ArrayStoreException; | 77 #define WK_KLASS_DECL(name, ignore_s, ignore_o) static ciInstanceKlass* _##name; |
78 static ciInstanceKlass* _Class; | 78 WK_KLASSES_DO(WK_KLASS_DECL) |
79 static ciInstanceKlass* _ClassCastException; | 79 #undef WK_KLASS_DECL |
80 static ciInstanceKlass* _Object; | |
81 static ciInstanceKlass* _Throwable; | |
82 static ciInstanceKlass* _Thread; | |
83 static ciInstanceKlass* _OutOfMemoryError; | |
84 static ciInstanceKlass* _String; | |
85 | 80 |
86 static ciSymbol* _unloaded_cisymbol; | 81 static ciSymbol* _unloaded_cisymbol; |
87 static ciInstanceKlass* _unloaded_ciinstance_klass; | 82 static ciInstanceKlass* _unloaded_ciinstance_klass; |
88 static ciObjArrayKlass* _unloaded_ciobjarrayklass; | 83 static ciObjArrayKlass* _unloaded_ciobjarrayklass; |
89 | 84 |
94 ciInstance* _NullPointerException_instance; | 89 ciInstance* _NullPointerException_instance; |
95 ciInstance* _ArithmeticException_instance; | 90 ciInstance* _ArithmeticException_instance; |
96 ciInstance* _ArrayIndexOutOfBoundsException_instance; | 91 ciInstance* _ArrayIndexOutOfBoundsException_instance; |
97 ciInstance* _ArrayStoreException_instance; | 92 ciInstance* _ArrayStoreException_instance; |
98 ciInstance* _ClassCastException_instance; | 93 ciInstance* _ClassCastException_instance; |
94 | |
95 ciInstance* _the_null_string; // The Java string "null" | |
96 ciInstance* _the_min_jint_string; // The Java string "-2147483648" | |
99 | 97 |
100 // Look up a klass by name from a particular class loader (the accessor's). | 98 // Look up a klass by name from a particular class loader (the accessor's). |
101 // If require_local, result must be defined in that class loader, or NULL. | 99 // If require_local, result must be defined in that class loader, or NULL. |
102 // If !require_local, a result from remote class loader may be reported, | 100 // If !require_local, a result from remote class loader may be reported, |
103 // if sufficient class loader constraints exist such that initiating | 101 // if sufficient class loader constraints exist such that initiating |
112 ciKlass* get_klass_by_name(ciKlass* accessing_klass, | 110 ciKlass* get_klass_by_name(ciKlass* accessing_klass, |
113 ciSymbol* klass_name, | 111 ciSymbol* klass_name, |
114 bool require_local); | 112 bool require_local); |
115 | 113 |
116 // Constant pool access. | 114 // Constant pool access. |
117 ciKlass* get_klass_by_index(ciInstanceKlass* loading_klass, | 115 ciKlass* get_klass_by_index(constantPoolHandle cpool, |
118 int klass_index, | 116 int klass_index, |
119 bool& is_accessible); | 117 bool& is_accessible, |
120 ciConstant get_constant_by_index(ciInstanceKlass* loading_klass, | 118 ciInstanceKlass* loading_klass); |
121 int constant_index); | 119 ciConstant get_constant_by_index(constantPoolHandle cpool, |
120 int constant_index, | |
121 ciInstanceKlass* accessor); | |
122 bool is_unresolved_string(ciInstanceKlass* loading_klass, | 122 bool is_unresolved_string(ciInstanceKlass* loading_klass, |
123 int constant_index) const; | 123 int constant_index) const; |
124 bool is_unresolved_klass(ciInstanceKlass* loading_klass, | 124 bool is_unresolved_klass(ciInstanceKlass* loading_klass, |
125 int constant_index) const; | 125 int constant_index) const; |
126 ciField* get_field_by_index(ciInstanceKlass* loading_klass, | 126 ciField* get_field_by_index(ciInstanceKlass* loading_klass, |
127 int field_index); | 127 int field_index); |
128 ciMethod* get_method_by_index(ciInstanceKlass* loading_klass, | 128 ciMethod* get_method_by_index(constantPoolHandle cpool, |
129 int method_index, Bytecodes::Code bc); | 129 int method_index, Bytecodes::Code bc, |
130 ciInstanceKlass* loading_klass); | |
130 | 131 |
131 // Implementation methods for loading and constant pool access. | 132 // Implementation methods for loading and constant pool access. |
132 ciKlass* get_klass_by_name_impl(ciKlass* accessing_klass, | 133 ciKlass* get_klass_by_name_impl(ciKlass* accessing_klass, |
133 ciSymbol* klass_name, | 134 ciSymbol* klass_name, |
134 bool require_local); | 135 bool require_local); |
135 ciKlass* get_klass_by_index_impl(ciInstanceKlass* loading_klass, | 136 ciKlass* get_klass_by_index_impl(constantPoolHandle cpool, |
136 int klass_index, | 137 int klass_index, |
137 bool& is_accessible); | 138 bool& is_accessible, |
138 ciConstant get_constant_by_index_impl(ciInstanceKlass* loading_klass, | 139 ciInstanceKlass* loading_klass); |
139 int constant_index); | 140 ciConstant get_constant_by_index_impl(constantPoolHandle cpool, |
141 int constant_index, | |
142 ciInstanceKlass* loading_klass); | |
140 bool is_unresolved_string_impl (instanceKlass* loading_klass, | 143 bool is_unresolved_string_impl (instanceKlass* loading_klass, |
141 int constant_index) const; | 144 int constant_index) const; |
142 bool is_unresolved_klass_impl (instanceKlass* loading_klass, | 145 bool is_unresolved_klass_impl (instanceKlass* loading_klass, |
143 int constant_index) const; | 146 int constant_index) const; |
144 ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass, | 147 ciField* get_field_by_index_impl(ciInstanceKlass* loading_klass, |
145 int field_index); | 148 int field_index); |
146 ciMethod* get_method_by_index_impl(ciInstanceKlass* loading_klass, | 149 ciMethod* get_method_by_index_impl(constantPoolHandle cpool, |
147 int method_index, Bytecodes::Code bc); | 150 int method_index, Bytecodes::Code bc, |
151 ciInstanceKlass* loading_klass); | |
152 ciMethod* get_fake_invokedynamic_method_impl(constantPoolHandle cpool, | |
153 int index, Bytecodes::Code bc); | |
148 | 154 |
149 // Helper methods | 155 // Helper methods |
150 bool check_klass_accessibility(ciKlass* accessing_klass, | 156 bool check_klass_accessibility(ciKlass* accessing_klass, |
151 klassOop resolved_klassOop); | 157 klassOop resolved_klassOop); |
152 methodOop lookup_method(instanceKlass* accessor, | 158 methodOop lookup_method(instanceKlass* accessor, |
251 // Cache Jvmti state | 257 // Cache Jvmti state |
252 void cache_jvmti_state(); | 258 void cache_jvmti_state(); |
253 bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; } | 259 bool jvmti_can_hotswap_or_post_breakpoint() const { return _jvmti_can_hotswap_or_post_breakpoint; } |
254 bool jvmti_can_examine_or_deopt_anywhere() const { return _jvmti_can_examine_or_deopt_anywhere; } | 260 bool jvmti_can_examine_or_deopt_anywhere() const { return _jvmti_can_examine_or_deopt_anywhere; } |
255 bool jvmti_can_access_local_variables() const { return _jvmti_can_access_local_variables; } | 261 bool jvmti_can_access_local_variables() const { return _jvmti_can_access_local_variables; } |
256 bool jvmti_can_post_exceptions() const { return _jvmti_can_post_exceptions; } | 262 bool jvmti_can_post_on_exceptions() const { return _jvmti_can_post_on_exceptions; } |
257 | 263 |
258 // Cache DTrace flags | 264 // Cache DTrace flags |
259 void cache_dtrace_flags(); | 265 void cache_dtrace_flags(); |
260 bool dtrace_extended_probes() const { return _dtrace_extended_probes; } | 266 bool dtrace_extended_probes() const { return _dtrace_extended_probes; } |
261 bool dtrace_monitor_probes() const { return _dtrace_monitor_probes; } | 267 bool dtrace_monitor_probes() const { return _dtrace_monitor_probes; } |
284 bool has_debug_info = true, | 290 bool has_debug_info = true, |
285 bool has_unsafe_access = false); | 291 bool has_unsafe_access = false); |
286 | 292 |
287 | 293 |
288 // Access to certain well known ciObjects. | 294 // Access to certain well known ciObjects. |
289 ciInstanceKlass* ArrayStoreException_klass() { | 295 #define WK_KLASS_FUNC(name, ignore_s, ignore_o) \ |
290 return _ArrayStoreException; | 296 ciInstanceKlass* name() { \ |
291 } | 297 return _##name;\ |
292 ciInstanceKlass* Class_klass() { | 298 } |
293 return _Class; | 299 WK_KLASSES_DO(WK_KLASS_FUNC) |
294 } | 300 #undef WK_KLASS_FUNC |
295 ciInstanceKlass* ClassCastException_klass() { | 301 |
296 return _ClassCastException; | |
297 } | |
298 ciInstanceKlass* Object_klass() { | |
299 return _Object; | |
300 } | |
301 ciInstanceKlass* Throwable_klass() { | |
302 return _Throwable; | |
303 } | |
304 ciInstanceKlass* Thread_klass() { | |
305 return _Thread; | |
306 } | |
307 ciInstanceKlass* OutOfMemoryError_klass() { | |
308 return _OutOfMemoryError; | |
309 } | |
310 ciInstanceKlass* String_klass() { | |
311 return _String; | |
312 } | |
313 ciInstance* NullPointerException_instance() { | 302 ciInstance* NullPointerException_instance() { |
314 assert(_NullPointerException_instance != NULL, "initialization problem"); | 303 assert(_NullPointerException_instance != NULL, "initialization problem"); |
315 return _NullPointerException_instance; | 304 return _NullPointerException_instance; |
316 } | 305 } |
317 ciInstance* ArithmeticException_instance() { | 306 ciInstance* ArithmeticException_instance() { |
321 | 310 |
322 // Lazy constructors: | 311 // Lazy constructors: |
323 ciInstance* ArrayIndexOutOfBoundsException_instance(); | 312 ciInstance* ArrayIndexOutOfBoundsException_instance(); |
324 ciInstance* ArrayStoreException_instance(); | 313 ciInstance* ArrayStoreException_instance(); |
325 ciInstance* ClassCastException_instance(); | 314 ciInstance* ClassCastException_instance(); |
315 | |
316 ciInstance* the_null_string(); | |
317 ciInstance* the_min_jint_string(); | |
326 | 318 |
327 static ciSymbol* unloaded_cisymbol() { | 319 static ciSymbol* unloaded_cisymbol() { |
328 return _unloaded_cisymbol; | 320 return _unloaded_cisymbol; |
329 } | 321 } |
330 static ciObjArrayKlass* unloaded_ciobjarrayklass() { | 322 static ciObjArrayKlass* unloaded_ciobjarrayklass() { |