author | naoto |
Tue, 09 Jul 2019 08:05:38 -0700 | |
changeset 55627 | 9c1885fb2a42 |
parent 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
10565 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49480
diff
changeset
|
2 |
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. |
10565 | 3 |
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. |
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
5 |
* |
|
6 |
* This code is free software; you can redistribute it and/or modify it |
|
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 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49480
diff
changeset
|
26 |
#ifndef OS_CPU_BSD_ZERO_THREAD_BSD_ZERO_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49480
diff
changeset
|
27 |
#define OS_CPU_BSD_ZERO_THREAD_BSD_ZERO_HPP |
10565 | 28 |
|
29 |
private: |
|
30 |
ZeroStack _zero_stack; |
|
31 |
ZeroFrame* _top_zero_frame; |
|
32 |
||
33 |
void pd_initialize() { |
|
34 |
_top_zero_frame = NULL; |
|
35 |
} |
|
36 |
||
37 |
public: |
|
38 |
ZeroStack *zero_stack() { |
|
39 |
return &_zero_stack; |
|
40 |
} |
|
41 |
||
42 |
public: |
|
43 |
ZeroFrame *top_zero_frame() { |
|
44 |
return _top_zero_frame; |
|
45 |
} |
|
46 |
void push_zero_frame(ZeroFrame *frame) { |
|
47 |
*(ZeroFrame **) frame = _top_zero_frame; |
|
48 |
_top_zero_frame = frame; |
|
49 |
} |
|
50 |
void pop_zero_frame() { |
|
51 |
zero_stack()->set_sp((intptr_t *) _top_zero_frame + 1); |
|
52 |
_top_zero_frame = *(ZeroFrame **) _top_zero_frame; |
|
53 |
} |
|
54 |
||
55 |
public: |
|
56 |
static ByteSize zero_stack_offset() { |
|
57 |
return byte_offset_of(JavaThread, _zero_stack); |
|
58 |
} |
|
59 |
static ByteSize top_zero_frame_offset() { |
|
60 |
return byte_offset_of(JavaThread, _top_zero_frame); |
|
61 |
} |
|
62 |
||
63 |
public: |
|
64 |
void record_base_of_stack_pointer() { |
|
65 |
assert(top_zero_frame() == NULL, "junk on stack prior to Java call"); |
|
66 |
} |
|
67 |
void set_base_of_stack_pointer(intptr_t* base_sp) { |
|
68 |
assert(base_sp == NULL, "should be"); |
|
69 |
assert(top_zero_frame() == NULL, "junk on stack after Java call"); |
|
70 |
} |
|
71 |
||
72 |
public: |
|
73 |
void set_last_Java_frame() { |
|
74 |
set_last_Java_frame(top_zero_frame(), zero_stack()->sp()); |
|
75 |
} |
|
76 |
void reset_last_Java_frame() { |
|
77 |
frame_anchor()->zap(); |
|
78 |
} |
|
79 |
void set_last_Java_frame(ZeroFrame* fp, intptr_t* sp) { |
|
80 |
frame_anchor()->set(sp, NULL, fp); |
|
81 |
} |
|
82 |
||
83 |
public: |
|
84 |
ZeroFrame* last_Java_fp() { |
|
85 |
return frame_anchor()->last_Java_fp(); |
|
86 |
} |
|
87 |
||
88 |
private: |
|
49480
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
47216
diff
changeset
|
89 |
frame pd_last_frame(); |
10565 | 90 |
|
91 |
public: |
|
92 |
static ByteSize last_Java_fp_offset() { |
|
93 |
return byte_offset_of(JavaThread, _anchor) + |
|
94 |
JavaFrameAnchor::last_Java_fp_offset(); |
|
95 |
} |
|
96 |
||
97 |
public: |
|
98 |
// Check for pending suspend requests and pending asynchronous |
|
99 |
// exceptions. There are separate accessors for these, but |
|
100 |
// _suspend_flags is volatile so using them would be unsafe. |
|
101 |
bool has_special_condition_for_native_trans() { |
|
102 |
return _suspend_flags != 0; |
|
103 |
} |
|
104 |
||
105 |
public: |
|
106 |
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, |
|
107 |
void* ucontext, |
|
108 |
bool isInJava) { |
|
109 |
ShouldNotCallThis(); |
|
19336
ddceb0657500
8022956: Clang: enable return type warnings on BSD
twisti
parents:
10565
diff
changeset
|
110 |
return false; |
10565 | 111 |
} |
112 |
||
113 |
// These routines are only used on cpu architectures that |
|
114 |
// have separate register stacks (Itanium). |
|
115 |
static bool register_stack_overflow() { return false; } |
|
116 |
static void enable_register_stack_guard() {} |
|
117 |
static void disable_register_stack_guard() {} |
|
118 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49480
diff
changeset
|
119 |
#endif // OS_CPU_BSD_ZERO_THREAD_BSD_ZERO_HPP |