8207049: Minor improvements of compiler code

Reviewed-by: kvn, mdoerr
This commit is contained in:
Goetz Lindenmaier 2018-07-12 16:31:28 +02:00
parent f508eb1370
commit 2e682fa3cd
37 changed files with 158 additions and 115 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -3634,7 +3634,7 @@ int MatchNode::cisc_spill_match(FormDict& globals, RegisterForm* registers, Matc
&& (is_load_from_memory(mRule2->_opType) == data_type) // reg vs. (load memory)
&& (name_left != NULL) // NOT (load)
&& (name_right == NULL) ) { // NOT (load memory foo)
const Form *form2_left = name_left ? globals[name_left] : NULL;
const Form *form2_left = globals[name_left];
if( form2_left && form2_left->is_cisc_mem(globals) ) {
cisc_spillable = Is_cisc_spillable;
operand = _name;
@ -3645,7 +3645,7 @@ int MatchNode::cisc_spill_match(FormDict& globals, RegisterForm* registers, Matc
}
}
// Detect reg vs memory
else if( form->is_cisc_reg(globals) && form2->is_cisc_mem(globals) ) {
else if (form->is_cisc_reg(globals) && form2 != NULL && form2->is_cisc_mem(globals)) {
cisc_spillable = Is_cisc_spillable;
operand = _name;
reg_type = _result;
@ -3710,8 +3710,12 @@ int MatchRule::matchrule_cisc_spill_match(FormDict& globals, RegisterForm* regi
}
// Check right operands: recursive walk to identify reg->mem operand
if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) {
right_spillable = Maybe_cisc_spillable;
if (_rChild == NULL) {
if (mRule2->_rChild == NULL) {
right_spillable = Maybe_cisc_spillable;
} else {
assert(0, "_rChild should not be NULL");
}
} else {
right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type);
}