src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2015, 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.


1161           __ mov(r0, (int)id);
1162           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), r0);
1163           __ should_not_reach_here();
1164           break;
1165         }
1166 
1167         const Register pre_val = r0;
1168         const Register thread = rthread;
1169         const Register tmp = rscratch1;
1170 
1171         Address in_progress(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1172                                              SATBMarkQueue::byte_offset_of_active()));
1173 
1174         Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1175                                              SATBMarkQueue::byte_offset_of_index()));
1176         Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1177                                         SATBMarkQueue::byte_offset_of_buf()));
1178 
1179         Label done;
1180         Label runtime;









1181 
1182         // Can we store original value in the thread's buffer?
1183         __ ldr(tmp, queue_index);
1184         __ cbz(tmp, runtime);
1185 
1186         __ sub(tmp, tmp, wordSize);
1187         __ str(tmp, queue_index);
1188         __ ldr(rscratch2, buffer);
1189         __ add(tmp, tmp, rscratch2);
1190         f.load_argument(0, rscratch2);
1191         __ str(rscratch2, Address(tmp, 0));
1192         __ b(done);
1193 
1194         __ bind(runtime);
1195         __ push_call_clobbered_registers();
1196         f.load_argument(0, pre_val);
1197         __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), pre_val, thread);
1198         __ pop_call_clobbered_registers();
1199         __ bind(done);
1200       }


   1 /*
   2  * Copyright (c) 1999, 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.


1161           __ mov(r0, (int)id);
1162           __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), r0);
1163           __ should_not_reach_here();
1164           break;
1165         }
1166 
1167         const Register pre_val = r0;
1168         const Register thread = rthread;
1169         const Register tmp = rscratch1;
1170 
1171         Address in_progress(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1172                                              SATBMarkQueue::byte_offset_of_active()));
1173 
1174         Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1175                                              SATBMarkQueue::byte_offset_of_index()));
1176         Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
1177                                         SATBMarkQueue::byte_offset_of_buf()));
1178 
1179         Label done;
1180         Label runtime;
1181 
1182         // Is marking still active?
1183         if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
1184           __ ldrw(tmp, in_progress);
1185         } else {
1186           assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
1187           __ ldrb(tmp, in_progress);
1188         }
1189         __ cbzw(tmp, done);
1190 
1191         // Can we store original value in the thread's buffer?
1192         __ ldr(tmp, queue_index);
1193         __ cbz(tmp, runtime);
1194 
1195         __ sub(tmp, tmp, wordSize);
1196         __ str(tmp, queue_index);
1197         __ ldr(rscratch2, buffer);
1198         __ add(tmp, tmp, rscratch2);
1199         f.load_argument(0, rscratch2);
1200         __ str(rscratch2, Address(tmp, 0));
1201         __ b(done);
1202 
1203         __ bind(runtime);
1204         __ push_call_clobbered_registers();
1205         f.load_argument(0, pre_val);
1206         __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), pre_val, thread);
1207         __ pop_call_clobbered_registers();
1208         __ bind(done);
1209       }