Mercurial > hg > truffle
annotate src/share/vm/utilities/vmError.hpp @ 1359:23b1b27ac76c
6909756: G1: guarantee(G1CollectedHeap::heap()->mark_in_progress(),"Precondition.")
Summary: Make sure that two marking cycles do not overlap, i.e., a new one can only start after the concurrent marking thread finishes all its work. In the fix I piggy-back a couple of minor extra fixes: some general code reformatting for consistency (only around the code I modified), the removal of a field (G1CollectorPolicy::_should_initiate_conc_mark) which doesn't seem to be used at all (it's only set but never read), as well as moving the "is GC locker active" test earlier into the G1 pause / Full GC and using a more appropriate method for it.
Reviewed-by: johnc, jmasa, jcoomes, ysr
author | tonyp |
---|---|
date | Tue, 06 Apr 2010 10:59:45 -0400 |
parents | 7bb995fbd3c0 |
children | c544d979f886 |
rev | line source |
---|---|
0 | 1 /* |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
513
diff
changeset
|
2 * Copyright 2003-2009 Sun Microsystems, Inc. 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 * | |
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 * CA 95054 USA or visit www.sun.com if you need additional information or | |
21 * have any questions. | |
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; | |
40 | |
41 Thread * _thread; // NULL if it's native thread | |
42 | |
43 | |
44 // additional info for crashes | |
45 address _pc; // faulting PC | |
46 void * _siginfo; // ExceptionRecord on Windows, | |
47 // siginfo_t on Solaris/Linux | |
48 void * _context; // ContextRecord on Windows, | |
49 // ucontext_t on Solaris/Linux | |
50 | |
51 // additional info for VM internal errors | |
52 const char * _filename; | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
513
diff
changeset
|
53 int _lineno; |
0 | 54 |
55 // used by fatal error handler | |
56 int _current_step; | |
57 const char * _current_step_info; | |
58 int _verbose; | |
59 | |
60 // used by reporting about OOM | |
61 size_t _size; | |
62 | |
63 // set signal handlers on Solaris/Linux or the default exception filter | |
64 // on Windows, to handle recursive crashes. | |
65 void reset_signal_handlers(); | |
66 | |
67 // handle -XX:+ShowMessageBoxOnError. buf is used to format the message string | |
68 void show_message_box(char* buf, int buflen); | |
69 | |
70 // generate an error report | |
71 void report(outputStream* st); | |
72 | |
73 // accessor | |
74 const char* message() { return _message; } | |
75 | |
76 public: | |
77 // Constructor for crashes | |
78 VMError(Thread* thread, int sig, address pc, void* siginfo, void* context); | |
79 // Constructor for VM internal errors | |
80 VMError(Thread* thread, const char* message, const char* filename, int lineno); | |
81 | |
82 // Constructors for VM OOM errors | |
83 VMError(Thread* thread, size_t size, const char* message, const char* filename, int lineno); | |
84 // Constructor for non-fatal errors | |
85 VMError(const char* message); | |
86 | |
87 // return a string to describe the error | |
88 char *error_string(char* buf, int buflen); | |
89 | |
90 // main error reporting function | |
91 void report_and_die(); | |
92 | |
93 // reporting OutOfMemoryError | |
94 void report_java_out_of_memory(); | |
95 | |
96 // returns original flags for signal, if it was resetted, or -1 if | |
97 // signal was not changed by error reporter | |
98 static int get_resetted_sigflags(int sig); | |
99 | |
100 // returns original handler for signal, if it was resetted, or NULL if | |
101 // signal was not changed by error reporter | |
102 static address get_resetted_sighandler(int sig); | |
103 }; |