Skip to content

Commit 3a9a1eb

Browse files
zhengxiaolinXRealFYang
authored andcommitted
8278743: riscv: Remove the x4 register saving logic in Java frames
Reviewed-by: fyang
1 parent e7d712c commit 3a9a1eb

File tree

2 files changed

+26
-32
lines changed

2 files changed

+26
-32
lines changed

src/hotspot/cpu/riscv/frame_riscv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
// Entry frames
132132
// n.b. these values are determined by the layout defined in
133133
// stubGenerator for the Java call stub
134-
entry_frame_after_call_words = 23,
134+
entry_frame_after_call_words = 22,
135135
entry_frame_call_wrapper_offset = -10,
136136

137137
// we don't need a save area

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,18 @@ class StubGenerator: public StubCodeGenerator {
127127
// [ return_from_Java ] <--- sp
128128
// [ argument word n ]
129129
// ...
130-
// -23 [ argument word 1 ]
131-
// -22 [ saved x27 ] <--- sp_after_call
132-
// -21 [ saved x26 ]
133-
// -20 [ saved x25 ]
134-
// -19 [ saved x24 ]
135-
// -18 [ saved x23 ]
136-
// -17 [ saved x22 ]
137-
// -16 [ saved x21 ]
138-
// -15 [ saved x20 ]
139-
// -14 [ saved x19 ]
140-
// -13 [ saved x18 ]
141-
// -12 [ saved x9 ]
142-
// -11 [ thread pointer (x4) ]
130+
// -22 [ argument word 1 ]
131+
// -21 [ saved x27 ] <--- sp_after_call
132+
// -20 [ saved x26 ]
133+
// -19 [ saved x25 ]
134+
// -18 [ saved x24 ]
135+
// -17 [ saved x23 ]
136+
// -16 [ saved x22 ]
137+
// -15 [ saved x21 ]
138+
// -14 [ saved x20 ]
139+
// -13 [ saved x19 ]
140+
// -12 [ saved x18 ]
141+
// -11 [ saved x9 ]
143142
// -10 [ call wrapper (x10) ]
144143
// -9 [ result (x11) ]
145144
// -8 [ result type (x12) ]
@@ -154,21 +153,19 @@ class StubGenerator: public StubCodeGenerator {
154153

155154
// Call stub stack layout word offsets from fp
156155
enum call_stub_layout {
157-
sp_after_call_off = -22,
158-
159-
x27_off = -22,
160-
x26_off = -21,
161-
x25_off = -20,
162-
x24_off = -19,
163-
x23_off = -18,
164-
x22_off = -17,
165-
x21_off = -16,
166-
x20_off = -15,
167-
x19_off = -14,
168-
x18_off = -13,
169-
x9_off = -12,
170-
171-
x4_off = -11,
156+
sp_after_call_off = -21,
157+
158+
x27_off = -21,
159+
x26_off = -20,
160+
x25_off = -19,
161+
x24_off = -18,
162+
x23_off = -17,
163+
x22_off = -16,
164+
x21_off = -15,
165+
x20_off = -14,
166+
x19_off = -13,
167+
x18_off = -12,
168+
x9_off = -11,
172169

173170
call_wrapper_off = -10,
174171
result_off = -9,
@@ -214,7 +211,6 @@ class StubGenerator: public StubCodeGenerator {
214211
const Address x18_save (fp, x18_off * wordSize);
215212

216213
const Address x9_save (fp, x9_off * wordSize);
217-
const Address x4_save (fp, x4_off * wordSize);
218214

219215
// stub code
220216

@@ -236,7 +232,6 @@ class StubGenerator: public StubCodeGenerator {
236232
__ sd(c_rarg1, result);
237233
__ sd(c_rarg0, call_wrapper);
238234

239-
__ sd(x4, x4_save);
240235
__ sd(x9, x9_save);
241236

242237
__ sd(x18, x18_save);
@@ -353,7 +348,6 @@ class StubGenerator: public StubCodeGenerator {
353348
__ ld(x18, x18_save);
354349

355350
__ ld(x9, x9_save);
356-
__ ld(x4, x4_save);
357351

358352
__ ld(c_rarg0, call_wrapper);
359353
__ ld(c_rarg1, result);

0 commit comments

Comments
 (0)