annotate src/cpu/zero/vm/stack_zero.inline.hpp @ 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 348346af6676
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1383
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
1 /*
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
2 * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
3 * Copyright 2010 Red Hat, Inc.
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
5 *
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
6 * This code is free software; you can redistribute it and/or modify it
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
7 * under the terms of the GNU General Public License version 2 only, as
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
8 * published by the Free Software Foundation.
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
9 *
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
10 * This code is distributed in the hope that it will be useful, but WITHOUT
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
13 * version 2 for more details (a copy is included in the LICENSE file that
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
14 * accompanied this code).
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
15 *
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License version
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
17 * 2 along with this work; if not, write to the Free Software Foundation,
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
19 *
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
21 * CA 95054 USA or visit www.sun.com if you need additional information or
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
22 * have any questions.
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
23 *
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
24 */
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
25
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
26 // This function should match SharkStack::CreateStackOverflowCheck
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
27 inline void ZeroStack::overflow_check(int required_words, TRAPS) {
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
28 JavaThread *thread = (JavaThread *) THREAD;
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
29
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
30 // Check the Zero stack
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
31 if (required_words > available_words()) {
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
32 handle_overflow(THREAD);
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
33 return;
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
34 }
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
35
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
36 // Check the ABI stack
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
37 address stack_top = thread->stack_base() - thread->stack_size();
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
38 int free_stack = ((address) &stack_top) - stack_top;
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
39 if (free_stack < shadow_pages_size()) {
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
40 handle_overflow(THREAD);
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
41 return;
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
42 }
aa9c266de52a 6944473: 6941224 misses new files
twisti
parents:
diff changeset
43 }