1 /*
2 * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2017, SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
2729 // slow unlocking, speed doesn't matter anyway and this solution is
2730 // simpler and requires less duplicated code - additionally, the
2731 // slow unlocking code is the same in either case which simplifies
2732 // debugging.
2733 __ b(*op->stub()->entry());
2734 }
2735 }
2736 __ bind(*op->stub()->continuation());
2737 }
2738
2739
2740 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
2741 ciMethod* method = op->profiled_method();
2742 int bci = op->profiled_bci();
2743 ciMethod* callee = op->profiled_callee();
2744
2745 // Update counter for all call types.
2746 ciMethodData* md = method->method_data_or_null();
2747 assert(md != NULL, "Sanity");
2748 ciProfileData* data = md->bci_to_data(bci);
2749 assert(data->is_CounterData(), "need CounterData for calls");
2750 assert(op->mdo()->is_single_cpu(), "mdo must be allocated");
2751 Register mdo = op->mdo()->as_register();
2752 #ifdef _LP64
2753 assert(op->tmp1()->is_double_cpu(), "tmp1 must be allocated");
2754 Register tmp1 = op->tmp1()->as_register_lo();
2755 #else
2756 assert(op->tmp1()->is_single_cpu(), "tmp1 must be allocated");
2757 Register tmp1 = op->tmp1()->as_register();
2758 #endif
2759 metadata2reg(md->constant_encoding(), mdo);
2760 int mdo_offset_bias = 0;
2761 if (!Assembler::is_simm16(md->byte_offset_of_slot(data, CounterData::count_offset()) +
2762 data->size_in_bytes())) {
2763 // The offset is large so bias the mdo by the base of the slot so
2764 // that the ld can use simm16s to reference the slots of the data.
2765 mdo_offset_bias = md->byte_offset_of_slot(data, CounterData::count_offset());
2766 __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
2767 }
2768
2769 // Perform additional virtual call profiling for invokevirtual and
|
1 /*
2 * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2017, SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
2729 // slow unlocking, speed doesn't matter anyway and this solution is
2730 // simpler and requires less duplicated code - additionally, the
2731 // slow unlocking code is the same in either case which simplifies
2732 // debugging.
2733 __ b(*op->stub()->entry());
2734 }
2735 }
2736 __ bind(*op->stub()->continuation());
2737 }
2738
2739
2740 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
2741 ciMethod* method = op->profiled_method();
2742 int bci = op->profiled_bci();
2743 ciMethod* callee = op->profiled_callee();
2744
2745 // Update counter for all call types.
2746 ciMethodData* md = method->method_data_or_null();
2747 assert(md != NULL, "Sanity");
2748 ciProfileData* data = md->bci_to_data(bci);
2749 assert(data != NULL && data->is_CounterData(), "need CounterData for calls");
2750 assert(op->mdo()->is_single_cpu(), "mdo must be allocated");
2751 Register mdo = op->mdo()->as_register();
2752 #ifdef _LP64
2753 assert(op->tmp1()->is_double_cpu(), "tmp1 must be allocated");
2754 Register tmp1 = op->tmp1()->as_register_lo();
2755 #else
2756 assert(op->tmp1()->is_single_cpu(), "tmp1 must be allocated");
2757 Register tmp1 = op->tmp1()->as_register();
2758 #endif
2759 metadata2reg(md->constant_encoding(), mdo);
2760 int mdo_offset_bias = 0;
2761 if (!Assembler::is_simm16(md->byte_offset_of_slot(data, CounterData::count_offset()) +
2762 data->size_in_bytes())) {
2763 // The offset is large so bias the mdo by the base of the slot so
2764 // that the ld can use simm16s to reference the slots of the data.
2765 mdo_offset_bias = md->byte_offset_of_slot(data, CounterData::count_offset());
2766 __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0);
2767 }
2768
2769 // Perform additional virtual call profiling for invokevirtual and
|