< prev index next >

src/hotspot/cpu/zero/stack_zero.cpp

Print this page




   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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"

  27 #include "interpreter/interpreterRuntime.hpp"
  28 #include "runtime/thread.hpp"
  29 #include "stack_zero.hpp"
  30 #include "stack_zero.inline.hpp"

  31 #include "utilities/align.hpp"
  32 
  33 // Inlined causes circular inclusion with thread.hpp
  34 ZeroStack::ZeroStack()
  35     : _base(NULL), _top(NULL), _sp(NULL) {
  36     _shadow_pages_size = JavaThread::stack_shadow_zone_size();
  37   }
  38 
  39 int ZeroStack::suggest_size(Thread *thread) const {
  40   assert(needs_setup(), "already set up");
  41   int abi_available = abi_stack_available(thread);
  42   assert(abi_available >= 0, "available abi stack must be >= 0");
  43   return align_down(abi_available / 2, wordSize);
  44 }
  45 
  46 void ZeroStack::handle_overflow(TRAPS) {
  47   JavaThread *thread = (JavaThread *) THREAD;
  48 
  49   // Set up the frame anchor if it isn't already
  50   bool has_last_Java_frame = thread->has_last_Java_frame();




   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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  *
  24  */
  25 
  26 #include "precompiled.hpp"
  27 #include "interpreter/bytecodeInterpreter.hpp"
  28 #include "interpreter/interpreterRuntime.hpp"
  29 #include "runtime/thread.hpp"
  30 #include "stack_zero.hpp"
  31 #include "stack_zero.inline.hpp"
  32 #include "runtime/frame.inline.hpp"
  33 #include "utilities/align.hpp"
  34 
  35 // Inlined causes circular inclusion with thread.hpp
  36 ZeroStack::ZeroStack()
  37     : _base(NULL), _top(NULL), _sp(NULL) {
  38     _shadow_pages_size = JavaThread::stack_shadow_zone_size();
  39   }
  40 
  41 int ZeroStack::suggest_size(Thread *thread) const {
  42   assert(needs_setup(), "already set up");
  43   int abi_available = abi_stack_available(thread);
  44   assert(abi_available >= 0, "available abi stack must be >= 0");
  45   return align_down(abi_available / 2, wordSize);
  46 }
  47 
  48 void ZeroStack::handle_overflow(TRAPS) {
  49   JavaThread *thread = (JavaThread *) THREAD;
  50 
  51   // Set up the frame anchor if it isn't already
  52   bool has_last_Java_frame = thread->has_last_Java_frame();


< prev index next >