1 /*
2 * Copyright (c) 2000, 2012, 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 *
3495 __ lea(c_rarg1, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type)));
3496 __ mov(c_rarg2, length);
3497
3498 #else
3499 __ lea(tmp, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type)));
3500 store_parameter(tmp, 0);
3501 __ lea(tmp, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type)));
3502 store_parameter(tmp, 1);
3503 store_parameter(length, 2);
3504 #endif // _LP64
3505
3506 bool disjoint = (flags & LIR_OpArrayCopy::overlapping) == 0;
3507 bool aligned = (flags & LIR_OpArrayCopy::unaligned) == 0;
3508 const char *name;
3509 address entry = StubRoutines::select_arraycopy_function(basic_type, aligned, disjoint, name, false);
3510 __ call_VM_leaf(entry, 0);
3511
3512 __ bind(*stub->continuation());
3513 }
3514
3515
3516 void LIR_Assembler::emit_lock(LIR_OpLock* op) {
3517 Register obj = op->obj_opr()->as_register(); // may not be an oop
3518 Register hdr = op->hdr_opr()->as_register();
3519 Register lock = op->lock_opr()->as_register();
3520 if (!UseFastLocking) {
3521 __ jmp(*op->stub()->entry());
3522 } else if (op->code() == lir_lock) {
3523 Register scratch = noreg;
3524 if (UseBiasedLocking) {
3525 scratch = op->scratch_opr()->as_register();
3526 }
3527 assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header");
3528 // add debug info for NullPointerException only if one is possible
3529 int null_check_offset = __ lock_object(hdr, obj, lock, scratch, *op->stub()->entry());
3530 if (op->info() != NULL) {
3531 add_debug_info_for_null_check(null_check_offset, op->info());
3532 }
3533 // done
3534 } else if (op->code() == lir_unlock) {
|
1 /*
2 * Copyright (c) 2000, 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 *
3495 __ lea(c_rarg1, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type)));
3496 __ mov(c_rarg2, length);
3497
3498 #else
3499 __ lea(tmp, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type)));
3500 store_parameter(tmp, 0);
3501 __ lea(tmp, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type)));
3502 store_parameter(tmp, 1);
3503 store_parameter(length, 2);
3504 #endif // _LP64
3505
3506 bool disjoint = (flags & LIR_OpArrayCopy::overlapping) == 0;
3507 bool aligned = (flags & LIR_OpArrayCopy::unaligned) == 0;
3508 const char *name;
3509 address entry = StubRoutines::select_arraycopy_function(basic_type, aligned, disjoint, name, false);
3510 __ call_VM_leaf(entry, 0);
3511
3512 __ bind(*stub->continuation());
3513 }
3514
3515 void LIR_Assembler::emit_updatecrc32(LIR_OpUpdateCRC32* op) {
3516 assert(op->crc()->is_single_cpu(), "crc must be register");
3517 assert(op->val()->is_single_cpu(), "byte value must be register");
3518 assert(op->result_opr()->is_single_cpu(), "result must be register");
3519 Register crc = op->crc()->as_register();
3520 Register val = op->val()->as_register();
3521 Register res = op->result_opr()->as_register();
3522
3523 assert_different_registers(val, crc, res);
3524
3525 __ lea(res, ExternalAddress(StubRoutines::crc_table_addr()));
3526 __ notl(crc); // ~crc
3527 __ update_byte_crc32(crc, val, res);
3528 __ notl(crc); // ~crc
3529 __ mov(res, crc);
3530 }
3531
3532 void LIR_Assembler::emit_lock(LIR_OpLock* op) {
3533 Register obj = op->obj_opr()->as_register(); // may not be an oop
3534 Register hdr = op->hdr_opr()->as_register();
3535 Register lock = op->lock_opr()->as_register();
3536 if (!UseFastLocking) {
3537 __ jmp(*op->stub()->entry());
3538 } else if (op->code() == lir_lock) {
3539 Register scratch = noreg;
3540 if (UseBiasedLocking) {
3541 scratch = op->scratch_opr()->as_register();
3542 }
3543 assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header");
3544 // add debug info for NullPointerException only if one is possible
3545 int null_check_offset = __ lock_object(hdr, obj, lock, scratch, *op->stub()->entry());
3546 if (op->info() != NULL) {
3547 add_debug_info_for_null_check(null_check_offset, op->info());
3548 }
3549 // done
3550 } else if (op->code() == lir_unlock) {
|