< prev index next >

src/cpu/sparc/vm/stubGenerator_sparc.cpp

Print this page
rev 7807 : [mq]: bcast
   1 /*
   2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


1002   //
1003   void gen_write_ref_array_post_barrier(Register addr, Register count,
1004                                         Register tmp) {
1005     BarrierSet* bs = Universe::heap()->barrier_set();
1006 
1007     switch (bs->kind()) {
1008       case BarrierSet::G1SATBCT:
1009       case BarrierSet::G1SATBCTLogging:
1010         {
1011           // Get some new fresh output registers.
1012           __ save_frame(0);
1013           __ mov(addr->after_save(), O0);
1014           __ call(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post));
1015           __ delayed()->mov(count->after_save(), O1);
1016           __ restore();
1017         }
1018         break;
1019       case BarrierSet::CardTableModRef:
1020       case BarrierSet::CardTableExtension:
1021         {
1022           CardTableModRefBS* ct = (CardTableModRefBS*)bs;
1023           assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
1024           assert_different_registers(addr, count, tmp);
1025 
1026           Label L_loop;
1027 
1028           __ sll_ptr(count, LogBytesPerHeapOop, count);
1029           __ sub(count, BytesPerHeapOop, count);
1030           __ add(count, addr, count);
1031           // Use two shifts to clear out those low order two bits! (Cannot opt. into 1.)
1032           __ srl_ptr(addr, CardTableModRefBS::card_shift, addr);
1033           __ srl_ptr(count, CardTableModRefBS::card_shift, count);
1034           __ sub(count, addr, count);
1035           AddressLiteral rs(ct->byte_map_base);
1036           __ set(rs, tmp);
1037         __ BIND(L_loop);
1038           __ stb(G0, tmp, addr);
1039           __ subcc(count, 1, count);
1040           __ brx(Assembler::greaterEqual, false, Assembler::pt, L_loop);
1041           __ delayed()->add(addr, 1, addr);
1042         }


   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


1002   //
1003   void gen_write_ref_array_post_barrier(Register addr, Register count,
1004                                         Register tmp) {
1005     BarrierSet* bs = Universe::heap()->barrier_set();
1006 
1007     switch (bs->kind()) {
1008       case BarrierSet::G1SATBCT:
1009       case BarrierSet::G1SATBCTLogging:
1010         {
1011           // Get some new fresh output registers.
1012           __ save_frame(0);
1013           __ mov(addr->after_save(), O0);
1014           __ call(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post));
1015           __ delayed()->mov(count->after_save(), O1);
1016           __ restore();
1017         }
1018         break;
1019       case BarrierSet::CardTableModRef:
1020       case BarrierSet::CardTableExtension:
1021         {
1022           CardTableModRefBS* ct = barrier_set_cast<CardTableModRefBS>(bs);
1023           assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
1024           assert_different_registers(addr, count, tmp);
1025 
1026           Label L_loop;
1027 
1028           __ sll_ptr(count, LogBytesPerHeapOop, count);
1029           __ sub(count, BytesPerHeapOop, count);
1030           __ add(count, addr, count);
1031           // Use two shifts to clear out those low order two bits! (Cannot opt. into 1.)
1032           __ srl_ptr(addr, CardTableModRefBS::card_shift, addr);
1033           __ srl_ptr(count, CardTableModRefBS::card_shift, count);
1034           __ sub(count, addr, count);
1035           AddressLiteral rs(ct->byte_map_base);
1036           __ set(rs, tmp);
1037         __ BIND(L_loop);
1038           __ stb(G0, tmp, addr);
1039           __ subcc(count, 1, count);
1040           __ brx(Assembler::greaterEqual, false, Assembler::pt, L_loop);
1041           __ delayed()->add(addr, 1, addr);
1042         }


< prev index next >