1 /*
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
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.
419 __ ldr(r1, Address(r1, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
420 __ andr(r1, r1, ConstantPoolCacheEntry::parameter_size_mask);
421
422 __ add(esp, esp, r1, Assembler::LSL, 3);
423
424 // Restore machine SP
425 __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
426 __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
427 __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
428 __ ldr(rscratch2,
429 Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
430 __ sub(rscratch1, rscratch2, rscratch1, ext::uxtw, 3);
431 __ andr(sp, rscratch1, -16);
432
433 #ifndef PRODUCT
434 // tell the simulator that the method has been reentered
435 if (NotifySimulator) {
436 __ notify(Assembler::method_reentry);
437 }
438 #endif
439 __ get_dispatch();
440 __ dispatch_next(state, step);
441
442 return entry;
443 }
444
445 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state,
446 int step) {
447 address entry = __ pc();
448 __ restore_bcp();
449 __ restore_locals();
450 __ restore_constant_pool_cache();
451 __ get_method(rmethod);
452 __ get_dispatch();
453
454 // Calculate stack limit
455 __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
456 __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
457 __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
458 __ ldr(rscratch2,
|
1 /*
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, Red Hat Inc. All rights reserved.
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.
419 __ ldr(r1, Address(r1, ConstantPoolCache::base_offset() + ConstantPoolCacheEntry::flags_offset()));
420 __ andr(r1, r1, ConstantPoolCacheEntry::parameter_size_mask);
421
422 __ add(esp, esp, r1, Assembler::LSL, 3);
423
424 // Restore machine SP
425 __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
426 __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
427 __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
428 __ ldr(rscratch2,
429 Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
430 __ sub(rscratch1, rscratch2, rscratch1, ext::uxtw, 3);
431 __ andr(sp, rscratch1, -16);
432
433 #ifndef PRODUCT
434 // tell the simulator that the method has been reentered
435 if (NotifySimulator) {
436 __ notify(Assembler::method_reentry);
437 }
438 #endif
439
440 __ check_and_handle_popframe(rthread);
441 __ check_and_handle_earlyret(rthread);
442
443 __ get_dispatch();
444 __ dispatch_next(state, step);
445
446 return entry;
447 }
448
449 address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state,
450 int step) {
451 address entry = __ pc();
452 __ restore_bcp();
453 __ restore_locals();
454 __ restore_constant_pool_cache();
455 __ get_method(rmethod);
456 __ get_dispatch();
457
458 // Calculate stack limit
459 __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
460 __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
461 __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
462 __ ldr(rscratch2,
|