< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page
rev 49736 : 8185505: AArch64: Port AOT to AArch64
Reviewed-by: duke
   1 /*
   2  * Copyright (c) 2003, 2018, 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.
  23  *


 466   __ get_method(rmethod);
 467   __ get_dispatch();
 468 
 469   // Calculate stack limit
 470   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
 471   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
 472   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
 473   __ ldr(rscratch2,
 474          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
 475   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
 476   __ andr(sp, rscratch1, -16);
 477 
 478   // Restore expression stack pointer
 479   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 480   // NULL last_sp until next java call
 481   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 482 
 483 #if INCLUDE_JVMCI
 484   // Check if we need to take lock at entry of synchronized method.  This can
 485   // only occur on method entry so emit it only for vtos with step 0.
 486   if (EnableJVMCI && state == vtos && step == 0) {
 487     Label L;
 488     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 489     __ cbz(rscratch1, L);
 490     // Clear flag.
 491     __ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset()));
 492     // Take lock.
 493     lock_method();
 494     __ bind(L);
 495   } else {
 496 #ifdef ASSERT
 497     if (EnableJVMCI) {
 498       Label L;
 499       __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 500       __ cbz(rscratch1, L);
 501       __ stop("unexpected pending monitor in deopt entry");
 502       __ bind(L);
 503     }
 504 #endif
 505   }
 506 #endif


   1 /*
   2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * Copyright (c) 2014, 2018, 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.
  23  *


 466   __ get_method(rmethod);
 467   __ get_dispatch();
 468 
 469   // Calculate stack limit
 470   __ ldr(rscratch1, Address(rmethod, Method::const_offset()));
 471   __ ldrh(rscratch1, Address(rscratch1, ConstMethod::max_stack_offset()));
 472   __ add(rscratch1, rscratch1, frame::interpreter_frame_monitor_size() + 2);
 473   __ ldr(rscratch2,
 474          Address(rfp, frame::interpreter_frame_initial_sp_offset * wordSize));
 475   __ sub(rscratch1, rscratch2, rscratch1, ext::uxtx, 3);
 476   __ andr(sp, rscratch1, -16);
 477 
 478   // Restore expression stack pointer
 479   __ ldr(esp, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 480   // NULL last_sp until next java call
 481   __ str(zr, Address(rfp, frame::interpreter_frame_last_sp_offset * wordSize));
 482 
 483 #if INCLUDE_JVMCI
 484   // Check if we need to take lock at entry of synchronized method.  This can
 485   // only occur on method entry so emit it only for vtos with step 0.
 486   if ((EnableJVMCI || UseAOT) && state == vtos && step == 0) {
 487     Label L;
 488     __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 489     __ cbz(rscratch1, L);
 490     // Clear flag.
 491     __ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset()));
 492     // Take lock.
 493     lock_method();
 494     __ bind(L);
 495   } else {
 496 #ifdef ASSERT
 497     if (EnableJVMCI) {
 498       Label L;
 499       __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
 500       __ cbz(rscratch1, L);
 501       __ stop("unexpected pending monitor in deopt entry");
 502       __ bind(L);
 503     }
 504 #endif
 505   }
 506 #endif


< prev index next >