Skip to content

Commit bbf0a31

Browse files
committedOct 28, 2020
8255397: x86: coalesce reference and int entry points into vtos bytecodes
Reviewed-by: shade, coleenp
1 parent 3bd5b80 commit bbf0a31

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed
 

‎src/hotspot/cpu/x86/interp_masm_x86.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ void InterpreterMacroAssembler::push_i(Register r) {
605605
push(r);
606606
}
607607

608+
void InterpreterMacroAssembler::push_i_or_ptr(Register r) {
609+
push(r);
610+
}
611+
608612
void InterpreterMacroAssembler::push_f(XMMRegister r) {
609613
subptr(rsp, wordSize);
610614
movflt(Address(rsp, 0), r);

‎src/hotspot/cpu/x86/interp_masm_x86.hpp

+9
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,18 @@ class InterpreterMacroAssembler: public MacroAssembler {
139139
// Expression stack
140140
void pop_ptr(Register r = rax);
141141
void pop_i(Register r = rax);
142+
143+
// On x86, pushing a ptr or an int is semantically identical, but we
144+
// maintain a distinction for clarity and for making it easier to change
145+
// semantics in the future
142146
void push_ptr(Register r = rax);
143147
void push_i(Register r = rax);
144148

149+
// push_i_or_ptr is provided for when explicitly allowing either a ptr or
150+
// an int might have some advantage, while still documenting the fact that a
151+
// ptr might be pushed to the stack.
152+
void push_i_or_ptr(Register r = rax);
153+
145154
void push_f(XMMRegister r);
146155
void pop_f(XMMRegister r);
147156
void pop_d(XMMRegister r);

‎src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -1761,9 +1761,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t,
17611761
address& vep) {
17621762
assert(t->is_valid() && t->tos_in() == vtos, "illegal template");
17631763
Label L;
1764-
aep = __ pc(); // atos entry point
1765-
__ push_ptr();
1766-
__ jmp(L);
17671764
#ifndef _LP64
17681765
fep = __ pc(); // ftos entry point
17691766
__ push(ftos);
@@ -1782,8 +1779,8 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t,
17821779
lep = __ pc(); // ltos entry point
17831780
__ push_l();
17841781
__ jmp(L);
1785-
bep = cep = sep = iep = __ pc(); // [bcsi]tos entry point
1786-
__ push_i();
1782+
aep = bep = cep = sep = iep = __ pc(); // [abcsi]tos entry point
1783+
__ push_i_or_ptr();
17871784
vep = __ pc(); // vtos entry point
17881785
__ bind(L);
17891786
generate_and_dispatch(t);

0 commit comments

Comments
 (0)
Please sign in to comment.