Skip to content

Commit

Permalink
Cleanup further Argument constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealMDoerr committed Sep 11, 2023
1 parent cd250eb commit a37fd00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 1 addition & 6 deletions src/hotspot/cpu/ppc/assembler_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ class Argument {
int _number; // The number of the argument.
public:
enum {
// Only 8 registers may contain integer parameters.
n_register_parameters = 8,
// Can have up to 8 floating registers.
n_float_register_parameters = 8,

// PPC C calling conventions.
// The first eight arguments are passed in int regs if they are int.
n_int_register_parameters_c = 8,
Expand All @@ -155,7 +150,7 @@ class Argument {
int number() const { return _number; }

// Locating register-based arguments:
bool is_register() const { return _number < n_register_parameters; }
bool is_register() const { return _number < n_int_register_parameters_c; }

Register as_register() const {
assert(is_register(), "must be a register argument");
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,14 +940,14 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist
in_bytes(ConstMethod::size_of_parameters_offset()), Rconst_method);
if (native_call) {
// If we're calling a native method, we reserve space for the worst-case signature
// handler varargs vector, which is max(Argument::n_register_parameters, parameter_count+2).
// handler varargs vector, which is max(Argument::n_int_register_parameters_c, parameter_count+2).
// We add two slots to the parameter_count, one for the jni
// environment and one for a possible native mirror.
Label skip_native_calculate_max_stack;
__ addi(Rtop_frame_size, Rsize_of_parameters, 2);
__ cmpwi(CCR0, Rtop_frame_size, Argument::n_register_parameters);
__ cmpwi(CCR0, Rtop_frame_size, Argument::n_int_register_parameters_c);
__ bge(CCR0, skip_native_calculate_max_stack);
__ li(Rtop_frame_size, Argument::n_register_parameters);
__ li(Rtop_frame_size, Argument::n_int_register_parameters_c);
__ bind(skip_native_calculate_max_stack);
__ sldi(Rsize_of_parameters, Rsize_of_parameters, Interpreter::logStackElementSize);
__ sldi(Rtop_frame_size, Rtop_frame_size, Interpreter::logStackElementSize);
Expand Down Expand Up @@ -1339,7 +1339,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
// outgoing argument area.
//
// Not needed on PPC64.
//__ add(SP, SP, Argument::n_register_parameters*BytesPerWord);
//__ add(SP, SP, Argument::n_int_register_parameters_c*BytesPerWord);

assert(result_handler_addr->is_nonvolatile(), "result_handler_addr must be in a non-volatile register");
// Save across call to native method.
Expand Down

0 comments on commit a37fd00

Please sign in to comment.