1 /* |
1 /* |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright 2008 Red Hat, Inc. |
3 * Copyright 2008 Red Hat, Inc. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * |
5 * |
6 * This code is free software; you can redistribute it and/or modify it |
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 |
7 * under the terms of the GNU General Public License version 2 only, as |
23 * |
23 * |
24 */ |
24 */ |
25 |
25 |
26 #include "precompiled.hpp" |
26 #include "precompiled.hpp" |
27 #include "asm/assembler.hpp" |
27 #include "asm/assembler.hpp" |
28 #include "interp_masm_zero.hpp" |
|
29 #include "interpreter/bytecodeInterpreter.hpp" |
28 #include "interpreter/bytecodeInterpreter.hpp" |
30 #include "interpreter/bytecodeInterpreter.inline.hpp" |
29 #include "interpreter/bytecodeInterpreter.inline.hpp" |
31 #include "interpreter/interpreter.hpp" |
30 #include "interpreter/interpreter.hpp" |
32 #include "interpreter/interpreterRuntime.hpp" |
31 #include "interpreter/interpreterRuntime.hpp" |
33 #include "oops/methodData.hpp" |
32 #include "oops/methodData.hpp" |
34 #include "oops/method.hpp" |
33 #include "oops/method.hpp" |
35 #include "oops/oop.inline.hpp" |
34 #include "oops/oop.inline.hpp" |
36 #include "prims/jvmtiExport.hpp" |
|
37 #include "prims/jvmtiThreadState.hpp" |
|
38 #include "runtime/deoptimization.hpp" |
35 #include "runtime/deoptimization.hpp" |
39 #include "runtime/frame.inline.hpp" |
36 #include "runtime/frame.inline.hpp" |
40 #include "runtime/sharedRuntime.hpp" |
37 #include "runtime/sharedRuntime.hpp" |
41 #include "runtime/stubRoutines.hpp" |
38 #include "runtime/stubRoutines.hpp" |
42 #include "runtime/synchronizer.hpp" |
39 #include "runtime/synchronizer.hpp" |
66 if (addr > (address) &_result && addr < (address) (&_result + 1)) |
63 if (addr > (address) &_result && addr < (address) (&_result + 1)) |
67 return "_result)"; |
64 return "_result)"; |
68 return NULL; |
65 return NULL; |
69 } |
66 } |
70 |
67 |
|
68 void BytecodeInterpreter::layout_interpreterState(interpreterState istate, |
|
69 frame* caller, |
|
70 frame* current, |
|
71 Method* method, |
|
72 intptr_t* locals, |
|
73 intptr_t* stack, |
|
74 intptr_t* stack_base, |
|
75 intptr_t* monitor_base, |
|
76 intptr_t* frame_bottom, |
|
77 bool is_top_frame) { |
|
78 istate->set_locals(locals); |
|
79 istate->set_method(method); |
|
80 istate->set_self_link(istate); |
|
81 istate->set_prev_link(NULL); |
|
82 // thread will be set by a hacky repurposing of frame::patch_pc() |
|
83 // bcp will be set by vframeArrayElement::unpack_on_stack() |
|
84 istate->set_constants(method->constants()->cache()); |
|
85 istate->set_msg(BytecodeInterpreter::method_resume); |
|
86 istate->set_bcp_advance(0); |
|
87 istate->set_oop_temp(NULL); |
|
88 istate->set_mdx(NULL); |
|
89 if (caller->is_interpreted_frame()) { |
|
90 interpreterState prev = caller->get_interpreterState(); |
|
91 prev->set_callee(method); |
|
92 if (*prev->bcp() == Bytecodes::_invokeinterface) |
|
93 prev->set_bcp_advance(5); |
|
94 else |
|
95 prev->set_bcp_advance(3); |
|
96 } |
|
97 istate->set_callee(NULL); |
|
98 istate->set_monitor_base((BasicObjectLock *) monitor_base); |
|
99 istate->set_stack_base(stack_base); |
|
100 istate->set_stack(stack); |
|
101 istate->set_stack_limit(stack_base - method->max_stack() - 1); |
|
102 } |
|
103 |
71 #endif // CC_INTERP |
104 #endif // CC_INTERP |