Mercurial > hg > graal-jvmci-8
annotate src/cpu/zero/vm/frame_zero.inline.hpp @ 24118:3ce198ad35a6
check displacement >= 0 (JDK-8177673)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 03 Apr 2017 14:47:25 +0200 |
parents | dd9cc155639c |
children |
rev | line source |
---|---|
1010 | 1 /* |
14223
de6a9e811145
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
12077
diff
changeset
|
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
1505 | 3 * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. |
1010 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1505
diff
changeset
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1505
diff
changeset
|
21 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1505
diff
changeset
|
22 * questions. |
1010 | 23 * |
24 */ | |
25 | |
1972 | 26 #ifndef CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP |
27 #define CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP | |
28 | |
22925 | 29 #include "code/codeCache.hpp" |
30 | |
1010 | 31 // Constructors |
32 | |
33 inline frame::frame() { | |
1505 | 34 _zeroframe = NULL; |
1010 | 35 _sp = NULL; |
36 _pc = NULL; | |
37 _cb = NULL; | |
38 _deopt_state = unknown; | |
39 } | |
40 | |
12077
e16282db4946
8022956: Clang: enable return type warnings on BSD
twisti
parents:
12011
diff
changeset
|
41 inline address frame::sender_pc() const { ShouldNotCallThis(); return NULL; } |
6926 | 42 |
1505 | 43 inline frame::frame(ZeroFrame* zf, intptr_t* sp) { |
44 _zeroframe = zf; | |
1010 | 45 _sp = sp; |
46 switch (zeroframe()->type()) { | |
47 case ZeroFrame::ENTRY_FRAME: | |
48 _pc = StubRoutines::call_stub_return_pc(); | |
49 _cb = NULL; | |
7599 | 50 _deopt_state = not_deoptimized; |
1010 | 51 break; |
52 | |
53 case ZeroFrame::INTERPRETER_FRAME: | |
54 _pc = NULL; | |
55 _cb = NULL; | |
7599 | 56 _deopt_state = not_deoptimized; |
1010 | 57 break; |
58 | |
7599 | 59 case ZeroFrame::SHARK_FRAME: { |
1010 | 60 _pc = zero_sharkframe()->pc(); |
61 _cb = CodeCache::find_blob_unsafe(pc()); | |
7599 | 62 address original_pc = nmethod::get_deopt_original_pc(this); |
63 if (original_pc != NULL) { | |
64 _pc = original_pc; | |
65 _deopt_state = is_deoptimized; | |
66 } else { | |
67 _deopt_state = not_deoptimized; | |
68 } | |
1010 | 69 break; |
7599 | 70 } |
1010 | 71 case ZeroFrame::FAKE_STUB_FRAME: |
72 _pc = NULL; | |
73 _cb = NULL; | |
7599 | 74 _deopt_state = not_deoptimized; |
1010 | 75 break; |
76 | |
77 default: | |
78 ShouldNotReachHere(); | |
79 } | |
80 } | |
81 | |
82 // Accessors | |
83 | |
84 inline intptr_t* frame::sender_sp() const { | |
1505 | 85 return fp() + 1; |
1010 | 86 } |
87 | |
4806
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
88 inline intptr_t* frame::real_fp() const { |
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
89 return fp(); |
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
90 } |
eaa9557116a2
7120448: Fix FP values for compiled frames in frame::describe
bdelsart
parents:
1972
diff
changeset
|
91 |
1010 | 92 inline intptr_t* frame::link() const { |
93 ShouldNotCallThis(); | |
12077
e16282db4946
8022956: Clang: enable return type warnings on BSD
twisti
parents:
12011
diff
changeset
|
94 return NULL; |
1010 | 95 } |
96 | |
97 #ifdef CC_INTERP | |
98 inline interpreterState frame::get_interpreterState() const { | |
99 return zero_interpreterframe()->interpreter_state(); | |
100 } | |
101 | |
102 inline intptr_t** frame::interpreter_frame_locals_addr() const { | |
103 return &(get_interpreterState()->_locals); | |
104 } | |
105 | |
106 inline intptr_t* frame::interpreter_frame_bcx_addr() const { | |
107 return (intptr_t*) &(get_interpreterState()->_bcp); | |
108 } | |
109 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4806
diff
changeset
|
110 inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { |
1010 | 111 return &(get_interpreterState()->_constants); |
112 } | |
113 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4806
diff
changeset
|
114 inline Method** frame::interpreter_frame_method_addr() const { |
1010 | 115 return &(get_interpreterState()->_method); |
116 } | |
117 | |
118 inline intptr_t* frame::interpreter_frame_mdx_addr() const { | |
119 return (intptr_t*) &(get_interpreterState()->_mdx); | |
120 } | |
121 | |
122 inline intptr_t* frame::interpreter_frame_tos_address() const { | |
123 return get_interpreterState()->_stack + 1; | |
124 } | |
125 #endif // CC_INTERP | |
126 | |
127 inline int frame::interpreter_frame_monitor_size() { | |
128 return BasicObjectLock::size(); | |
129 } | |
130 | |
131 inline intptr_t* frame::interpreter_frame_expression_stack() const { | |
132 intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end(); | |
133 return monitor_end - 1; | |
134 } | |
135 | |
136 inline jint frame::interpreter_frame_expression_stack_direction() { | |
137 return -1; | |
138 } | |
139 | |
140 // Return a unique id for this frame. The id must have a value where | |
141 // we can distinguish identity and younger/older relationship. NULL | |
142 // represents an invalid (incomparable) frame. | |
143 inline intptr_t* frame::id() const { | |
1505 | 144 return fp(); |
1010 | 145 } |
146 | |
12011
c54a3122f9c8
8022188: Make zero compile after 8016131 and 8016697
omajid
parents:
7599
diff
changeset
|
147 inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const { |
1010 | 148 return zero_entryframe()->call_wrapper(); |
149 } | |
150 | |
151 inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) { | |
152 ShouldNotCallThis(); | |
153 } | |
154 | |
155 inline oop frame::saved_oop_result(RegisterMap* map) const { | |
156 ShouldNotCallThis(); | |
12077
e16282db4946
8022956: Clang: enable return type warnings on BSD
twisti
parents:
12011
diff
changeset
|
157 return NULL; |
1010 | 158 } |
159 | |
160 inline bool frame::is_older(intptr_t* id) const { | |
161 ShouldNotCallThis(); | |
12077
e16282db4946
8022956: Clang: enable return type warnings on BSD
twisti
parents:
12011
diff
changeset
|
162 return false; |
1010 | 163 } |
164 | |
165 inline intptr_t* frame::entry_frame_argument_at(int offset) const { | |
166 ShouldNotCallThis(); | |
12077
e16282db4946
8022956: Clang: enable return type warnings on BSD
twisti
parents:
12011
diff
changeset
|
167 return NULL; |
1010 | 168 } |
169 | |
170 inline intptr_t* frame::unextended_sp() const { | |
171 if (zeroframe()->is_shark_frame()) | |
172 return zero_sharkframe()->unextended_sp(); | |
173 else | |
174 return (intptr_t *) -1; | |
175 } | |
1972 | 176 |
177 #endif // CPU_ZERO_VM_FRAME_ZERO_INLINE_HPP |