diff options
| author | 2017-08-29 18:55:36 +0000 | |
|---|---|---|
| committer | 2017-08-29 18:55:36 +0000 | |
| commit | 8920835161a359ce45250d04890bb054a3832977 (patch) | |
| tree | 9dae098363aab38bf331009cd0c3f6179f49465f /compiler/optimizing | |
| parent | 60f734443d54d48fad86dce6d80d8cef22a134d0 (diff) | |
| parent | fef2884b18bcc01cc40edb2ae809d42b5a510c33 (diff) | |
Merge "Simplify CreateReferenceInfoForReferenceType() in load-store-analysis"
Diffstat (limited to 'compiler/optimizing')
| -rw-r--r-- | compiler/optimizing/load_store_analysis.h | 52 |
1 files changed, 9 insertions, 43 deletions
diff --git a/compiler/optimizing/load_store_analysis.h b/compiler/optimizing/load_store_analysis.h index a2c17944f2..02bc254729 100644 --- a/compiler/optimizing/load_store_analysis.h +++ b/compiler/optimizing/load_store_analysis.h @@ -461,49 +461,15 @@ class HeapLocationCollector : public HGraphVisitor { has_heap_stores_ = true; } - void VisitNewInstance(HNewInstance* new_instance) OVERRIDE { - // Any references appearing in the ref_info_array_ so far cannot alias with new_instance. - CreateReferenceInfoForReferenceType(new_instance); - } - - void VisitNewArray(HNewArray* new_array) OVERRIDE { - // Any references appearing in the ref_info_array_ so far cannot alias with new_array. - CreateReferenceInfoForReferenceType(new_array); - } - - void VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* instruction) OVERRIDE { - CreateReferenceInfoForReferenceType(instruction); - } - - void VisitInvokeVirtual(HInvokeVirtual* instruction) OVERRIDE { - CreateReferenceInfoForReferenceType(instruction); - } - - void VisitInvokeInterface(HInvokeInterface* instruction) OVERRIDE { - CreateReferenceInfoForReferenceType(instruction); - } - - void VisitInvokeUnresolved(HInvokeUnresolved* instruction) OVERRIDE { - CreateReferenceInfoForReferenceType(instruction); - } - - void VisitInvokePolymorphic(HInvokePolymorphic* instruction) OVERRIDE { - CreateReferenceInfoForReferenceType(instruction); - } - - void VisitLoadString(HLoadString* instruction) OVERRIDE { - CreateReferenceInfoForReferenceType(instruction); - } - - void VisitPhi(HPhi* instruction) OVERRIDE { - CreateReferenceInfoForReferenceType(instruction); - } - - void VisitParameterValue(HParameterValue* instruction) OVERRIDE { - CreateReferenceInfoForReferenceType(instruction); - } - - void VisitSelect(HSelect* instruction) OVERRIDE { + void VisitInstruction(HInstruction* instruction) OVERRIDE { + // Any new-instance or new-array cannot alias with references that + // pre-exist the new-instance/new-array. We append entries into + // ref_info_array_ which keeps track of the order of creation + // of reference values since we visit the blocks in reverse post order. + // + // By default, VisitXXX() (including VisitPhi()) calls VisitInstruction(), + // unless VisitXXX() is overridden. VisitInstanceFieldGet() etc. above + // also call CreateReferenceInfoForReferenceType() explicitly. CreateReferenceInfoForReferenceType(instruction); } |