8200303: C2 should leverage profiling for lookupswitch/tableswitch

Reviewed-by: kvn, thartmann
This commit is contained in:
Roland Westrelin 2018-04-24 15:07:20 -07:00
parent c6ece0ba39
commit 93691571bc
12 changed files with 629 additions and 106 deletions

View file

@ -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.