1 /*
2 * Copyright (c) 2008, 2025, 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 *
139 _length = length;
140 _result = result;
141 _info = new CodeEmitInfo(info);
142 }
143
144
145 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
146 assert(_result->as_register() == R0, "runtime call setup");
147 assert(_klass_reg->as_register() == R1, "runtime call setup");
148 assert(_length->as_register() == R2, "runtime call setup");
149 __ bind(_entry);
150 __ call(Runtime1::entry_for(StubId::c1_new_type_array_id), relocInfo::runtime_call_type);
151 ce->add_call_info_here(_info);
152 ce->verify_oop_map(_info);
153 __ b(_continuation);
154 }
155
156
157 // Implementation of NewObjectArrayStub
158
159 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) {
160 _klass_reg = klass_reg;
161 _result = result;
162 _length = length;
163 _info = new CodeEmitInfo(info);
164 }
165
166
167 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
168 assert(_result->as_register() == R0, "runtime call setup");
169 assert(_klass_reg->as_register() == R1, "runtime call setup");
170 assert(_length->as_register() == R2, "runtime call setup");
171 __ bind(_entry);
172 __ call(Runtime1::entry_for(StubId::c1_new_object_array_id), relocInfo::runtime_call_type);
173 ce->add_call_info_here(_info);
174 ce->verify_oop_map(_info);
175 __ b(_continuation);
176 }
177
178 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
179 __ bind(_entry);
180 const Register obj_reg = _obj_reg->as_pointer_register();
181 const Register lock_reg = _lock_reg->as_pointer_register();
182
183 ce->verify_reserved_argument_area_size(2);
407 for (int i = 0; i < 5; i++) {
408 VMReg arg = args[i].first();
409 if (arg->is_stack()) {
410 __ str(r[i], Address(SP, arg->reg2stack() * VMRegImpl::stack_slot_size));
411 } else {
412 assert(r[i] == arg->as_Register(), "Calling conventions must match");
413 }
414 }
415
416 ce->emit_static_call_stub();
417 if (ce->compilation()->bailed_out()) {
418 return; // CodeCache is full
419 }
420 int ret_addr_offset = __ patchable_call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);
421 assert(ret_addr_offset == __ offset(), "embedded return address not allowed");
422 ce->add_call_info_here(info());
423 ce->verify_oop_map(info());
424 __ b(_continuation);
425 }
426
427 #undef __
|
1 /*
2 * Copyright (c) 2008, 2026, 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 *
139 _length = length;
140 _result = result;
141 _info = new CodeEmitInfo(info);
142 }
143
144
145 void NewTypeArrayStub::emit_code(LIR_Assembler* ce) {
146 assert(_result->as_register() == R0, "runtime call setup");
147 assert(_klass_reg->as_register() == R1, "runtime call setup");
148 assert(_length->as_register() == R2, "runtime call setup");
149 __ bind(_entry);
150 __ call(Runtime1::entry_for(StubId::c1_new_type_array_id), relocInfo::runtime_call_type);
151 ce->add_call_info_here(_info);
152 ce->verify_oop_map(_info);
153 __ b(_continuation);
154 }
155
156
157 // Implementation of NewObjectArrayStub
158
159 NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result,
160 CodeEmitInfo* info, bool is_null_free) {
161 _klass_reg = klass_reg;
162 _result = result;
163 _length = length;
164 _info = new CodeEmitInfo(info);
165 _is_null_free = is_null_free; // unimplemented
166 }
167
168
169 void NewObjectArrayStub::emit_code(LIR_Assembler* ce) {
170 assert(_result->as_register() == R0, "runtime call setup");
171 assert(_klass_reg->as_register() == R1, "runtime call setup");
172 assert(_length->as_register() == R2, "runtime call setup");
173 __ bind(_entry);
174 __ call(Runtime1::entry_for(StubId::c1_new_object_array_id), relocInfo::runtime_call_type);
175 ce->add_call_info_here(_info);
176 ce->verify_oop_map(_info);
177 __ b(_continuation);
178 }
179
180 void MonitorEnterStub::emit_code(LIR_Assembler* ce) {
181 __ bind(_entry);
182 const Register obj_reg = _obj_reg->as_pointer_register();
183 const Register lock_reg = _lock_reg->as_pointer_register();
184
185 ce->verify_reserved_argument_area_size(2);
409 for (int i = 0; i < 5; i++) {
410 VMReg arg = args[i].first();
411 if (arg->is_stack()) {
412 __ str(r[i], Address(SP, arg->reg2stack() * VMRegImpl::stack_slot_size));
413 } else {
414 assert(r[i] == arg->as_Register(), "Calling conventions must match");
415 }
416 }
417
418 ce->emit_static_call_stub();
419 if (ce->compilation()->bailed_out()) {
420 return; // CodeCache is full
421 }
422 int ret_addr_offset = __ patchable_call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);
423 assert(ret_addr_offset == __ offset(), "embedded return address not allowed");
424 ce->add_call_info_here(info());
425 ce->verify_oop_map(info());
426 __ b(_continuation);
427 }
428
429 // Implementation of SubstitutabilityCheckStub
430 SubstitutabilityCheckStub::SubstitutabilityCheckStub(LIR_Opr left, LIR_Opr right, CodeEmitInfo* info) {
431 Unimplemented();
432 }
433
434 void SubstitutabilityCheckStub::emit_code(LIR_Assembler* ce) {
435 Unimplemented();
436 }
437
438 LoadFlattenedArrayStub::LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) {
439 Unimplemented();
440 }
441
442 void LoadFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
443 Unimplemented();
444 }
445
446 // Implementation of StoreFlattenedArrayStub
447
448 StoreFlattenedArrayStub::StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info) {
449 Unimplemented();
450 }
451
452 void StoreFlattenedArrayStub::emit_code(LIR_Assembler* ce) {
453 Unimplemented();
454 }
455
456 #undef __
|