Revision: 2812
Author: [email protected]
Date: Wed Sep  2 01:36:26 2009
Log: Added possibility of miscompiled regexp to verfifier.

Review URL: http://codereview.chromium.org/188005

http://code.google.com/p/v8/source/detail?r=2812

Modified:
  /branches/bleeding_edge/src/objects-debug.cc
  /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/objects-debug.cc        Wed Aug 26 04:03:07 2009
+++ /branches/bleeding_edge/src/objects-debug.cc        Wed Sep  2 01:36:26 2009
@@ -769,11 +769,14 @@

        FixedArray* arr = FixedArray::cast(data());
        Object* ascii_data = arr->get(JSRegExp::kIrregexpASCIICodeIndex);
-      ASSERT(ascii_data->IsTheHole()
-          || (is_native ? ascii_data->IsCode() :  
ascii_data->IsByteArray()));
+      // TheHole : Not compiled yet.
+      // JSObject: Compilation error.
+      // Code/ByteArray: Compiled code.
+      ASSERT(ascii_data->IsTheHole() || ascii_data->IsJSObject() ||
+          (is_native ? ascii_data->IsCode() : ascii_data->IsByteArray()));
        Object* uc16_data = arr->get(JSRegExp::kIrregexpUC16CodeIndex);
-      ASSERT(uc16_data->IsTheHole()
-          || (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray()));
+      ASSERT(uc16_data->IsTheHole() || ascii_data->IsJSObject() ||
+          (is_native ? uc16_data->IsCode() : uc16_data->IsByteArray()));
        ASSERT(arr->get(JSRegExp::kIrregexpCaptureCountIndex)->IsSmi());
        ASSERT(arr->get(JSRegExp::kIrregexpMaxRegisterCountIndex)->IsSmi());
        break;
=======================================
--- /branches/bleeding_edge/src/objects.h       Tue Sep  1 08:23:35 2009
+++ /branches/bleeding_edge/src/objects.h       Wed Sep  2 01:36:26 2009
@@ -3528,9 +3528,13 @@

    static const int kAtomDataSize = kAtomPatternIndex + 1;

-  // Irregexp compiled code or bytecode for ASCII.
+  // Irregexp compiled code or bytecode for ASCII. If compilation
+  // fails, this fields hold an exception object that should be
+  // thrown if the regexp is used again.
    static const int kIrregexpASCIICodeIndex = kDataIndex;
-  // Irregexp compiled code or bytecode for UC16.
+  // Irregexp compiled code or bytecode for UC16.  If compilation
+  // fails, this fields hold an exception object that should be
+  // thrown if the regexp is used again.
    static const int kIrregexpUC16CodeIndex = kDataIndex + 1;
    // Maximal number of registers used by either ASCII or UC16.
    // Only used to check that there is enough stack space

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

Reply via email to