1 /*
2 * Copyright (c) 2005, 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 *
252 __ move(left, tmp);
253 __ shift_left(left, log2_jint(c - 1), left);
254 __ add(left, tmp, result);
255 return true;
256 }
257 }
258 return false;
259 }
260
261
262 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) {
263 BasicType type = item->type();
264 __ store(item, new LIR_Address(FrameMap::rsp_opr, in_bytes(offset_from_sp), type));
265 }
266
267 void LIRGenerator::array_store_check(LIR_Opr value, LIR_Opr array, CodeEmitInfo* store_check_info, ciMethod* profiled_method, int profiled_bci) {
268 LIR_Opr tmp1 = new_register(objectType);
269 LIR_Opr tmp2 = new_register(objectType);
270 LIR_Opr tmp3 = new_register(objectType);
271 __ store_check(value, array, tmp1, tmp2, tmp3, store_check_info, profiled_method, profiled_bci);
272 }
273
274 //----------------------------------------------------------------------
275 // visitor functions
276 //----------------------------------------------------------------------
277
278 void LIRGenerator::do_MonitorEnter(MonitorEnter* x) {
279 assert(x->is_pinned(),"");
280 LIRItem obj(x->obj(), this);
281 obj.load_item();
282
283 set_no_result(x);
284
285 // "lock" stores the address of the monitor stack slot, so this is not an oop
286 LIR_Opr lock = new_register(T_INT);
287 // Need a scratch register for biased locking on x86
288 LIR_Opr scratch = LIR_OprFact::illegalOpr;
289 if (UseBiasedLocking || x->maybe_valuetype()) {
290 scratch = new_register(T_INT);
291 }
|
1 /*
2 * Copyright (c) 2005, 2019, 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 *
252 __ move(left, tmp);
253 __ shift_left(left, log2_jint(c - 1), left);
254 __ add(left, tmp, result);
255 return true;
256 }
257 }
258 return false;
259 }
260
261
262 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) {
263 BasicType type = item->type();
264 __ store(item, new LIR_Address(FrameMap::rsp_opr, in_bytes(offset_from_sp), type));
265 }
266
267 void LIRGenerator::array_store_check(LIR_Opr value, LIR_Opr array, CodeEmitInfo* store_check_info, ciMethod* profiled_method, int profiled_bci) {
268 LIR_Opr tmp1 = new_register(objectType);
269 LIR_Opr tmp2 = new_register(objectType);
270 LIR_Opr tmp3 = new_register(objectType);
271 __ store_check(value, array, tmp1, tmp2, tmp3, store_check_info, profiled_method, profiled_bci);
272 }
273
274 void LIRGenerator::flattened_array_store_check(LIR_Opr value, ciKlass* element_klass, CodeEmitInfo* store_check_info) {
275 LIR_Opr tmp1 = new_register(T_METADATA);
276 LIR_Opr tmp2 = LIR_OprFact::illegalOpr;
277
278 #ifdef _LP64
279 if (!UseCompressedClassPointers) {
280 tmp2 = new_register(T_METADATA);
281 __ metadata2reg(element_klass->constant_encoding(), tmp2);
282 }
283 #endif
284
285 __ flattened_store_check(value, element_klass, tmp1, tmp2, store_check_info);
286 }
287
288 //----------------------------------------------------------------------
289 // visitor functions
290 //----------------------------------------------------------------------
291
292 void LIRGenerator::do_MonitorEnter(MonitorEnter* x) {
293 assert(x->is_pinned(),"");
294 LIRItem obj(x->obj(), this);
295 obj.load_item();
296
297 set_no_result(x);
298
299 // "lock" stores the address of the monitor stack slot, so this is not an oop
300 LIR_Opr lock = new_register(T_INT);
301 // Need a scratch register for biased locking on x86
302 LIR_Opr scratch = LIR_OprFact::illegalOpr;
303 if (UseBiasedLocking || x->maybe_valuetype()) {
304 scratch = new_register(T_INT);
305 }
|