Reviewers: Michael Starzinger,

Message:
PTAL

Description:
Break typecheck dependency in escape analysis.

Please review this at https://chromiumcodereview.appspot.com/22803002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/hydrogen-escape-analysis.cc
  M src/hydrogen-instructions.h


Index: src/hydrogen-escape-analysis.cc
diff --git a/src/hydrogen-escape-analysis.cc b/src/hydrogen-escape-analysis.cc index 3300f0b1bf7da655ec5c3e53dc3a4be2bc03536e..4a1e65d8562510593d04a28a160eb0828cc65aaa 100644
--- a/src/hydrogen-escape-analysis.cc
+++ b/src/hydrogen-escape-analysis.cc
@@ -212,7 +212,14 @@ void HEscapeAnalysisPhase::AnalyzeDataFlow(HInstruction* allocate) {
           if (mapcheck->value() != allocate) continue;
// TODO(mstarzinger): This approach breaks if the tracked map value
           // is not a HConstant. Find a repro test case and fix this.
+ for (HUseIterator it(mapcheck->uses()); !it.Done(); it.Advance()) {
+            if (!it.value()->IsLoadNamedField()) continue;
+            HLoadNamedField* load = HLoadNamedField::cast(it.value());
+            ASSERT(load->typecheck() == mapcheck);
+            load->clear_typecheck();
+          }
           ASSERT(mapcheck->HasNoUses());
+
           mapcheck->DeleteAndReplaceWith(NULL);
           break;
         }
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 815a6c69f5d7ff66adb2384c66695f76d4bbef19..ea178dc61a345dff0e09a218b14cf86dc4e34572 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -5568,6 +5568,7 @@ class HLoadNamedField: public HTemplateInstruction<2> {
   }

   bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); }
+  void clear_typecheck() { SetOperandAt(1, object()); }
   HObjectAccess access() const { return access_; }
   Representation field_representation() const {
       return access_.representation();


--
--
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.

Reply via email to