comparison src/cpu/zero/vm/stack_zero.cpp @ 1383:aa9c266de52a

6944473: 6941224 misses new files Summary: Two new files are missing in the push for 6941224. Reviewed-by: twisti Contributed-by: Gary Benson <gbenson@redhat.com>
author twisti
date Fri, 16 Apr 2010 05:05:53 -0700
parents
children 0c5b3cf3c1f5
comparison
equal deleted inserted replaced
1382:d32d2a2f62cd 1383:aa9c266de52a
1 /*
2 * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
3 * Copyright 2010 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
22 * have any questions.
23 *
24 */
25
26 #include "incls/_precompiled.incl"
27 #include "incls/_stack_zero.cpp.incl"
28
29 void ZeroStack::handle_overflow(TRAPS) {
30 JavaThread *thread = (JavaThread *) THREAD;
31
32 // Set up the frame anchor if it isn't already
33 bool has_last_Java_frame = thread->has_last_Java_frame();
34 if (!has_last_Java_frame) {
35 ZeroFrame *frame = thread->top_zero_frame();
36 while (frame) {
37 if (frame->is_shark_frame())
38 break;
39
40 if (frame->is_interpreter_frame()) {
41 interpreterState istate =
42 frame->as_interpreter_frame()->interpreter_state();
43 if (istate->self_link() == istate)
44 break;
45 }
46
47 frame = frame->next();
48 }
49
50 if (frame == NULL)
51 fatal("unrecoverable stack overflow");
52
53 thread->set_last_Java_frame(frame);
54 }
55
56 // Throw the exception
57 switch (thread->thread_state()) {
58 case _thread_in_Java:
59 InterpreterRuntime::throw_StackOverflowError(thread);
60 break;
61
62 case _thread_in_vm:
63 Exceptions::throw_stack_overflow_exception(thread, __FILE__, __LINE__);
64 break;
65
66 default:
67 ShouldNotReachHere();
68 }
69
70 // Reset the frame anchor if necessary
71 if (!has_last_Java_frame)
72 thread->reset_last_Java_frame();
73 }