1 /*
2 * Copyright (c) 1999, 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 *
583 visitor->do_slow_case(_info);
584 else
585 visitor->do_slow_case();
586
587 visitor->do_input(_addr);
588 visitor->do_temp(_pre_val);
589 } else {
590 visitor->do_slow_case();
591 visitor->do_input(_pre_val);
592 }
593 }
594 #ifndef PRODUCT
595 virtual void print_name(outputStream* out) const { out->print("G1PreBarrierStub"); }
596 #endif // PRODUCT
597 };
598
599 class G1PostBarrierStub: public CodeStub {
600 private:
601 LIR_Opr _addr;
602 LIR_Opr _new_val;
603
604 static jbyte* _byte_map_base;
605 static jbyte* byte_map_base_slow();
606 static jbyte* byte_map_base() {
607 if (_byte_map_base == NULL) {
608 _byte_map_base = byte_map_base_slow();
609 }
610 return _byte_map_base;
611 }
612
613 public:
614 // addr (the address of the object head) and new_val must be registers.
615 G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { }
616
617 LIR_Opr addr() const { return _addr; }
618 LIR_Opr new_val() const { return _new_val; }
619
620 virtual void emit_code(LIR_Assembler* e);
621 virtual void visit(LIR_OpVisitState* visitor) {
622 // don't pass in the code emit info since it's processed in the fast path
623 visitor->do_slow_case();
624 visitor->do_input(_addr);
625 visitor->do_input(_new_val);
626 }
627 #ifndef PRODUCT
628 virtual void print_name(outputStream* out) const { out->print("G1PostBarrierStub"); }
629 #endif // PRODUCT
630 };
631
|
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 *
583 visitor->do_slow_case(_info);
584 else
585 visitor->do_slow_case();
586
587 visitor->do_input(_addr);
588 visitor->do_temp(_pre_val);
589 } else {
590 visitor->do_slow_case();
591 visitor->do_input(_pre_val);
592 }
593 }
594 #ifndef PRODUCT
595 virtual void print_name(outputStream* out) const { out->print("G1PreBarrierStub"); }
596 #endif // PRODUCT
597 };
598
599 class G1PostBarrierStub: public CodeStub {
600 private:
601 LIR_Opr _addr;
602 LIR_Opr _new_val;
603
604 public:
605 // addr (the address of the object head) and new_val must be registers.
606 G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { }
607
608 LIR_Opr addr() const { return _addr; }
609 LIR_Opr new_val() const { return _new_val; }
610
611 virtual void emit_code(LIR_Assembler* e);
612 virtual void visit(LIR_OpVisitState* visitor) {
613 // don't pass in the code emit info since it's processed in the fast path
614 visitor->do_slow_case();
615 visitor->do_input(_addr);
616 visitor->do_input(_new_val);
617 }
618 #ifndef PRODUCT
619 virtual void print_name(outputStream* out) const { out->print("G1PostBarrierStub"); }
620 #endif // PRODUCT
621 };
622
|