mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8200303: C2 should leverage profiling for lookupswitch/tableswitch
Reviewed-by: kvn, thartmann
This commit is contained in:
parent
c6ece0ba39
commit
93691571bc
12 changed files with 629 additions and 106 deletions
|
@ -1324,7 +1324,7 @@ void GraphBuilder::ret(int local_index) {
|
|||
void GraphBuilder::table_switch() {
|
||||
Bytecode_tableswitch sw(stream());
|
||||
const int l = sw.length();
|
||||
if (CanonicalizeNodes && l == 1) {
|
||||
if (CanonicalizeNodes && l == 1 && compilation()->env()->comp_level() != CompLevel_full_profile) {
|
||||
// total of 2 successors => use If instead of switch
|
||||
// Note: This code should go into the canonicalizer as soon as it can
|
||||
// can handle canonicalized forms that contain more than one node.
|
||||
|
@ -1368,7 +1368,7 @@ void GraphBuilder::table_switch() {
|
|||
void GraphBuilder::lookup_switch() {
|
||||
Bytecode_lookupswitch sw(stream());
|
||||
const int l = sw.number_of_pairs();
|
||||
if (CanonicalizeNodes && l == 1) {
|
||||
if (CanonicalizeNodes && l == 1 && compilation()->env()->comp_level() != CompLevel_full_profile) {
|
||||
// total of 2 successors => use If instead of switch
|
||||
// Note: This code should go into the canonicalizer as soon as it can
|
||||
// can handle canonicalized forms that contain more than one node.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue