mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8220502: Inefficient pre-sizing of PhiResolverState arrays in c1_LIRGenerator
Reviewed-by: thartmann, kvn
This commit is contained in:
parent
cace9d1c8e
commit
23e0276cc9
2 changed files with 10 additions and 16 deletions
|
@ -53,18 +53,13 @@
|
||||||
#define PATCHED_ADDR (max_jint)
|
#define PATCHED_ADDR (max_jint)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void PhiResolverState::reset(int max_vregs) {
|
void PhiResolverState::reset() {
|
||||||
// Initialize array sizes
|
_virtual_operands.clear();
|
||||||
_virtual_operands.at_put_grow(max_vregs - 1, NULL, NULL);
|
_other_operands.clear();
|
||||||
_virtual_operands.trunc_to(0);
|
_vreg_table.clear();
|
||||||
_other_operands.at_put_grow(max_vregs - 1, NULL, NULL);
|
|
||||||
_other_operands.trunc_to(0);
|
|
||||||
_vreg_table.at_put_grow(max_vregs - 1, NULL, NULL);
|
|
||||||
_vreg_table.trunc_to(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
// PhiResolver
|
// PhiResolver
|
||||||
|
|
||||||
|
@ -78,13 +73,13 @@ void PhiResolverState::reset(int max_vregs) {
|
||||||
// r2 := r3 becomes r1 := r2
|
// r2 := r3 becomes r1 := r2
|
||||||
// r1 := r2 r2 := r3
|
// r1 := r2 r2 := r3
|
||||||
|
|
||||||
PhiResolver::PhiResolver(LIRGenerator* gen, int max_vregs)
|
PhiResolver::PhiResolver(LIRGenerator* gen)
|
||||||
: _gen(gen)
|
: _gen(gen)
|
||||||
, _state(gen->resolver_state())
|
, _state(gen->resolver_state())
|
||||||
, _temp(LIR_OprFact::illegalOpr)
|
, _temp(LIR_OprFact::illegalOpr)
|
||||||
{
|
{
|
||||||
// reinitialize the shared state arrays
|
// reinitialize the shared state arrays
|
||||||
_state.reset(max_vregs);
|
_state.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1021,8 +1016,7 @@ void LIRGenerator::move_to_phi(ValueStack* cur_state) {
|
||||||
|
|
||||||
// a block with only one predecessor never has phi functions
|
// a block with only one predecessor never has phi functions
|
||||||
if (sux->number_of_preds() > 1) {
|
if (sux->number_of_preds() > 1) {
|
||||||
int max_phis = cur_state->stack_size() + cur_state->locals_size();
|
PhiResolver resolver(this);
|
||||||
PhiResolver resolver(this, _virtual_register_number + max_phis * 2);
|
|
||||||
|
|
||||||
ValueStack* sux_state = sux->state();
|
ValueStack* sux_state = sux->state();
|
||||||
Value sux_value;
|
Value sux_value;
|
||||||
|
|
|
@ -102,7 +102,7 @@ class ResolveNode: public CompilationResourceObj {
|
||||||
|
|
||||||
|
|
||||||
// This is shared state to be used by the PhiResolver so the operand
|
// This is shared state to be used by the PhiResolver so the operand
|
||||||
// arrays don't have to be reallocated for reach resolution.
|
// arrays don't have to be reallocated for each resolution.
|
||||||
class PhiResolverState: public CompilationResourceObj {
|
class PhiResolverState: public CompilationResourceObj {
|
||||||
friend class PhiResolver;
|
friend class PhiResolver;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ class PhiResolverState: public CompilationResourceObj {
|
||||||
public:
|
public:
|
||||||
PhiResolverState() {}
|
PhiResolverState() {}
|
||||||
|
|
||||||
void reset(int max_vregs);
|
void reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ class PhiResolver: public CompilationResourceObj {
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PhiResolver(LIRGenerator* _lir_gen, int max_vregs);
|
PhiResolver(LIRGenerator* _lir_gen);
|
||||||
~PhiResolver();
|
~PhiResolver();
|
||||||
|
|
||||||
void move(LIR_Opr src, LIR_Opr dest);
|
void move(LIR_Opr src, LIR_Opr dest);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue