Author: [EMAIL PROTECTED]
Date: Tue Dec  2 00:16:12 2008
New Revision: 883

Modified:
    branches/bleeding_edge/src/jsregexp.cc
    branches/bleeding_edge/src/jsregexp.h
    branches/bleeding_edge/src/log.cc

Log:
- Fixed regexp logging issue.
- Removed use of std::set.


Modified: branches/bleeding_edge/src/jsregexp.cc
==============================================================================
--- branches/bleeding_edge/src/jsregexp.cc      (original)
+++ branches/bleeding_edge/src/jsregexp.cc      Tue Dec  2 00:16:12 2008
@@ -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 @@
    bool ignore_case_;
    HeapStringAllocator alloc_;
    StringStream stream_;
-  std::set<RegExpNode*> seen_;
  };


@@ -1614,9 +1610,8 @@


  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);
  }


Modified: branches/bleeding_edge/src/jsregexp.h
==============================================================================
--- branches/bleeding_edge/src/jsregexp.h       (original)
+++ branches/bleeding_edge/src/jsregexp.h       Tue Dec  2 00:16:12 2008
@@ -467,7 +467,8 @@
          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 @@
    TriBool follows_word: 2;
    TriBool follows_newline: 2;
    TriBool follows_start: 2;
+
+  bool visited: 1;
  };



Modified: branches/bleeding_edge/src/log.cc
==============================================================================
--- branches/bleeding_edge/src/log.cc   (original)
+++ branches/bleeding_edge/src/log.cc   Tue Dec  2 00:16:12 2008
@@ -356,12 +356,14 @@
      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);
      }

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to