Break typecheck dependency in escape analysis.
authorverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 Aug 2013 09:26:18 +0000 (09:26 +0000)
committerverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 12 Aug 2013 09:26:18 +0000 (09:26 +0000)
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/22803002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16146 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/hydrogen-escape-analysis.cc
src/hydrogen-instructions.h

index 3300f0b..0359678 100644 (file)
@@ -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->ClearTypeCheck();
+          }
           ASSERT(mapcheck->HasNoUses());
+
           mapcheck->DeleteAndReplaceWith(NULL);
           break;
         }
index 815a6c6..b4fc656 100644 (file)
@@ -5568,6 +5568,7 @@ class HLoadNamedField: public HTemplateInstruction<2> {
   }
 
   bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); }
+  void ClearTypeCheck() { SetOperandAt(1, object()); }
   HObjectAccess access() const { return access_; }
   Representation field_representation() const {
       return access_.representation();