Commit 67c26a86 authored by lrn@chromium.org's avatar lrn@chromium.org

Minor presentation changes


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@938 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5178af89
......@@ -312,8 +312,7 @@ Handle<Object> RegExpImpl::Exec(Handle<JSRegExp> regexp,
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 @@ Handle<Object> RegExpImpl::ExecGlobal(Handle<JSRegExp> regexp,
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 @@ Handle<Object> RegExpImpl::IrregexpExecOnce(Handle<FixedArray> irregexp,
// 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 @@ Handle<Object> RegExpImpl::IrregexpExecOnce(Handle<FixedArray> irregexp,
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);
}
......
......@@ -684,8 +684,9 @@ int RegExpMacroAssemblerIA32::CaseInsensitiveCompareUC16(uc16** buffer,
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment