diff options
Diffstat (limited to 'compiler/optimizing/escape.cc')
-rw-r--r-- | compiler/optimizing/escape.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/escape.cc b/compiler/optimizing/escape.cc index 9df5bf1017..0a92703bd4 100644 --- a/compiler/optimizing/escape.cc +++ b/compiler/optimizing/escape.cc @@ -36,6 +36,12 @@ void CalculateEscape(HInstruction* reference, *is_singleton = true; *is_singleton_and_not_returned = true; *is_singleton_and_not_deopt_visible = true; + + if (reference->IsNewInstance() && reference->AsNewInstance()->IsFinalizable()) { + // Finalizable reference is treated as being returned in the end. + *is_singleton_and_not_returned = false; + } + // Visit all uses to determine if this reference can escape into the heap, // a method call, an alias, etc. for (const HUseListNode<HInstruction*>& use : reference->GetUses()) { |