Revision: 16420
Author: [email protected]
Date: Thu Aug 29 11:55:31 2013 UTC
Log: Fix escape analysis for redefining operators.
This recognizes escape paths that flow through informative definitions
as an escaping use. This only applies to HCheckMaps so far.
[email protected]
Review URL: https://codereview.chromium.org/23514009
http://code.google.com/p/v8/source/detail?r=16420
Modified:
/branches/bleeding_edge/src/hydrogen-escape-analysis.cc
/branches/bleeding_edge/src/hydrogen-escape-analysis.h
=======================================
--- /branches/bleeding_edge/src/hydrogen-escape-analysis.cc Wed Aug 28
14:16:57 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-escape-analysis.cc Thu Aug 29
11:55:31 2013 UTC
@@ -31,21 +31,25 @@
namespace internal {
-void HEscapeAnalysisPhase::CollectIfNoEscapingUses(HInstruction* instr) {
- for (HUseIterator it(instr->uses()); !it.Done(); it.Advance()) {
+bool HEscapeAnalysisPhase::HasNoEscapingUses(HValue* value) {
+ for (HUseIterator it(value->uses()); !it.Done(); it.Advance()) {
HValue* use = it.value();
if (use->HasEscapingOperandAt(it.index())) {
if (FLAG_trace_escape_analysis) {
- PrintF("#%d (%s) escapes through #%d (%s) @%d\n", instr->id(),
- instr->Mnemonic(), use->id(), use->Mnemonic(), it.index());
+ PrintF("#%d (%s) escapes through #%d (%s) @%d\n", value->id(),
+ value->Mnemonic(), use->id(), use->Mnemonic(), it.index());
}
- return;
+ return false;
+ }
+ if (use->RedefinedOperandIndex() == it.index()
&& !HasNoEscapingUses(use)) {
+ if (FLAG_trace_escape_analysis) {
+ PrintF("#%d (%s) escapes redefinition #%d (%s) @%d\n", value->id(),
+ value->Mnemonic(), use->id(), use->Mnemonic(), it.index());
+ }
+ return false;
}
}
- if (FLAG_trace_escape_analysis) {
- PrintF("#%d (%s) is being captured\n", instr->id(), instr->Mnemonic());
- }
- captured_.Add(instr, zone());
+ return true;
}
@@ -55,8 +59,12 @@
HBasicBlock* block = graph()->blocks()->at(i);
for (HInstructionIterator it(block); !it.Done(); it.Advance()) {
HInstruction* instr = it.Current();
- if (instr->IsAllocate()) {
- CollectIfNoEscapingUses(instr);
+ if (instr->IsAllocate() && HasNoEscapingUses(instr)) {
+ if (FLAG_trace_escape_analysis) {
+ PrintF("#%d (%s) is being captured\n", instr->id(),
+ instr->Mnemonic());
+ }
+ captured_.Add(instr, zone());
}
}
}
=======================================
--- /branches/bleeding_edge/src/hydrogen-escape-analysis.h Wed Aug 28
14:16:57 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-escape-analysis.h Thu Aug 29
11:55:31 2013 UTC
@@ -52,7 +52,7 @@
private:
void CollectCapturedValues();
- void CollectIfNoEscapingUses(HInstruction* instr);
+ bool HasNoEscapingUses(HValue* value);
void PerformScalarReplacement();
void AnalyzeDataFlow(HInstruction* instr);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.