Skip to content

Commit c665dba

Browse files
committed
8266561: Remove Compile::_save_argument_registers
Reviewed-by: kvn, thartmann
1 parent 47d4438 commit c665dba

File tree

8 files changed

+32
-65
lines changed

8 files changed

+32
-65
lines changed

src/hotspot/share/opto/compile.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ Compile::Compile( ciEnv* ci_env, ciMethod* target, int osr_bci,
531531
bool subsume_loads, bool do_escape_analysis, bool eliminate_boxing, bool install_code, DirectiveSet* directive)
532532
: Phase(Compiler),
533533
_compile_id(ci_env->compile_id()),
534-
_save_argument_registers(false),
535534
_subsume_loads(subsume_loads),
536535
_do_escape_analysis(do_escape_analysis),
537536
_install_code(install_code),
@@ -825,12 +824,10 @@ Compile::Compile( ciEnv* ci_env,
825824
const char *stub_name,
826825
int is_fancy_jump,
827826
bool pass_tls,
828-
bool save_arg_registers,
829827
bool return_pc,
830828
DirectiveSet* directive)
831829
: Phase(Compiler),
832830
_compile_id(0),
833-
_save_argument_registers(save_arg_registers),
834831
_subsume_loads(true),
835832
_do_escape_analysis(false),
836833
_install_code(true),

src/hotspot/share/opto/compile.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ class Compile : public Phase {
244244
private:
245245
// Fixed parameters to this compilation.
246246
const int _compile_id;
247-
const bool _save_argument_registers; // save/restore arg regs for trampolines
248247
const bool _subsume_loads; // Load can be matched as part of a larger op.
249248
const bool _do_escape_analysis; // Do escape analysis.
250249
const bool _install_code; // Install the code that was compiled
@@ -510,7 +509,6 @@ class Compile : public Phase {
510509
bool eliminate_boxing() const { return _eliminate_boxing; }
511510
/** Do aggressive boxing elimination. */
512511
bool aggressive_unboxing() const { return _eliminate_boxing && AggressiveUnboxing; }
513-
bool save_argument_registers() const { return _save_argument_registers; }
514512
bool should_install_code() const { return _install_code; }
515513

516514
// Other fixed compilation parameters.
@@ -1030,7 +1028,7 @@ class Compile : public Phase {
10301028
Compile(ciEnv* ci_env, const TypeFunc *(*gen)(),
10311029
address stub_function, const char *stub_name,
10321030
int is_fancy_jump, bool pass_tls,
1033-
bool save_arg_registers, bool return_pc, DirectiveSet* directive);
1031+
bool return_pc, DirectiveSet* directive);
10341032

10351033
// Are we compiling a method?
10361034
bool has_method() { return method() != NULL; }

src/hotspot/share/opto/matcher.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -724,12 +724,10 @@ void Matcher::init_first_stack_mask() {
724724
}
725725

726726
//---------------------------is_save_on_entry----------------------------------
727-
bool Matcher::is_save_on_entry( int reg ) {
727+
bool Matcher::is_save_on_entry(int reg) {
728728
return
729729
_register_save_policy[reg] == 'E' ||
730-
_register_save_policy[reg] == 'A' || // Save-on-entry register?
731-
// Also save argument registers in the trampolining stubs
732-
(C->save_argument_registers() && is_spillable_arg(reg));
730+
_register_save_policy[reg] == 'A'; // Save-on-entry register?
733731
}
734732

735733
//---------------------------Fixup_Save_On_Entry-------------------------------
@@ -745,12 +743,6 @@ void Matcher::Fixup_Save_On_Entry( ) {
745743
StartNode *start = C->start();
746744
assert( start, "Expect a start node" );
747745

748-
// Save argument registers in the trampolining stubs
749-
if( C->save_argument_registers() )
750-
for( i = 0; i < _last_Mach_Reg; i++ )
751-
if( is_spillable_arg(i) )
752-
soe_cnt++;
753-
754746
// Input RegMask array shared by all Returns.
755747
// The type for doubles and longs has a count of 2, but
756748
// there is only 1 returned value

src/hotspot/share/opto/output.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,21 +1266,6 @@ void PhaseOutput::estimate_buffer_size(int& const_req) {
12661266
// Compute prolog code size
12671267
_method_size = 0;
12681268
_frame_slots = OptoReg::reg2stack(C->matcher()->_old_SP) + C->regalloc()->_framesize;
1269-
#if defined(IA64) && !defined(AIX)
1270-
if (save_argument_registers()) {
1271-
// 4815101: this is a stub with implicit and unknown precision fp args.
1272-
// The usual spill mechanism can only generate stfd's in this case, which
1273-
// doesn't work if the fp reg to spill contains a single-precision denorm.
1274-
// Instead, we hack around the normal spill mechanism using stfspill's and
1275-
// ldffill's in the MachProlog and MachEpilog emit methods. We allocate
1276-
// space here for the fp arg regs (f8-f15) we're going to thusly spill.
1277-
//
1278-
// If we ever implement 16-byte 'registers' == stack slots, we can
1279-
// get rid of this hack and have SpillCopy generate stfspill/ldffill
1280-
// instead of stfd/stfs/ldfd/ldfs.
1281-
_frame_slots += 8*(16/BytesPerInt);
1282-
}
1283-
#endif
12841269
assert(_frame_slots >= 0 && _frame_slots < 1000000, "sanity check");
12851270

12861271
if (C->has_mach_constant_base_node()) {
@@ -3356,8 +3341,7 @@ void PhaseOutput::install() {
33563341
if (!C->should_install_code()) {
33573342
return;
33583343
} else if (C->stub_function() != NULL) {
3359-
install_stub(C->stub_name(),
3360-
C->save_argument_registers());
3344+
install_stub(C->stub_name());
33613345
} else {
33623346
install_code(C->method(),
33633347
C->entry_bci(),
@@ -3412,8 +3396,7 @@ void PhaseOutput::install_code(ciMethod* target,
34123396
}
34133397
}
34143398
}
3415-
void PhaseOutput::install_stub(const char* stub_name,
3416-
bool caller_must_gc_arguments) {
3399+
void PhaseOutput::install_stub(const char* stub_name) {
34173400
// Entry point will be accessed using stub_entry_point();
34183401
if (code_buffer() == NULL) {
34193402
Matcher::soft_match_failure();
@@ -3432,7 +3415,7 @@ void PhaseOutput::install_stub(const char* stub_name,
34323415
// _code_offsets.value(CodeOffsets::Frame_Complete),
34333416
frame_size_in_words(),
34343417
oop_map_set(),
3435-
caller_must_gc_arguments);
3418+
false);
34363419
assert(rs != NULL && rs->is_runtime_stub(), "sanity check");
34373420

34383421
C->set_stub_entry_point(rs->entry_point());

src/hotspot/share/opto/output.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ class PhaseOutput : public Phase {
164164
bool has_wide_vectors,
165165
RTMState rtm_state);
166166

167-
void install_stub(const char* stub_name,
168-
bool caller_must_gc_arguments);
167+
void install_stub(const char* stub_name);
169168

170169
// Constant table
171170
ConstantTable& constant_table() { return _constant_table; }

src/hotspot/share/opto/runtime.cpp

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ static bool check_compiled_frame(JavaThread* thread) {
124124
#endif // ASSERT
125125

126126

127-
#define gen(env, var, type_func_gen, c_func, fancy_jump, pass_tls, save_arg_regs, return_pc) \
128-
var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, save_arg_regs, return_pc); \
127+
#define gen(env, var, type_func_gen, c_func, fancy_jump, pass_tls, return_pc) \
128+
var = generate_stub(env, type_func_gen, CAST_FROM_FN_PTR(address, c_func), #var, fancy_jump, pass_tls, return_pc); \
129129
if (var == NULL) { return false; }
130130

131131
bool OptoRuntime::generate(ciEnv* env) {
@@ -134,23 +134,23 @@ bool OptoRuntime::generate(ciEnv* env) {
134134

135135
// Note: tls: Means fetching the return oop out of the thread-local storage
136136
//
137-
// variable/name type-function-gen , runtime method ,fncy_jp, tls,save_args,retpc
137+
// variable/name type-function-gen , runtime method ,fncy_jp, tls,retpc
138138
// -------------------------------------------------------------------------------------------------------------------------------
139-
gen(env, _new_instance_Java , new_instance_Type , new_instance_C , 0 , true , false, false);
140-
gen(env, _new_array_Java , new_array_Type , new_array_C , 0 , true , false, false);
141-
gen(env, _new_array_nozero_Java , new_array_Type , new_array_nozero_C , 0 , true , false, false);
142-
gen(env, _multianewarray2_Java , multianewarray2_Type , multianewarray2_C , 0 , true , false, false);
143-
gen(env, _multianewarray3_Java , multianewarray3_Type , multianewarray3_C , 0 , true , false, false);
144-
gen(env, _multianewarray4_Java , multianewarray4_Type , multianewarray4_C , 0 , true , false, false);
145-
gen(env, _multianewarray5_Java , multianewarray5_Type , multianewarray5_C , 0 , true , false, false);
146-
gen(env, _multianewarrayN_Java , multianewarrayN_Type , multianewarrayN_C , 0 , true , false, false);
147-
gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C, 0, false, false, false);
148-
gen(env, _monitor_notify_Java , monitor_notify_Type , monitor_notify_C , 0 , false, false, false);
149-
gen(env, _monitor_notifyAll_Java , monitor_notify_Type , monitor_notifyAll_C , 0 , false, false, false);
150-
gen(env, _rethrow_Java , rethrow_Type , rethrow_C , 2 , true , false, true );
151-
152-
gen(env, _slow_arraycopy_Java , slow_arraycopy_Type , SharedRuntime::slow_arraycopy_C , 0 , false, false, false);
153-
gen(env, _register_finalizer_Java , register_finalizer_Type , register_finalizer , 0 , false, false, false);
139+
gen(env, _new_instance_Java , new_instance_Type , new_instance_C , 0 , true, false);
140+
gen(env, _new_array_Java , new_array_Type , new_array_C , 0 , true, false);
141+
gen(env, _new_array_nozero_Java , new_array_Type , new_array_nozero_C , 0 , true, false);
142+
gen(env, _multianewarray2_Java , multianewarray2_Type , multianewarray2_C , 0 , true, false);
143+
gen(env, _multianewarray3_Java , multianewarray3_Type , multianewarray3_C , 0 , true, false);
144+
gen(env, _multianewarray4_Java , multianewarray4_Type , multianewarray4_C , 0 , true, false);
145+
gen(env, _multianewarray5_Java , multianewarray5_Type , multianewarray5_C , 0 , true, false);
146+
gen(env, _multianewarrayN_Java , multianewarrayN_Type , multianewarrayN_C , 0 , true, false);
147+
gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C, 0, false, false);
148+
gen(env, _monitor_notify_Java , monitor_notify_Type , monitor_notify_C , 0 , false, false);
149+
gen(env, _monitor_notifyAll_Java , monitor_notify_Type , monitor_notifyAll_C , 0 , false, false);
150+
gen(env, _rethrow_Java , rethrow_Type , rethrow_C , 2 , true , true );
151+
152+
gen(env, _slow_arraycopy_Java , slow_arraycopy_Type , SharedRuntime::slow_arraycopy_C , 0 , false, false);
153+
gen(env, _register_finalizer_Java , register_finalizer_Type , register_finalizer , 0 , false, false);
154154

155155
return true;
156156
}
@@ -159,17 +159,16 @@ bool OptoRuntime::generate(ciEnv* env) {
159159

160160

161161
// Helper method to do generation of RunTimeStub's
162-
address OptoRuntime::generate_stub( ciEnv* env,
163-
TypeFunc_generator gen, address C_function,
164-
const char *name, int is_fancy_jump,
165-
bool pass_tls,
166-
bool save_argument_registers,
167-
bool return_pc) {
162+
address OptoRuntime::generate_stub(ciEnv* env,
163+
TypeFunc_generator gen, address C_function,
164+
const char *name, int is_fancy_jump,
165+
bool pass_tls,
166+
bool return_pc) {
168167

169168
// Matching the default directive, we currently have no method to match.
170169
DirectiveSet* directive = DirectivesStack::getDefaultDirective(CompileBroker::compiler(CompLevel_full_optimization));
171170
ResourceMark rm;
172-
Compile C( env, gen, C_function, name, is_fancy_jump, pass_tls, save_argument_registers, return_pc, directive);
171+
Compile C(env, gen, C_function, name, is_fancy_jump, pass_tls, return_pc, directive);
173172
DirectivesStack::release(directive);
174173
return C.stub_entry_point();
175174
}

src/hotspot/share/opto/runtime.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class OptoRuntime : public AllStatic {
130130

131131
private:
132132
// define stubs
133-
static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char *name, int is_fancy_jump, bool pass_tls, bool save_arguments, bool return_pc);
133+
static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char* name, int is_fancy_jump, bool pass_tls, bool return_pc);
134134

135135
// References to generated stubs
136136
static address _new_instance_Java;

src/hotspot/share/runtime/vmStructs.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,6 @@ typedef HashtableEntry<InstanceKlass*, mtClass> KlassHashtableEntry;
912912
c2_nonstatic_field(Compile, _regalloc, PhaseRegAlloc*) \
913913
c2_nonstatic_field(Compile, _method, ciMethod*) \
914914
c2_nonstatic_field(Compile, _compile_id, const int) \
915-
c2_nonstatic_field(Compile, _save_argument_registers, const bool) \
916915
c2_nonstatic_field(Compile, _subsume_loads, const bool) \
917916
c2_nonstatic_field(Compile, _do_escape_analysis, const bool) \
918917
c2_nonstatic_field(Compile, _eliminate_boxing, const bool) \

0 commit comments

Comments
 (0)