Author: [EMAIL PROTECTED] Date: Mon Dec 8 05:33:24 2008 New Revision: 938
Modified: branches/bleeding_edge/src/jsregexp.cc branches/bleeding_edge/src/regexp-macro-assembler-ia32.cc Log: Minor presentation changes Modified: branches/bleeding_edge/src/jsregexp.cc ============================================================================== --- branches/bleeding_edge/src/jsregexp.cc (original) +++ branches/bleeding_edge/src/jsregexp.cc Mon Dec 8 05:33:24 2008 @@ -312,8 +312,7 @@ return result; } // We couldn't handle the regexp using Irregexp, so fall back - // on JSCRE. We rejoice at the though of the day when this is - // no longer needed. + // on JSCRE. // Reset the JSRegExp to use JSCRE. JscrePrepare(regexp, Handle<String>(regexp->Pattern()), @@ -343,8 +342,7 @@ return result; } // We couldn't handle the regexp using Irregexp, so fall back - // on JSCRE. We rejoice at the though of the day when this is - // no longer needed. + // on JSCRE. // Reset the JSRegExp to use JSCRE. JscrePrepare(regexp, Handle<String>(regexp->Pattern()), @@ -911,7 +909,7 @@ // String is now either Sequential or External StringShape flatshape(*subject); bool is_ascii = flatshape.IsAsciiRepresentation(); - int char_size = is_ascii ? sizeof(char) : sizeof(uc16); // NOLINT + int char_size_shift = is_ascii ? 0 : 1; if (flatshape.IsExternal()) { const byte* address; @@ -925,19 +923,20 @@ rc = RegExpMacroAssemblerIA32::Execute( *code, &address, - start_offset * char_size, - end_offset * char_size, + start_offset << char_size_shift, + end_offset << char_size_shift, offsets_vector, previous_index == 0); } else { // Sequential string - int byte_offset = - is_ascii ? SeqAsciiString::kHeaderSize - kHeapObjectTag: - SeqTwoByteString::kHeaderSize - kHeapObjectTag; + Address char_address = + is_ascii ? SeqAsciiString::cast(*subject)->GetCharsAddress() + : SeqTwoByteString::cast(*subject)->GetCharsAddress(); + int byte_offset = char_address - reinterpret_cast<Address>(*subject); rc = RegExpMacroAssemblerIA32::Execute( *code, subject.location(), - byte_offset + start_offset * char_size, - byte_offset + end_offset * char_size, + byte_offset + (start_offset << char_size_shift), + byte_offset + (end_offset << char_size_shift), offsets_vector, previous_index == 0); } Modified: branches/bleeding_edge/src/regexp-macro-assembler-ia32.cc ============================================================================== --- branches/bleeding_edge/src/regexp-macro-assembler-ia32.cc (original) +++ branches/bleeding_edge/src/regexp-macro-assembler-ia32.cc Mon Dec 8 05:33:24 2008 @@ -684,8 +684,9 @@ int byte_offset1, int byte_offset2, size_t byte_length) { - // This function MUST NOT cause a garbage collection. A GC might move - // the calling generated code and invalidate the stacked return address. + // This function is not allowed to cause a garbage collection. + // A GC might move the calling generated code and invalidate the + // return address on the stack. ASSERT(byte_length % 2 == 0); Address buffer_address = reinterpret_cast<Address>(*buffer); uc16* substring1 = reinterpret_cast<uc16*>(buffer_address + byte_offset1); --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---