- Fixed regexp logging issue.
authorchristian.plesner.hansen@gmail.com <christian.plesner.hansen@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 2 Dec 2008 08:16:12 +0000 (08:16 +0000)
committerchristian.plesner.hansen@gmail.com <christian.plesner.hansen@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 2 Dec 2008 08:16:12 +0000 (08:16 +0000)
- Removed use of std::set.

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

src/jsregexp.cc
src/jsregexp.h
src/log.cc

index 8bafc28..bf9d4de 100644 (file)
@@ -25,9 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-#define _HAS_EXCEPTIONS 0
-#include <set>
-
 #include "v8.h"
 
 #include "ast.h"
@@ -1587,7 +1584,6 @@ FOR_EACH_NODE_TYPE(DECLARE_VISIT)
   bool ignore_case_;
   HeapStringAllocator alloc_;
   StringStream stream_;
-  std::set<RegExpNode*> seen_;
 };
 
 
@@ -1614,9 +1610,8 @@ void DotPrinter::PrintNode(const char* label, RegExpNode* node) {
 
 
 void DotPrinter::Visit(RegExpNode* node) {
-  if (seen_.find(node) != seen_.end())
-    return;
-  seen_.insert(node);
+  if (node->info()->visited) return;
+  node->info()->visited = true;
   node->Accept(this);
 }
 
index 38357d6..3ab6651 100644 (file)
@@ -467,7 +467,8 @@ struct NodeInfo {
         at_end(false),
         follows_word(UNKNOWN),
         follows_newline(UNKNOWN),
-        follows_start(UNKNOWN) { }
+        follows_start(UNKNOWN),
+        visited(false) { }
 
   // Returns true if the interests and assumptions of this node
   // matches the given one.
@@ -566,6 +567,8 @@ struct NodeInfo {
   TriBool follows_word: 2;
   TriBool follows_newline: 2;
   TriBool follows_start: 2;
+
+  bool visited: 1;
 };
 
 
index 803dfe8..d145480 100644 (file)
@@ -356,12 +356,14 @@ void Logger::LogString(Handle<String> str) {
     len = 256;
   for (int i = 0; i < len; i++) {
     uc32 c = str->Get(shape, i);
-    if (c < 32 || (c > 126 && c <= 255)) {
-      fprintf(logfile_, "\\x%02x", c);
-    } else if (c > 255) {
+    if (c > 0xff) {
       fprintf(logfile_, "\\u%04x", c);
+    } else if (c < 32 || c > 126) {
+      fprintf(logfile_, "\\x%02x", c);
     } else if (c == ',') {
       fprintf(logfile_, "\\,");
+    } else if (c == '\\') {
+      fprintf(logfile_, "\\\\");
     } else {
       fprintf(logfile_, "%lc", c);
     }