thread_windows_x86.hpp revision 1879:f95d63e2154a
1221828Sgrehan/*
2253440Sgrehan * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
3221828Sgrehan * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4221828Sgrehan *
5221828Sgrehan * This code is free software; you can redistribute it and/or modify it
6221828Sgrehan * under the terms of the GNU General Public License version 2 only, as
7221828Sgrehan * published by the Free Software Foundation.
8221828Sgrehan *
9221828Sgrehan * This code is distributed in the hope that it will be useful, but WITHOUT
10221828Sgrehan * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11221828Sgrehan * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12221828Sgrehan * version 2 for more details (a copy is included in the LICENSE file that
13221828Sgrehan * accompanied this code).
14253440Sgrehan *
15221828Sgrehan * You should have received a copy of the GNU General Public License version
16221828Sgrehan * 2 along with this work; if not, write to the Free Software Foundation,
17253440Sgrehan * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18221828Sgrehan *
19221828Sgrehan * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20221828Sgrehan * or visit www.oracle.com if you need additional information or have any
21221828Sgrehan * questions.
22221828Sgrehan *
23221828Sgrehan */
24221828Sgrehan
25221828Sgrehan#ifndef OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
26221828Sgrehan#define OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
27221828Sgrehan
28221828Sgrehan private:
29221828Sgrehan  void pd_initialize() {
30221828Sgrehan    _anchor.clear();
31221828Sgrehan  }
32253440Sgrehan
33253440Sgrehan  frame pd_last_frame() {
34253440Sgrehan    assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
35253440Sgrehan    if (_anchor.last_Java_pc() != NULL) {
36267401Sjhb      return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc());
37253440Sgrehan    } else {
38253440Sgrehan      // This will pick up pc from sp
39253440Sgrehan      return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp());
40253440Sgrehan    }
41253440Sgrehan  }
42253440Sgrehan
43253440Sgrehan public:
44253440Sgrehan  // Mutators are highly dangerous....
45253440Sgrehan  intptr_t* last_Java_fp()                       { return _anchor.last_Java_fp(); }
46253440Sgrehan  void  set_last_Java_fp(intptr_t* fp)           { _anchor.set_last_Java_fp(fp);   }
47253440Sgrehan
48253440Sgrehan  void set_base_of_stack_pointer(intptr_t* base_sp)  {}
49253440Sgrehan
50253440Sgrehan
51253440Sgrehan  static ByteSize last_Java_fp_offset()          {
52253440Sgrehan    return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset();
53253440Sgrehan  }
54253440Sgrehan
55253440Sgrehan  intptr_t* base_of_stack_pointer()              { return NULL; }
56253440Sgrehan  void record_base_of_stack_pointer()            {}
57253440Sgrehan
58253440Sgrehan  bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
59253440Sgrehan    bool isInJava);
60253440Sgrehan
61253440Sgrehan  // These routines are only used on cpu architectures that
62253440Sgrehan  // have separate register stacks (Itanium).
63253440Sgrehan  static bool register_stack_overflow() { return false; }
64253440Sgrehan  static void enable_register_stack_guard() {}
65253440Sgrehan  static void disable_register_stack_guard() {}
66253440Sgrehan
67253440Sgrehan#endif // OS_CPU_WINDOWS_X86_VM_THREAD_WINDOWS_X86_HPP
68253440Sgrehan