1 /*
2 * Copyright (c) 2008, 2016, 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 *
3133 add_debug_info_for_null_check(null_check_offset, op->info());
3134 }
3135 } else if (op->code() == lir_unlock) {
3136 __ unlock_object(hdr, obj, lock, tmp, *op->stub()->entry());
3137 } else {
3138 ShouldNotReachHere();
3139 }
3140 __ bind(*op->stub()->continuation());
3141 }
3142
3143
3144 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
3145 ciMethod* method = op->profiled_method();
3146 int bci = op->profiled_bci();
3147 ciMethod* callee = op->profiled_callee();
3148
3149 // Update counter for all call types
3150 ciMethodData* md = method->method_data_or_null();
3151 assert(md != NULL, "Sanity");
3152 ciProfileData* data = md->bci_to_data(bci);
3153 assert(data->is_CounterData(), "need CounterData for calls");
3154 assert(op->mdo()->is_single_cpu(), "mdo must be allocated");
3155 Register mdo = op->mdo()->as_register();
3156 assert(op->tmp1()->is_register(), "tmp1 must be allocated");
3157 Register tmp1 = op->tmp1()->as_pointer_register();
3158 assert_different_registers(mdo, tmp1);
3159 __ mov_metadata(mdo, md->constant_encoding());
3160 int mdo_offset_bias = 0;
3161 int max_offset = AARCH64_ONLY(4096 << LogBytesPerWord) NOT_AARCH64(4096);
3162 if (md->byte_offset_of_slot(data, CounterData::count_offset()) + data->size_in_bytes() >= max_offset) {
3163 // The offset is large so bias the mdo by the base of the slot so
3164 // that the ldr can use an immediate offset to reference the slots of the data
3165 mdo_offset_bias = md->byte_offset_of_slot(data, CounterData::count_offset());
3166 __ mov_slow(tmp1, mdo_offset_bias);
3167 __ add(mdo, mdo, tmp1);
3168 }
3169
3170 Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias);
3171 // Perform additional virtual call profiling for invokevirtual and
3172 // invokeinterface bytecodes
3173 if (op->should_profile_receiver_type()) {
|
1 /*
2 * Copyright (c) 2008, 2018, 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 *
3133 add_debug_info_for_null_check(null_check_offset, op->info());
3134 }
3135 } else if (op->code() == lir_unlock) {
3136 __ unlock_object(hdr, obj, lock, tmp, *op->stub()->entry());
3137 } else {
3138 ShouldNotReachHere();
3139 }
3140 __ bind(*op->stub()->continuation());
3141 }
3142
3143
3144 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
3145 ciMethod* method = op->profiled_method();
3146 int bci = op->profiled_bci();
3147 ciMethod* callee = op->profiled_callee();
3148
3149 // Update counter for all call types
3150 ciMethodData* md = method->method_data_or_null();
3151 assert(md != NULL, "Sanity");
3152 ciProfileData* data = md->bci_to_data(bci);
3153 assert(data != NULL && data->is_CounterData(), "need CounterData for calls");
3154 assert(op->mdo()->is_single_cpu(), "mdo must be allocated");
3155 Register mdo = op->mdo()->as_register();
3156 assert(op->tmp1()->is_register(), "tmp1 must be allocated");
3157 Register tmp1 = op->tmp1()->as_pointer_register();
3158 assert_different_registers(mdo, tmp1);
3159 __ mov_metadata(mdo, md->constant_encoding());
3160 int mdo_offset_bias = 0;
3161 int max_offset = AARCH64_ONLY(4096 << LogBytesPerWord) NOT_AARCH64(4096);
3162 if (md->byte_offset_of_slot(data, CounterData::count_offset()) + data->size_in_bytes() >= max_offset) {
3163 // The offset is large so bias the mdo by the base of the slot so
3164 // that the ldr can use an immediate offset to reference the slots of the data
3165 mdo_offset_bias = md->byte_offset_of_slot(data, CounterData::count_offset());
3166 __ mov_slow(tmp1, mdo_offset_bias);
3167 __ add(mdo, mdo, tmp1);
3168 }
3169
3170 Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias);
3171 // Perform additional virtual call profiling for invokevirtual and
3172 // invokeinterface bytecodes
3173 if (op->should_profile_receiver_type()) {
|