]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - dfg/DFGInvalidationPointInjectionPhase.cpp
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / dfg / DFGInvalidationPointInjectionPhase.cpp
index 510ed5c3d49390d63af603d9b1486330647caeb7..9228001cc5397315a7dd1c6ea27d6f56a48e0331 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,6 +28,7 @@
 
 #if ENABLE(DFG_JIT)
 
+#include "DFGBlockSetInlines.h"
 #include "DFGClobberize.h"
 #include "DFGGraph.h"
 #include "DFGInsertionSet.h"
@@ -50,7 +51,7 @@ public:
     {
         ASSERT(m_graph.m_form != SSA);
         
-        BitVector blocksThatNeedInvalidationPoints;
+        BlockSet blocksThatNeedInvalidationPoints;
         
         for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
             BasicBlock* block = m_graph.block(blockIndex);
@@ -63,17 +64,13 @@ public:
             // Note: this assumes that control flow occurs at bytecode instruction boundaries.
             if (m_originThatHadFire.isSet()) {
                 for (unsigned i = block->numSuccessors(); i--;)
-                    blocksThatNeedInvalidationPoints.set(block->successor(i)->index);
+                    blocksThatNeedInvalidationPoints.add(block->successor(i));
             }
             
             m_insertionSet.execute(block);
         }
-        
-        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
-            if (!blocksThatNeedInvalidationPoints.get(blockIndex))
-                continue;
-            
-            BasicBlock* block = m_graph.block(blockIndex);
+
+        for (BasicBlock* block : blocksThatNeedInvalidationPoints.iterable(m_graph)) {
             insertInvalidationCheck(0, block->at(0));
             m_insertionSet.execute(block);
         }