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 "stack_zero.hpp"
29 #include "stack_zero.inline.hpp"
30
31 int ZeroStack::suggest_size(Thread *thread) const {
32 assert(needs_setup(), "already set up");
33 return align_size_down(abi_stack_available(thread) / 2, wordSize);
34 }
35
36 void ZeroStack::handle_overflow(TRAPS) {
37 JavaThread *thread = (JavaThread *) THREAD;
38
39 // Set up the frame anchor if it isn't already
40 bool has_last_Java_frame = thread->has_last_Java_frame();
41 if (!has_last_Java_frame) {
42 intptr_t *sp = thread->zero_stack()->sp();
43 ZeroFrame *frame = thread->top_zero_frame();
44 while (frame) {
45 if (frame->is_shark_frame())
46 break;
47
48 if (frame->is_interpreter_frame()) {
49 interpreterState istate =
50 frame->as_interpreter_frame()->interpreter_state();
51 if (istate->self_link() == istate)
52 break;
53 }
|
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 "stack_zero.hpp"
29 #include "stack_zero.inline.hpp"
30
31 int ZeroStack::suggest_size(Thread *thread) const {
32 assert(needs_setup(), "already set up");
33 int abi_available = abi_stack_available(thread);
34 assert(abi_available >= 0, "available abi stack must be >= 0");
35 return align_size_down(abi_available / 2, wordSize);
36 }
37
38 void ZeroStack::handle_overflow(TRAPS) {
39 JavaThread *thread = (JavaThread *) THREAD;
40
41 // Set up the frame anchor if it isn't already
42 bool has_last_Java_frame = thread->has_last_Java_frame();
43 if (!has_last_Java_frame) {
44 intptr_t *sp = thread->zero_stack()->sp();
45 ZeroFrame *frame = thread->top_zero_frame();
46 while (frame) {
47 if (frame->is_shark_frame())
48 break;
49
50 if (frame->is_interpreter_frame()) {
51 interpreterState istate =
52 frame->as_interpreter_frame()->interpreter_state();
53 if (istate->self_link() == istate)
54 break;
55 }
|