1 /*
2 * Copyright (c) 1999, 2013, 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 *
522 // At this point we know that marking is in progress.
523 // If do_load() is true then we have to emit the
524 // load of the previous value; otherwise it has already
525 // been loaded into _pre_val.
526
527 __ bind(_entry);
528 assert(pre_val()->is_register(), "Precondition.");
529
530 Register pre_val_reg = pre_val()->as_register();
531
532 if (do_load()) {
533 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
534 }
535
536 __ cmpptr(pre_val_reg, (int32_t) NULL_WORD);
537 __ jcc(Assembler::equal, _continuation);
538 ce->store_parameter(pre_val()->as_register(), 0);
539 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_pre_barrier_slow_id)));
540 __ jmp(_continuation);
541
542 }
543
544 jbyte* G1PostBarrierStub::_byte_map_base = NULL;
545
546 jbyte* G1PostBarrierStub::byte_map_base_slow() {
547 BarrierSet* bs = Universe::heap()->barrier_set();
548 assert(bs->is_a(BarrierSet::G1SATBCTLogging),
549 "Must be if we're using this.");
550 return ((G1SATBCardTableModRefBS*)bs)->byte_map_base;
551 }
552
553 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
554 __ bind(_entry);
555 assert(addr()->is_register(), "Precondition.");
556 assert(new_val()->is_register(), "Precondition.");
557 Register new_val_reg = new_val()->as_register();
558 __ cmpptr(new_val_reg, (int32_t) NULL_WORD);
559 __ jcc(Assembler::equal, _continuation);
560 ce->store_parameter(addr()->as_pointer_register(), 0);
561 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_post_barrier_slow_id)));
562 __ jmp(_continuation);
563 }
564
565 #endif // INCLUDE_ALL_GCS
566 /////////////////////////////////////////////////////////////////////////////
567
568 #undef __
|
1 /*
2 * Copyright (c) 1999, 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 *
522 // At this point we know that marking is in progress.
523 // If do_load() is true then we have to emit the
524 // load of the previous value; otherwise it has already
525 // been loaded into _pre_val.
526
527 __ bind(_entry);
528 assert(pre_val()->is_register(), "Precondition.");
529
530 Register pre_val_reg = pre_val()->as_register();
531
532 if (do_load()) {
533 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
534 }
535
536 __ cmpptr(pre_val_reg, (int32_t) NULL_WORD);
537 __ jcc(Assembler::equal, _continuation);
538 ce->store_parameter(pre_val()->as_register(), 0);
539 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_pre_barrier_slow_id)));
540 __ jmp(_continuation);
541
542 }
543
544 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
545 __ bind(_entry);
546 assert(addr()->is_register(), "Precondition.");
547 assert(new_val()->is_register(), "Precondition.");
548 Register new_val_reg = new_val()->as_register();
549 __ cmpptr(new_val_reg, (int32_t) NULL_WORD);
550 __ jcc(Assembler::equal, _continuation);
551 ce->store_parameter(addr()->as_pointer_register(), 0);
552 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_post_barrier_slow_id)));
553 __ jmp(_continuation);
554 }
555
556 #endif // INCLUDE_ALL_GCS
557 /////////////////////////////////////////////////////////////////////////////
558
559 #undef __
|