6589834: deoptimization problem with -XX:+DeoptimizeALot

Relocate the stack pointer adjustment to where uncommon_trap is actually inserted for new_array.

Reviewed-by: kvn, jrose
This commit is contained in:
Changpeng Fang 2009-04-23 14:04:24 -07:00
parent 273a47426e
commit 04fdef79fa
6 changed files with 139 additions and 17 deletions

View file

@ -2980,6 +2980,7 @@ Node* GraphKit::new_instance(Node* klass_node,
// See comments on new_instance for the meaning of the other arguments.
Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
Node* length, // number of array elements
int nargs, // number of arguments to push back for uncommon trap
bool raw_mem_only, // affect only raw memory
Node* *return_size_val) {
jint layout_con = Klass::_lh_neutral_value;
@ -2995,6 +2996,7 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable)
Node* cmp_lh = _gvn.transform( new(C, 3) CmpINode(layout_val, intcon(layout_con)) );
Node* bol_lh = _gvn.transform( new(C, 2) BoolNode(cmp_lh, BoolTest::eq) );
{ BuildCutout unless(this, bol_lh, PROB_MAX);
_sp += nargs;
uncommon_trap(Deoptimization::Reason_class_check,
Deoptimization::Action_maybe_recompile);
}