Mercurial > hg > graal-compiler
diff src/share/vm/ci/bcEscapeAnalyzer.cpp @ 4122:cc81b9c09bbb
7112478: after 7105605 JRuby bench_define_method_methods.rb fails with NPE
Summary: Fixed several EA issues with Connection Graph construction.
Reviewed-by: never, twisti
author | kvn |
---|---|
date | Mon, 28 Nov 2011 15:46:31 -0800 |
parents | 548597e74aa4 |
children | 5ed8f599a788 |
line wrap: on
line diff
--- a/src/share/vm/ci/bcEscapeAnalyzer.cpp Tue Nov 22 09:45:57 2011 +0100 +++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp Mon Nov 28 15:46:31 2011 -0800 @@ -150,11 +150,23 @@ clear_bits(vars, _arg_local); } -void BCEscapeAnalyzer::set_global_escape(ArgumentMap vars) { +void BCEscapeAnalyzer::set_global_escape(ArgumentMap vars, bool merge) { clear_bits(vars, _arg_local); clear_bits(vars, _arg_stack); if (vars.contains_allocated()) _allocated_escapes = true; + + if (merge && !vars.is_empty()) { + // Merge new state into already processed block. + // New state is not taken into account and + // it may invalidate set_returned() result. + if (vars.contains_unknown() || vars.contains_allocated()) { + _return_local = false; + } + if (vars.contains_unknown() || vars.contains_vars()) { + _return_allocated = false; + } + } } void BCEscapeAnalyzer::set_dirty(ArgumentMap vars) { @@ -999,7 +1011,7 @@ t.set_difference(d_state->_stack[i]); extra_vars.set_union(t); } - set_global_escape(extra_vars); + set_global_escape(extra_vars, true); } }