< prev index next >

src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp

Print this page

  1 /*
  2  * Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2016, 2024 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.

177 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
178   _klass_reg = klass_reg;
179   _length = length;
180   _result = result;
181   _info = new CodeEmitInfo(info);
182 }
183 
184 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
185   __ bind(_entry);
186   assert(_klass_reg->as_register() == Z_R11, "call target expects klass in Z_R11");
187   __ lgr_if_needed(Z_R13, _length->as_register());
188   address a = Runtime1::entry_for (StubId::c1_new_type_array_id);
189   ce->emit_call_c(a);
190   CHECK_BAILOUT();
191   ce->add_call_info_here(_info);
192   ce->verify_oop_map(_info);
193   assert(_result->as_register() == Z_R2, "callee returns result in Z_R2,");
194   __ z_brul(_continuation);
195 }
196 
197 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {

198   _klass_reg = klass_reg;
199   _length = length;
200   _result = result;
201   _info = new CodeEmitInfo(info);

202 }
203 
204 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
205   __ bind(_entry);
206   assert(_klass_reg->as_register() == Z_R11, "call target expects klass in Z_R11");
207   __ lgr_if_needed(Z_R13, _length->as_register());
208   address a = Runtime1::entry_for (StubId::c1_new_object_array_id);
209   ce->emit_call_c(a);
210   CHECK_BAILOUT();
211   ce->add_call_info_here(_info);
212   ce->verify_oop_map(_info);
213   assert(_result->as_register() == Z_R2, "callee returns result in Z_R2,");
214   __ z_brul(_continuation);
215 }
216 
217 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
218   __ bind(_entry);
219   StubId enter_id;
220   if (ce->compilation()->has_fpu_code()) {
221     enter_id = StubId::c1_monitorenter_id;

427   ce->emit_static_call_stub();
428   CHECK_BAILOUT();
429 
430   // Prepend each BRASL with a nop.
431   __ relocate(relocInfo::static_call_type);
432   __ z_nop();
433   __ z_brasl(Z_R14, SharedRuntime::get_resolve_static_call_stub());
434   ce->add_call_info_here(info());
435   ce->verify_oop_map(info());
436 
437 #ifndef PRODUCT
438   if (PrintC1Statistics) {
439     __ load_const_optimized(Z_R1_scratch, (address)&Runtime1::_arraycopy_slowcase_cnt);
440     __ add2mem_32(Address(Z_R1_scratch), 1, Z_R0_scratch);
441   }
442 #endif
443 
444   __ branch_optimized(Assembler::bcondAlways, _continuation);
445 }
446 


























447 #undef __

  1 /*
  2  * Copyright (c) 2016, 2026, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2016, 2024 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.

177 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
178   _klass_reg = klass_reg;
179   _length = length;
180   _result = result;
181   _info = new CodeEmitInfo(info);
182 }
183 
184 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
185   __ bind(_entry);
186   assert(_klass_reg->as_register() == Z_R11, "call target expects klass in Z_R11");
187   __ lgr_if_needed(Z_R13, _length->as_register());
188   address a = Runtime1::entry_for (StubId::c1_new_type_array_id);
189   ce->emit_call_c(a);
190   CHECK_BAILOUT();
191   ce->add_call_info_here(_info);
192   ce->verify_oop_map(_info);
193   assert(_result->as_register() == Z_R2, "callee returns result in Z_R2,");
194   __ z_brul(_continuation);
195 }
196 
197 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result,
198                                        CodeEmitInfo* info, bool is_null_free) {
199   _klass_reg = klass_reg;
200   _length = length;
201   _result = result;
202   _info = new CodeEmitInfo(info);
203   _is_null_free = is_null_free; // unimplemented
204 }
205 
206 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
207   __ bind(_entry);
208   assert(_klass_reg->as_register() == Z_R11, "call target expects klass in Z_R11");
209   __ lgr_if_needed(Z_R13, _length->as_register());
210   address a = Runtime1::entry_for (StubId::c1_new_object_array_id);
211   ce->emit_call_c(a);
212   CHECK_BAILOUT();
213   ce->add_call_info_here(_info);
214   ce->verify_oop_map(_info);
215   assert(_result->as_register() == Z_R2, "callee returns result in Z_R2,");
216   __ z_brul(_continuation);
217 }
218 
219 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
220   __ bind(_entry);
221   StubId enter_id;
222   if (ce->compilation()->has_fpu_code()) {
223     enter_id = StubId::c1_monitorenter_id;

429   ce->emit_static_call_stub();
430   CHECK_BAILOUT();
431 
432   // Prepend each BRASL with a nop.
433   __ relocate(relocInfo::static_call_type);
434   __ z_nop();
435   __ z_brasl(Z_R14, SharedRuntime::get_resolve_static_call_stub());
436   ce->add_call_info_here(info());
437   ce->verify_oop_map(info());
438 
439 #ifndef PRODUCT
440   if (PrintC1Statistics) {
441     __ load_const_optimized(Z_R1_scratch, (address)&Runtime1::_arraycopy_slowcase_cnt);
442     __ add2mem_32(Address(Z_R1_scratch), 1, Z_R0_scratch);
443   }
444 #endif
445 
446   __ branch_optimized(Assembler::bcondAlways, _continuation);
447 }
448 
449 // Implementation of SubstitutabilityCheckStub
450 SubstitutabilityCheckStub::SubstitutabilityCheckStub(LIR_Opr left, LIR_Opr right, CodeEmitInfo* info) {
451   Unimplemented();
452 }
453 
454 void SubstitutabilityCheckStub::emit_code(LIR_Assembler* ce) {
455   Unimplemented();
456 }
457 
458 LoadFlattenedArrayStub::LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) {
459   Unimplemented();
460 }
461 
462 void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
463   Unimplemented();
464 }
465 
466 // Implementation of StoreFlattenedArrayStub
467 
468 StoreFlattenedArrayStub::StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info) {
469   Unimplemented();
470 }
471 
472 void StoreFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
473   Unimplemented();
474 }
475 #undef __
< prev index next >