Thu, 27 May 2010 19:08:38 -0700
6941466: Oracle rebranding changes for Hotspot repositories
Summary: Change all the Sun copyrights to Oracle copyright
Reviewed-by: ohair
twisti@1818 | 1 | /* |
trims@1907 | 2 | * Copyright (c) 2003, 2007, Oracle and/or its affiliates. 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 | * |
trims@1907 | 20 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 21 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 22 | * 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 | // Check the Zero stack |
twisti@1866 | 29 | if (available_words() < required_words) { |
twisti@1818 | 30 | handle_overflow(THREAD); |
twisti@1818 | 31 | return; |
twisti@1818 | 32 | } |
twisti@1818 | 33 | |
twisti@1818 | 34 | // Check the ABI stack |
twisti@1866 | 35 | if (abi_stack_available(THREAD) < 0) { |
twisti@1818 | 36 | handle_overflow(THREAD); |
twisti@1818 | 37 | return; |
twisti@1818 | 38 | } |
twisti@1818 | 39 | } |
twisti@1866 | 40 | |
twisti@1866 | 41 | // This method returns the amount of ABI stack available for us |
twisti@1866 | 42 | // to use under normal circumstances. Note that the returned |
twisti@1866 | 43 | // value can be negative. |
twisti@1866 | 44 | inline int ZeroStack::abi_stack_available(Thread *thread) const { |
twisti@1866 | 45 | int stack_used = thread->stack_base() - (address) &stack_used; |
twisti@1866 | 46 | int stack_free = thread->stack_size() - stack_used; |
twisti@1866 | 47 | return stack_free - shadow_pages_size(); |
twisti@1866 | 48 | } |