< prev index next >

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Print this page


   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  *


 819   // get synchronization object
 820   {
 821     Label done;
 822     __ ldrw(r0, access_flags);
 823     __ tst(r0, JVM_ACC_STATIC);
 824     // get receiver (assume this is frequent case)
 825     __ ldr(r0, Address(rlocals, Interpreter::local_offset_in_bytes(0)));
 826     __ br(Assembler::EQ, done);
 827     __ load_mirror(r0, rmethod);
 828 
 829 #ifdef ASSERT
 830     {
 831       Label L;
 832       __ cbnz(r0, L);
 833       __ stop("synchronization object is NULL");
 834       __ bind(L);
 835     }
 836 #endif // ASSERT
 837 
 838     __ bind(done);

 839   }
 840 
 841   // add space for monitor & lock
 842   __ sub(sp, sp, entry_size); // add space for a monitor entry
 843   __ sub(esp, esp, entry_size);
 844   __ mov(rscratch1, esp);
 845   __ str(rscratch1, monitor_block_top);  // set new monitor block top
 846   // store object
 847   __ str(r0, Address(esp, BasicObjectLock::obj_offset_in_bytes()));
 848   __ mov(c_rarg1, esp); // object address
 849   __ lock_object(c_rarg1);
 850 }
 851 
 852 // Generate a fixed interpreter frame. This is identical setup for
 853 // interpreted methods and for native methods hence the shared code.
 854 //
 855 // Args:
 856 //      lr: return address
 857 //      rmethod: Method*
 858 //      rlocals: pointer to locals


1045     __ safepoint_poll(slow_path);
1046 
1047     // We don't generate local frame and don't align stack because
1048     // we call stub code and there is no safepoint on this path.
1049 
1050     // Load parameters
1051     const Register crc = c_rarg0;  // crc
1052     const Register buf = c_rarg1;  // source java byte array address
1053     const Register len = c_rarg2;  // length
1054     const Register off = len;      // offset (never overlaps with 'len')
1055 
1056     // Arguments are reversed on java expression stack
1057     // Calculate address of start element
1058     if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
1059       __ ldr(buf, Address(esp, 2*wordSize)); // long buf
1060       __ ldrw(off, Address(esp, wordSize)); // offset
1061       __ add(buf, buf, off); // + offset
1062       __ ldrw(crc,   Address(esp, 4*wordSize)); // Initial CRC
1063     } else {
1064       __ ldr(buf, Address(esp, 2*wordSize)); // byte[] array

1065       __ add(buf, buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
1066       __ ldrw(off, Address(esp, wordSize)); // offset
1067       __ add(buf, buf, off); // + offset
1068       __ ldrw(crc,   Address(esp, 3*wordSize)); // Initial CRC
1069     }
1070     // Can now load 'len' since we're finished with 'off'
1071     __ ldrw(len, Address(esp, 0x0)); // Length
1072 
1073     __ andr(sp, r13, -16); // Restore the caller's SP
1074 
1075     // We are frameless so we can just jump to the stub.
1076     __ b(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()));
1077 
1078     // generate a vanilla native entry as the slow path
1079     __ bind(slow_path);
1080     __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
1081     return entry;
1082   }
1083   return NULL;
1084 }


   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  *


 819   // get synchronization object
 820   {
 821     Label done;
 822     __ ldrw(r0, access_flags);
 823     __ tst(r0, JVM_ACC_STATIC);
 824     // get receiver (assume this is frequent case)
 825     __ ldr(r0, Address(rlocals, Interpreter::local_offset_in_bytes(0)));
 826     __ br(Assembler::EQ, done);
 827     __ load_mirror(r0, rmethod);
 828 
 829 #ifdef ASSERT
 830     {
 831       Label L;
 832       __ cbnz(r0, L);
 833       __ stop("synchronization object is NULL");
 834       __ bind(L);
 835     }
 836 #endif // ASSERT
 837 
 838     __ bind(done);
 839     __ resolve_for_write(0, r0);
 840   }
 841 
 842   // add space for monitor & lock
 843   __ sub(sp, sp, entry_size); // add space for a monitor entry
 844   __ sub(esp, esp, entry_size);
 845   __ mov(rscratch1, esp);
 846   __ str(rscratch1, monitor_block_top);  // set new monitor block top
 847   // store object
 848   __ str(r0, Address(esp, BasicObjectLock::obj_offset_in_bytes()));
 849   __ mov(c_rarg1, esp); // object address
 850   __ lock_object(c_rarg1);
 851 }
 852 
 853 // Generate a fixed interpreter frame. This is identical setup for
 854 // interpreted methods and for native methods hence the shared code.
 855 //
 856 // Args:
 857 //      lr: return address
 858 //      rmethod: Method*
 859 //      rlocals: pointer to locals


1046     __ safepoint_poll(slow_path);
1047 
1048     // We don't generate local frame and don't align stack because
1049     // we call stub code and there is no safepoint on this path.
1050 
1051     // Load parameters
1052     const Register crc = c_rarg0;  // crc
1053     const Register buf = c_rarg1;  // source java byte array address
1054     const Register len = c_rarg2;  // length
1055     const Register off = len;      // offset (never overlaps with 'len')
1056 
1057     // Arguments are reversed on java expression stack
1058     // Calculate address of start element
1059     if (kind == Interpreter::java_util_zip_CRC32_updateByteBuffer) {
1060       __ ldr(buf, Address(esp, 2*wordSize)); // long buf
1061       __ ldrw(off, Address(esp, wordSize)); // offset
1062       __ add(buf, buf, off); // + offset
1063       __ ldrw(crc,   Address(esp, 4*wordSize)); // Initial CRC
1064     } else {
1065       __ ldr(buf, Address(esp, 2*wordSize)); // byte[] array
1066       __ resolve_for_read(IS_NOT_NULL, buf);
1067       __ add(buf, buf, arrayOopDesc::base_offset_in_bytes(T_BYTE)); // + header size
1068       __ ldrw(off, Address(esp, wordSize)); // offset
1069       __ add(buf, buf, off); // + offset
1070       __ ldrw(crc,   Address(esp, 3*wordSize)); // Initial CRC
1071     }
1072     // Can now load 'len' since we're finished with 'off'
1073     __ ldrw(len, Address(esp, 0x0)); // Length
1074 
1075     __ andr(sp, r13, -16); // Restore the caller's SP
1076 
1077     // We are frameless so we can just jump to the stub.
1078     __ b(CAST_FROM_FN_PTR(address, StubRoutines::updateBytesCRC32()));
1079 
1080     // generate a vanilla native entry as the slow path
1081     __ bind(slow_path);
1082     __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::native));
1083     return entry;
1084   }
1085   return NULL;
1086 }


< prev index next >