src/cpu/zero/vm/stack_zero.inline.hpp

Fri, 16 Apr 2010 05:05:53 -0700

author
twisti
date
Fri, 16 Apr 2010 05:05:53 -0700
changeset 1818
aa9c266de52a
child 1866
348346af6676
permissions
-rw-r--r--

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>

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

mercurial