Skip to content

Commit 8bbd264

Browse files
offamitkumarRealLucy
authored andcommitted
8307423: [s390x] Represent Registers as values
Reviewed-by: mdoerr, lucy
1 parent 959e62c commit 8bbd264

8 files changed

+256
-395
lines changed

src/hotspot/cpu/s390/assembler_s390.hpp

-5
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@ class Address {
189189
_index(noreg),
190190
_disp(0) {}
191191

192-
Address(Register base, Register index, intptr_t disp = 0) :
193-
_base(base),
194-
_index(index),
195-
_disp(disp) {}
196-
197192
Address(Register base, intptr_t disp = 0) :
198193
_base(base),
199194
_index(noreg),

src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -856,13 +856,13 @@ void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) {
856856
// 4-byte accesses only! Don't use it to access 8 bytes!
857857
Address LIR_Assembler::as_Address_hi(LIR_Address* addr) {
858858
ShouldNotCallThis();
859-
return 0; // unused
859+
return Address(); // unused
860860
}
861861

862862
// 4-byte accesses only! Don't use it to access 8 bytes!
863863
Address LIR_Assembler::as_Address_lo(LIR_Address* addr) {
864864
ShouldNotCallThis();
865-
return 0; // unused
865+
return Address(); // unused
866866
}
867867

868868
void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code,

src/hotspot/cpu/s390/interpreterRT_s390.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2016 SAP SE. All rights reserved.
3+
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@ InterpreterRuntime::SignatureHandlerGenerator::SignatureHandlerGenerator(
7373
void InterpreterRuntime::SignatureHandlerGenerator::pass_int() {
7474
int int_arg_nr = jni_offset() - _fp_arg_nr;
7575
Register r = (int_arg_nr < 5 /*max_int_register_arguments*/) ?
76-
as_Register(int_arg_nr) + Z_ARG1->encoding() : Z_R0;
76+
as_Register(int_arg_nr + Z_ARG1->encoding()) : Z_R0;
7777

7878
__ z_lgf(r, locals_j_arg_at(offset()));
7979
if (DEBUG_ONLY(true ||) int_arg_nr >= 5) {
@@ -84,7 +84,7 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_int() {
8484
void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
8585
int int_arg_nr = jni_offset() - _fp_arg_nr;
8686
Register r = (int_arg_nr < 5 /*max_int_register_arguments*/) ?
87-
as_Register(int_arg_nr) + Z_ARG1->encoding() : Z_R0;
87+
as_Register(int_arg_nr + Z_ARG1->encoding()) : Z_R0;
8888

8989
__ z_lg(r, locals_j_arg_at(offset() + 1)); // Long resides in upper slot.
9090
if (DEBUG_ONLY(true ||) int_arg_nr >= 5) {
@@ -115,7 +115,7 @@ void InterpreterRuntime::SignatureHandlerGenerator::pass_double() {
115115
void InterpreterRuntime::SignatureHandlerGenerator::pass_object() {
116116
int int_arg_nr = jni_offset() - _fp_arg_nr;
117117
Register r = (int_arg_nr < 5 /*max_int_register_arguments*/) ?
118-
as_Register(int_arg_nr) + Z_ARG1->encoding() : Z_R0;
118+
as_Register(int_arg_nr + Z_ARG1->encoding()) : Z_R0;
119119

120120
// The handle for a receiver will never be null.
121121
bool do_nullptr_check = offset() != 0 || is_static();

src/hotspot/cpu/s390/methodHandles_s390.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2016, 2017 SAP SE. All rights reserved.
3+
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -638,7 +638,7 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt
638638
if (!log_is_enabled(Info, methodhandles)) { return; }
639639

640640
// If arg registers are contiguous, we can use STMG/LMG.
641-
assert((Z_ARG5->encoding() - Z_ARG1->encoding() + 1) == RegisterImpl::number_of_arg_registers, "Oops");
641+
assert((Z_ARG5->encoding() - Z_ARG1->encoding() + 1) == Register::number_of_arg_registers, "Oops");
642642

643643
BLOCK_COMMENT("trace_method_handle {");
644644

src/hotspot/cpu/s390/register_s390.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2016, 2017 SAP SE. All rights reserved.
2+
* Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2016, 2023 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
66
* This code is free software; you can redistribute it and/or modify it
@@ -27,27 +27,27 @@
2727
#include "register_s390.hpp"
2828

2929

30-
const int ConcreteRegisterImpl::max_gpr = RegisterImpl::number_of_registers * 2;
30+
const int ConcreteRegisterImpl::max_gpr = Register::number_of_registers * 2;
3131
const int ConcreteRegisterImpl::max_fpr = ConcreteRegisterImpl::max_gpr +
32-
FloatRegisterImpl::number_of_registers * 2;
32+
FloatRegister::number_of_registers * 2;
3333

34-
const char* RegisterImpl::name() const {
34+
const char* Register::name() const {
3535
const char* names[number_of_registers] = {
3636
"Z_R0", "Z_R1", "Z_R2", "Z_R3", "Z_R4", "Z_R5", "Z_R6", "Z_R7",
3737
"Z_R8", "Z_R9", "Z_R10", "Z_R11", "Z_R12", "Z_R13", "Z_R14", "Z_R15"
3838
};
3939
return is_valid() ? names[encoding()] : "noreg";
4040
}
4141

42-
const char* FloatRegisterImpl::name() const {
42+
const char* FloatRegister::name() const {
4343
const char* names[number_of_registers] = {
44-
"Z_F0", "Z_F1", "Z_F2", "Z_F3", "Z_F4", "Z_F5", "Z_F6", "Z_F7", "Z_F8", "Z_F9",
45-
"Z_F10", "Z_F11", "Z_F12", "Z_F13", "Z_F14", "Z_F15"
44+
"Z_F0", "Z_F1", "Z_F2", "Z_F3", "Z_F4", "Z_F5", "Z_F6", "Z_F7",
45+
"Z_F8", "Z_F9", "Z_F10", "Z_F11", "Z_F12", "Z_F13", "Z_F14", "Z_F15"
4646
};
4747
return is_valid() ? names[encoding()] : "fnoreg";
4848
}
4949

50-
const char* VectorRegisterImpl::name() const {
50+
const char* VectorRegister::name() const {
5151
const char* names[number_of_registers] = {
5252
"Z_V0", "Z_V1", "Z_V2", "Z_V3", "Z_V4", "Z_V5", "Z_V6", "Z_V7",
5353
"Z_V8", "Z_V9", "Z_V10", "Z_V11", "Z_V12", "Z_V13", "Z_V14", "Z_V15",

0 commit comments

Comments
 (0)