Author: [EMAIL PROTECTED]
Date: Fri Nov 28 01:51:26 2008
New Revision: 864

Modified:
    branches/bleeding_edge/src/jsregexp.cc

Log:
Calling native irregexp now returns captures correctly.
Reduces failing tests in native mode to 2(!)


Modified: branches/bleeding_edge/src/jsregexp.cc
==============================================================================
--- branches/bleeding_edge/src/jsregexp.cc      (original)
+++ branches/bleeding_edge/src/jsregexp.cc      Fri Nov 28 01:51:26 2008
@@ -507,19 +507,19 @@
    switch (tag) {
      case RegExpMacroAssembler::kIA32Implementation: {
        Code* code = Code::cast(irregexp->get(kIrregexpCodeIndex));
-      SmartPointer<int> captures(NewArray<int>((num_captures + 1) * 2));
        Address start_addr =
             
Handle<SeqTwoByteString>::cast(two_byte_subject)->GetCharsAddress();
-      int start_offset =
+      int string_offset =
            start_addr - reinterpret_cast<Address>(*two_byte_subject);
+      int start_offset = string_offset + previous_index * sizeof(uc16);
        int end_offset =
-          start_offset + (two_byte_subject->length() - previous_index) * 2;
+          string_offset + two_byte_subject->length() * sizeof(uc16);
        typedef bool testfunc(String**, int, int, int*);
        testfunc* test = FUNCTION_CAST<testfunc*>(code->entry());
        rc = test(two_byte_subject.location(),
                  start_offset,
                  end_offset,
-                *captures);
+                offsets_vector);
        if (rc) {
          // Capture values are relative to start_offset only.
          for (int i = 0; i < offsets_vector_length; i++) {

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

Reply via email to