mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
6799693: Server compiler leads to data corruption when expression throws an Exception
Use merged memory state for an allocation's slow path. Reviewed-by: never
This commit is contained in:
parent
72b75d1adf
commit
94a461f4cb
4 changed files with 120 additions and 29 deletions
|
@ -952,13 +952,6 @@ void PhaseMacroExpand::expand_allocate_common(
|
|||
Node* klass_node = alloc->in(AllocateNode::KlassNode);
|
||||
Node* initial_slow_test = alloc->in(AllocateNode::InitialTest);
|
||||
|
||||
// With escape analysis, the entire memory state was needed to be able to
|
||||
// eliminate the allocation. Since the allocations cannot be eliminated,
|
||||
// optimize it to the raw slice.
|
||||
if (mem->is_MergeMem()) {
|
||||
mem = mem->as_MergeMem()->memory_at(Compile::AliasIdxRaw);
|
||||
}
|
||||
|
||||
assert(ctrl != NULL, "must have control");
|
||||
// We need a Region and corresponding Phi's to merge the slow-path and fast-path results.
|
||||
// they will not be used if "always_slow" is set
|
||||
|
@ -1016,6 +1009,11 @@ void PhaseMacroExpand::expand_allocate_common(
|
|||
Node *slow_mem = mem; // save the current memory state for slow path
|
||||
// generate the fast allocation code unless we know that the initial test will always go slow
|
||||
if (!always_slow) {
|
||||
// Fast path modifies only raw memory.
|
||||
if (mem->is_MergeMem()) {
|
||||
mem = mem->as_MergeMem()->memory_at(Compile::AliasIdxRaw);
|
||||
}
|
||||
|
||||
Node* eden_top_adr;
|
||||
Node* eden_end_adr;
|
||||
|
||||
|
@ -1239,8 +1237,6 @@ void PhaseMacroExpand::expand_allocate_common(
|
|||
}
|
||||
}
|
||||
|
||||
mem = result_phi_rawmem;
|
||||
|
||||
// An allocate node has separate i_o projections for the uses on the control and i_o paths
|
||||
// Replace uses of the control i_o projection with result_phi_i_o (unless we are only generating a slow call)
|
||||
if (_ioproj_fallthrough == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue