mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
6892658: C2 should optimize some stringbuilder patterns
Reviewed-by: kvn, twisti
This commit is contained in:
parent
63cc2211ed
commit
9db2092b1b
35 changed files with 2245 additions and 115 deletions
|
@ -912,15 +912,29 @@ bool PhaseMacroExpand::eliminate_allocate_node(AllocateNode *alloc) {
|
|||
return false;
|
||||
}
|
||||
|
||||
CompileLog* log = C->log();
|
||||
if (log != NULL) {
|
||||
Node* klass = alloc->in(AllocateNode::KlassNode);
|
||||
const TypeKlassPtr* tklass = _igvn.type(klass)->is_klassptr();
|
||||
log->head("eliminate_allocation type='%d'",
|
||||
log->identify(tklass->klass()));
|
||||
JVMState* p = alloc->jvms();
|
||||
while (p != NULL) {
|
||||
log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
|
||||
p = p->caller();
|
||||
}
|
||||
log->tail("eliminate_allocation");
|
||||
}
|
||||
|
||||
process_users_of_allocation(alloc);
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintEliminateAllocations) {
|
||||
if (alloc->is_AllocateArray())
|
||||
tty->print_cr("++++ Eliminated: %d AllocateArray", alloc->_idx);
|
||||
else
|
||||
tty->print_cr("++++ Eliminated: %d Allocate", alloc->_idx);
|
||||
}
|
||||
if (PrintEliminateAllocations) {
|
||||
if (alloc->is_AllocateArray())
|
||||
tty->print_cr("++++ Eliminated: %d AllocateArray", alloc->_idx);
|
||||
else
|
||||
tty->print_cr("++++ Eliminated: %d Allocate", alloc->_idx);
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
|
@ -1639,6 +1653,18 @@ bool PhaseMacroExpand::eliminate_locking_node(AbstractLockNode *alock) {
|
|||
} // if (!oldbox->is_eliminated())
|
||||
} // if (alock->is_Lock() && !lock->is_coarsened())
|
||||
|
||||
CompileLog* log = C->log();
|
||||
if (log != NULL) {
|
||||
log->head("eliminate_lock lock='%d'",
|
||||
alock->is_Lock());
|
||||
JVMState* p = alock->jvms();
|
||||
while (p != NULL) {
|
||||
log->elem("jvms bci='%d' method='%d'", p->bci(), log->identify(p->method()));
|
||||
p = p->caller();
|
||||
}
|
||||
log->tail("eliminate_lock");
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
if (PrintEliminateLocks) {
|
||||
if (alock->is_Lock()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue