6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "asm/macroAssembler.inline.hpp"
26 #include "gc/shared/modRefBarrierSetCodeGen.hpp"
27
28 #define __ masm->
29
30 void ModRefBarrierSetCodeGen::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
31 Register src, Register dst, Register count) {
32 if (type == T_OBJECT) {
33 bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0;
34 if (!checkcast) {
35 // save arguments for barrier generation
36 __ mov(dst, G1);
37 __ mov(count, G5);
38 gen_write_ref_array_pre_barrier(masm, decorators, G1, G5);
39 } else {
40 gen_write_ref_array_pre_barrier(masm, decorators, dst, count);
41 }
42 }
43 }
44
45 void ModRefBarrierSetCodeGen::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
46 Register src, Register dst, Register count) {
47 if (type == T_OBJECT) {
48 bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0;
49 if (!checkcast) {
50 // O0 is used as temp register
51 gen_write_ref_array_post_barrier(masm, decorators, G1, G5, O0);
52 } else {
53 gen_write_ref_array_post_barrier(masm, decorators, dst, count, O3);
54 }
55 }
56 }
|
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "asm/macroAssembler.inline.hpp"
26 #include "gc/shared/modRefBarrierSetAssembler.hpp"
27
28 #define __ masm->
29
30 void ModRefBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
31 Register src, Register dst, Register count) {
32 if (type == T_OBJECT) {
33 bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0;
34 if (!checkcast) {
35 // save arguments for barrier generation
36 __ mov(dst, G1);
37 __ mov(count, G5);
38 gen_write_ref_array_pre_barrier(masm, decorators, G1, G5);
39 } else {
40 gen_write_ref_array_pre_barrier(masm, decorators, dst, count);
41 }
42 }
43 }
44
45 void ModRefBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
46 Register src, Register dst, Register count) {
47 if (type == T_OBJECT) {
48 bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0;
49 if (!checkcast) {
50 // O0 is used as temp register
51 gen_write_ref_array_post_barrier(masm, decorators, G1, G5, O0);
52 } else {
53 gen_write_ref_array_post_barrier(masm, decorators, dst, count, O3);
54 }
55 }
56 }
|