ARM RegExp fix bug 432.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
lrn@chromium.org 2009-09-02 09:10:49 +00:00
parent 85cc5f2097
commit 11ef516137
2 changed files with 14 additions and 14 deletions

View File

@ -216,25 +216,29 @@ void RegExpMacroAssemblerARM::CheckCharacters(Vector<const uc16> str,
int cp_offset,
Label* on_failure,
bool check_end_of_string) {
int byte_length = str.length() * char_size();
int byte_offset = cp_offset * char_size();
if (check_end_of_string) {
// Check that there are at least str.length() characters left in the input.
__ cmp(end_of_input_address(), Operand(-(byte_offset + byte_length)));
BranchOrBacktrack(gt, on_failure);
}
if (on_failure == NULL) {
// Instead of inlining a backtrack, (re)use the global backtrack target.
// Instead of inlining a backtrack for each test, (re)use the global
// backtrack target.
on_failure = &backtrack_label_;
}
if (check_end_of_string) {
// Is last character of required match inside string.
CheckPosition(cp_offset + str.length() - 1, on_failure);
}
__ add(r0, end_of_input_address(), Operand(current_input_offset()));
if (cp_offset != 0) {
int byte_offset = cp_offset * char_size();
__ add(r0, r0, Operand(byte_offset));
}
// r0 : Address of characters to match against str.
int stored_high_byte = 0;
for (int i = 0; i < str.length(); i++) {
if (mode_ == ASCII) {
__ ldrb(r1, MemOperand(r0, char_size(), PostIndex));
// str[i] is known to be an ASCII character.
ASSERT(str[i] <= String::kMaxAsciiCharCode);
__ cmp(r1, Operand(str[i]));
} else {
__ ldrh(r1, MemOperand(r0, char_size(), PostIndex));

View File

@ -50,10 +50,6 @@ test-api/RegExpInterruption: SKIP
test-api/OutOfMemory: SKIP
test-api/OutOfMemoryNested: SKIP
# BUG(432): Fail on ARM hardware.
test-regexp/MacroAssemblerNativeSimple: PASS || FAIL
test-regexp/MacroAssemblerNativeSimpleUC16: PASS || FAIL
# BUG(355): Test crashes on ARM.
test-log/ProfLazyMode: SKIP