Mercurial > hg > graal-compiler
annotate src/share/vm/utilities/vmError.hpp @ 1711:a6bff45449bc
6973570: OrderAccess::storestore() scales poorly on multi-socket x64 and sparc: cache-line ping-ponging
Summary: volatile store to static variable removed in favour of a volatile store to stack to avoid excessive cache coherency traffic; verified that the volatile store is not elided by any of our current compilers.
Reviewed-by: dholmes, dice, jcoomes, kvn
author | ysr |
---|---|
date | Tue, 10 Aug 2010 14:53:35 -0700 |
parents | c18cbe5936b8 |
children | 126ea7725993 |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
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 | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 | |
26 class VM_ReportJavaOutOfMemory; | |
27 | |
28 class VMError : public StackObj { | |
29 friend class VM_ReportJavaOutOfMemory; | |
30 | |
31 enum ErrorType { | |
32 internal_error = 0xe0000000, | |
33 oom_error = 0xe0000001 | |
34 }; | |
35 int _id; // Solaris/Linux signals: 0 - SIGRTMAX | |
36 // Windows exceptions: 0xCxxxxxxx system errors | |
37 // 0x8xxxxxxx system warnings | |
38 | |
39 const char * _message; | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
40 const char * _detail_msg; |
0 | 41 |
42 Thread * _thread; // NULL if it's native thread | |
43 | |
44 | |
45 // additional info for crashes | |
46 address _pc; // faulting PC | |
47 void * _siginfo; // ExceptionRecord on Windows, | |
48 // siginfo_t on Solaris/Linux | |
49 void * _context; // ContextRecord on Windows, | |
50 // ucontext_t on Solaris/Linux | |
51 | |
52 // additional info for VM internal errors | |
53 const char * _filename; | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
513
diff
changeset
|
54 int _lineno; |
0 | 55 |
56 // used by fatal error handler | |
57 int _current_step; | |
58 const char * _current_step_info; | |
59 int _verbose; | |
60 | |
61 // used by reporting about OOM | |
62 size_t _size; | |
63 | |
64 // set signal handlers on Solaris/Linux or the default exception filter | |
65 // on Windows, to handle recursive crashes. | |
66 void reset_signal_handlers(); | |
67 | |
68 // handle -XX:+ShowMessageBoxOnError. buf is used to format the message string | |
69 void show_message_box(char* buf, int buflen); | |
70 | |
71 // generate an error report | |
72 void report(outputStream* st); | |
73 | |
1384 | 74 // generate a stack trace |
75 static void print_stack_trace(outputStream* st, JavaThread* jt, | |
76 char* buf, int buflen, bool verbose = false); | |
77 | |
0 | 78 // accessor |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
79 const char* message() const { return _message; } |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
80 const char* detail_msg() const { return _detail_msg; } |
0 | 81 |
82 public: | |
83 // Constructor for crashes | |
84 VMError(Thread* thread, int sig, address pc, void* siginfo, void* context); | |
85 // Constructor for VM internal errors | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
86 VMError(Thread* thread, const char* filename, int lineno, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
87 const char* message, const char * detail_msg); |
0 | 88 |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
89 // Constructor for VM OOM errors |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
90 VMError(Thread* thread, const char* filename, int lineno, size_t size, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
91 const char* message); |
0 | 92 // Constructor for non-fatal errors |
93 VMError(const char* message); | |
94 | |
95 // return a string to describe the error | |
96 char *error_string(char* buf, int buflen); | |
97 | |
98 // main error reporting function | |
99 void report_and_die(); | |
100 | |
101 // reporting OutOfMemoryError | |
102 void report_java_out_of_memory(); | |
103 | |
104 // returns original flags for signal, if it was resetted, or -1 if | |
105 // signal was not changed by error reporter | |
106 static int get_resetted_sigflags(int sig); | |
107 | |
108 // returns original handler for signal, if it was resetted, or NULL if | |
109 // signal was not changed by error reporter | |
110 static address get_resetted_sighandler(int sig); | |
111 }; |