Mercurial > hg > truffle
comparison src/share/vm/utilities/exceptions.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 | 93c71eb28866 |
children | e522a00b91aa f34d701e952e |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
86 // Check for trying to throw stack overflow before initialization is complete | 86 // Check for trying to throw stack overflow before initialization is complete |
87 // to prevent infinite recursion trying to initialize stack overflow without | 87 // to prevent infinite recursion trying to initialize stack overflow without |
88 // adequate stack space. | 88 // adequate stack space. |
89 // This can happen with stress testing a large value of StackShadowPages | 89 // This can happen with stress testing a large value of StackShadowPages |
90 if (h_exception()->klass() == SystemDictionary::StackOverflowError_klass()) { | 90 if (h_exception()->klass() == SystemDictionary::StackOverflowError_klass()) { |
91 instanceKlass* ik = instanceKlass::cast(h_exception->klass()); | 91 InstanceKlass* ik = InstanceKlass::cast(h_exception->klass()); |
92 assert(ik->is_initialized(), | 92 assert(ik->is_initialized(), |
93 "need to increase min_stack_allowed calculation"); | 93 "need to increase min_stack_allowed calculation"); |
94 } | 94 } |
95 #endif // ASSERT | 95 #endif // ASSERT |
96 | 96 |
217 | 217 |
218 | 218 |
219 void Exceptions::throw_stack_overflow_exception(Thread* THREAD, const char* file, int line, methodHandle method) { | 219 void Exceptions::throw_stack_overflow_exception(Thread* THREAD, const char* file, int line, methodHandle method) { |
220 Handle exception; | 220 Handle exception; |
221 if (!THREAD->has_pending_exception()) { | 221 if (!THREAD->has_pending_exception()) { |
222 klassOop k = SystemDictionary::StackOverflowError_klass(); | 222 Klass* k = SystemDictionary::StackOverflowError_klass(); |
223 oop e = instanceKlass::cast(k)->allocate_instance(CHECK); | 223 oop e = InstanceKlass::cast(k)->allocate_instance(CHECK); |
224 exception = Handle(THREAD, e); // fill_in_stack trace does gc | 224 exception = Handle(THREAD, e); // fill_in_stack trace does gc |
225 assert(instanceKlass::cast(k)->is_initialized(), "need to increase min_stack_allowed calculation"); | 225 assert(InstanceKlass::cast(k)->is_initialized(), "need to increase min_stack_allowed calculation"); |
226 if (StackTraceInThrowable) { | 226 if (StackTraceInThrowable) { |
227 java_lang_Throwable::fill_in_stack_trace(exception, method()); | 227 java_lang_Throwable::fill_in_stack_trace(exception, method()); |
228 } | 228 } |
229 } else { | 229 } else { |
230 // if prior exception, throw that one instead | 230 // if prior exception, throw that one instead |
255 assert(!thread->has_pending_exception(), "already has exception"); | 255 assert(!thread->has_pending_exception(), "already has exception"); |
256 | 256 |
257 Handle h_exception; | 257 Handle h_exception; |
258 | 258 |
259 // Resolve exception klass | 259 // Resolve exception klass |
260 klassOop ik = SystemDictionary::resolve_or_fail(name, h_loader, h_protection_domain, true, thread); | 260 Klass* ik = SystemDictionary::resolve_or_fail(name, h_loader, h_protection_domain, true, thread); |
261 instanceKlassHandle klass(thread, ik); | 261 instanceKlassHandle klass(thread, ik); |
262 | 262 |
263 if (!thread->has_pending_exception()) { | 263 if (!thread->has_pending_exception()) { |
264 assert(klass.not_null(), "klass must exist"); | 264 assert(klass.not_null(), "klass must exist"); |
265 // We are about to create an instance - so make sure that klass is initialized | 265 // We are about to create an instance - so make sure that klass is initialized |
449 oop msg = java_lang_Throwable::message(exception); | 449 oop msg = java_lang_Throwable::message(exception); |
450 if (msg != NULL) { | 450 if (msg != NULL) { |
451 message = java_lang_String::as_utf8_string(msg); | 451 message = java_lang_String::as_utf8_string(msg); |
452 } | 452 } |
453 } | 453 } |
454 debug_check_abort(instanceKlass::cast(exception()->klass())->external_name(), message); | 454 debug_check_abort(InstanceKlass::cast(exception()->klass())->external_name(), message); |
455 } | 455 } |
456 } | 456 } |
457 #endif | 457 #endif |