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
26 #include "precompiled.hpp"
27 #include "interpreter/interpreterRuntime.hpp"
28 #include "runtime/thread.hpp"
29 #include "stack_zero.hpp"
30 #include "stack_zero.inline.hpp"
31
32 // Inlined causes circular inclusion with thread.hpp
33 ZeroStack::ZeroStack()
34 : _base(NULL), _top(NULL), _sp(NULL) {
35 _shadow_pages_size = JavaThread::stack_shadow_zone_size();
36 }
37
38 int ZeroStack::suggest_size(Thread *thread) const {
39 assert(needs_setup(), "already set up");
40 int abi_available = abi_stack_available(thread);
41 assert(abi_available >= 0, "available abi stack must be >= 0");
42 return align_down(abi_available / 2, wordSize);
43 }
44
45 void ZeroStack::handle_overflow(TRAPS) {
46 JavaThread *thread = (JavaThread *) THREAD;
47
48 // Set up the frame anchor if it isn't already
49 bool has_last_Java_frame = thread->has_last_Java_frame();
50 if (!has_last_Java_frame) {
|
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
26 #include "precompiled.hpp"
27 #include "interpreter/interpreterRuntime.hpp"
28 #include "runtime/thread.hpp"
29 #include "stack_zero.hpp"
30 #include "stack_zero.inline.hpp"
31 #include "utilities/align.hpp"
32
33 // Inlined causes circular inclusion with thread.hpp
34 ZeroStack::ZeroStack()
35 : _base(NULL), _top(NULL), _sp(NULL) {
36 _shadow_pages_size = JavaThread::stack_shadow_zone_size();
37 }
38
39 int ZeroStack::suggest_size(Thread *thread) const {
40 assert(needs_setup(), "already set up");
41 int abi_available = abi_stack_available(thread);
42 assert(abi_available >= 0, "available abi stack must be >= 0");
43 return align_down(abi_available / 2, wordSize);
44 }
45
46 void ZeroStack::handle_overflow(TRAPS) {
47 JavaThread *thread = (JavaThread *) THREAD;
48
49 // Set up the frame anchor if it isn't already
50 bool has_last_Java_frame = thread->has_last_Java_frame();
51 if (!has_last_Java_frame) {
|