< prev index next >

src/hotspot/cpu/riscv/c1_CodeStubs_riscv.cpp

Print this page

  1 /*
  2  * Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  4  * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
  5  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  6  *
  7  * This code is free software; you can redistribute it and/or modify it
  8  * under the terms of the GNU General Public License version 2 only, as
  9  * published by the Free Software Foundation.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any

149 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
150   _klass_reg = klass_reg;
151   _length = length;
152   _result = result;
153   _info = new CodeEmitInfo(info);
154 }
155 
156 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
157   assert(__ rsp_offset() == 0, "frame size should be fixed");
158   __ bind(_entry);
159   assert(_length->as_register() == x9, "length must in x9");
160   assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
161   __ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_new_type_array_id)));
162   ce->add_call_info_here(_info);
163   ce->verify_oop_map(_info);
164   assert(_result->as_register() == x10, "result must in x10");
165   __ j(_continuation);
166 }
167 
168 // Implementation of NewObjectArrayStub
169 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {

170   _klass_reg = klass_reg;
171   _result = result;
172   _length = length;
173   _info = new CodeEmitInfo(info);

174 }
175 
176 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
177   assert(__ rsp_offset() == 0, "frame size should be fixed");
178   __ bind(_entry);
179   assert(_length->as_register() == x9, "length must in x9");
180   assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
181   __ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_new_object_array_id)));
182   ce->add_call_info_here(_info);
183   ce->verify_oop_map(_info);
184   assert(_result->as_register() == x10, "result must in x10");
185   __ j(_continuation);
186 }
187 
188 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
189   assert(__ rsp_offset() == 0, "frame size should be fixed");
190   __ bind(_entry);
191   ce->store_parameter(_obj_reg->as_register(),  1);
192   ce->store_parameter(_lock_reg->as_register(), 0);
193   StubId enter_id;

313   }
314   Address resolve(SharedRuntime::get_resolve_static_call_stub(),
315                   relocInfo::static_call_type);
316   address call = __ reloc_call(resolve);
317   if (call == nullptr) {
318     ce->bailout("reloc call address stub overflow");
319     return;
320   }
321   ce->add_call_info_here(info());
322 
323 #ifndef PRODUCT
324   if (PrintC1Statistics) {
325     __ la(t1, ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
326     __ incrementw(Address(t1));
327   }
328 #endif
329 
330   __ j(_continuation);
331 }
332 


























333 #undef __

  1 /*
  2  * Copyright (c) 1999, 2026, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2014, Red Hat Inc. All rights reserved.
  4  * Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
  5  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  6  *
  7  * This code is free software; you can redistribute it and/or modify it
  8  * under the terms of the GNU General Public License version 2 only, as
  9  * published by the Free Software Foundation.
 10  *
 11  * This code is distributed in the hope that it will be useful, but WITHOUT
 12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 14  * version 2 for more details (a copy is included in the LICENSE file that
 15  * accompanied this code).
 16  *
 17  * You should have received a copy of the GNU General Public License version
 18  * 2 along with this work; if not, write to the Free Software Foundation,
 19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 20  *
 21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 22  * or visit www.oracle.com if you need additional information or have any

149 NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
150   _klass_reg = klass_reg;
151   _length = length;
152   _result = result;
153   _info = new CodeEmitInfo(info);
154 }
155 
156 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
157   assert(__ rsp_offset() == 0, "frame size should be fixed");
158   __ bind(_entry);
159   assert(_length->as_register() == x9, "length must in x9");
160   assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
161   __ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_new_type_array_id)));
162   ce->add_call_info_here(_info);
163   ce->verify_oop_map(_info);
164   assert(_result->as_register() == x10, "result must in x10");
165   __ j(_continuation);
166 }
167 
168 // Implementation of NewObjectArrayStub
169 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result,
170                                        CodeEmitInfo* info, bool is_null_free) {
171   _klass_reg = klass_reg;
172   _result = result;
173   _length = length;
174   _info = new CodeEmitInfo(info);
175   _is_null_free = is_null_free; // unimplemented
176 }
177 
178 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
179   assert(__ rsp_offset() == 0, "frame size should be fixed");
180   __ bind(_entry);
181   assert(_length->as_register() == x9, "length must in x9");
182   assert(_klass_reg->as_register() == x13, "klass_reg must in x13");
183   __ far_call(RuntimeAddress(Runtime1::entry_for(StubId::c1_new_object_array_id)));
184   ce->add_call_info_here(_info);
185   ce->verify_oop_map(_info);
186   assert(_result->as_register() == x10, "result must in x10");
187   __ j(_continuation);
188 }
189 
190 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
191   assert(__ rsp_offset() == 0, "frame size should be fixed");
192   __ bind(_entry);
193   ce->store_parameter(_obj_reg->as_register(),  1);
194   ce->store_parameter(_lock_reg->as_register(), 0);
195   StubId enter_id;

315   }
316   Address resolve(SharedRuntime::get_resolve_static_call_stub(),
317                   relocInfo::static_call_type);
318   address call = __ reloc_call(resolve);
319   if (call == nullptr) {
320     ce->bailout("reloc call address stub overflow");
321     return;
322   }
323   ce->add_call_info_here(info());
324 
325 #ifndef PRODUCT
326   if (PrintC1Statistics) {
327     __ la(t1, ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
328     __ incrementw(Address(t1));
329   }
330 #endif
331 
332   __ j(_continuation);
333 }
334 
335 // Implementation of SubstitutabilityCheckStub
336 SubstitutabilityCheckStub::SubstitutabilityCheckStub(LIR_Opr left, LIR_Opr right, CodeEmitInfo* info) {
337   Unimplemented();
338 }
339 
340 void SubstitutabilityCheckStub::emit_code(LIR_Assembler* ce) {
341   Unimplemented();
342 }
343 
344 LoadFlattenedArrayStub::LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) {
345   Unimplemented();
346 }
347 
348 void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
349   Unimplemented();
350 }
351 
352 // Implementation of StoreFlattenedArrayStub
353 
354 StoreFlattenedArrayStub::StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info) {
355   Unimplemented();
356 }
357 
358 void StoreFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
359   Unimplemented();
360 }
361 #undef __
< prev index next >