Mercurial > hg > truffle
comparison src/share/vm/runtime/os.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 | 1d7922586cf6 |
children | a7509aff1b06 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 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. |
269 break; | 269 break; |
270 } | 270 } |
271 default: { | 271 default: { |
272 // Dispatch the signal to java | 272 // Dispatch the signal to java |
273 HandleMark hm(THREAD); | 273 HandleMark hm(THREAD); |
274 klassOop k = SystemDictionary::resolve_or_null(vmSymbols::sun_misc_Signal(), THREAD); | 274 Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_misc_Signal(), THREAD); |
275 KlassHandle klass (THREAD, k); | 275 KlassHandle klass (THREAD, k); |
276 if (klass.not_null()) { | 276 if (klass.not_null()) { |
277 JavaValue result(T_VOID); | 277 JavaValue result(T_VOID); |
278 JavaCallArguments args; | 278 JavaCallArguments args; |
279 args.push_int(sig); | 279 args.push_int(sig); |
292 // trigger additional out-of-memory conditions | 292 // trigger additional out-of-memory conditions |
293 if (tty != NULL) { | 293 if (tty != NULL) { |
294 char klass_name[256]; | 294 char klass_name[256]; |
295 char tmp_sig_name[16]; | 295 char tmp_sig_name[16]; |
296 const char* sig_name = "UNKNOWN"; | 296 const char* sig_name = "UNKNOWN"; |
297 instanceKlass::cast(PENDING_EXCEPTION->klass())-> | 297 InstanceKlass::cast(PENDING_EXCEPTION->klass())-> |
298 name()->as_klass_external_name(klass_name, 256); | 298 name()->as_klass_external_name(klass_name, 256); |
299 if (os::exception_name(sig, tmp_sig_name, 16) != NULL) | 299 if (os::exception_name(sig, tmp_sig_name, 16) != NULL) |
300 sig_name = tmp_sig_name; | 300 sig_name = tmp_sig_name; |
301 warning("Exception %s occurred dispatching signal %s to handler" | 301 warning("Exception %s occurred dispatching signal %s to handler" |
302 "- the VM may need to be forcibly terminated", | 302 "- the VM may need to be forcibly terminated", |
312 | 312 |
313 void os::signal_init() { | 313 void os::signal_init() { |
314 if (!ReduceSignalUsage) { | 314 if (!ReduceSignalUsage) { |
315 // Setup JavaThread for processing signals | 315 // Setup JavaThread for processing signals |
316 EXCEPTION_MARK; | 316 EXCEPTION_MARK; |
317 klassOop k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), true, CHECK); | 317 Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_Thread(), true, CHECK); |
318 instanceKlassHandle klass (THREAD, k); | 318 instanceKlassHandle klass (THREAD, k); |
319 instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); | 319 instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); |
320 | 320 |
321 const char thread_name[] = "Signal Dispatcher"; | 321 const char thread_name[] = "Signal Dispatcher"; |
322 Handle string = java_lang_String::create_from_str(thread_name, CHECK); | 322 Handle string = java_lang_String::create_from_str(thread_name, CHECK); |
891 print = true; | 891 print = true; |
892 } | 892 } |
893 if (print) { | 893 if (print) { |
894 st->print_cr(INTPTR_FORMAT " is an oop", addr); | 894 st->print_cr(INTPTR_FORMAT " is an oop", addr); |
895 oop(p)->print_on(st); | 895 oop(p)->print_on(st); |
896 if (p != (HeapWord*)x && oop(p)->is_constMethod() && | |
897 constMethodOop(p)->contains(addr)) { | |
898 Thread *thread = Thread::current(); | |
899 HandleMark hm(thread); | |
900 methodHandle mh (thread, constMethodOop(p)->method()); | |
901 if (!mh->is_native()) { | |
902 st->print_cr("bci_from(%p) = %d; print_codes():", | |
903 addr, mh->bci_from(address(x))); | |
904 mh->print_codes_on(st); | |
905 } | |
906 } | |
907 return; | 896 return; |
908 } | 897 } |
909 } else { | 898 } else { |
910 if (Universe::heap()->is_in_reserved(addr)) { | 899 if (Universe::heap()->is_in_reserved(addr)) { |
911 st->print_cr(INTPTR_FORMAT " is an unallocated location " | 900 st->print_cr(INTPTR_FORMAT " is an unallocated location " |
956 if (verbose) thread->print_on(st); | 945 if (verbose) thread->print_on(st); |
957 return; | 946 return; |
958 } | 947 } |
959 | 948 |
960 } | 949 } |
950 | |
951 #ifndef PRODUCT | |
952 // Check if in metaspace. | |
953 if (ClassLoaderDataGraph::contains((address)addr)) { | |
954 // Use addr->print() from the debugger instead (not here) | |
955 st->print_cr(INTPTR_FORMAT | |
956 " is pointing into metadata", addr); | |
957 return; | |
958 } | |
959 #endif | |
960 | |
961 // Try an OS specific find | 961 // Try an OS specific find |
962 if (os::find(addr, st)) { | 962 if (os::find(addr, st)) { |
963 return; | 963 return; |
964 } | 964 } |
965 | 965 |