RegExpMacroAssembler::CheckStackGuardState should update input string pointer when it is moved or changed by GC.
If input string was cons-string it might undergo short-circuiting during GC. This does not change input start if underlying seq-string (first element of cons-string) does not move but this makes input-string pointer on the native regexp's frame invalid. R=lrn@chromium.org Review URL: http://codereview.chromium.org/8343001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9697 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
96dc1fde46
commit
e27d8fcbdc
@ -1111,6 +1111,11 @@ int RegExpMacroAssemblerARM::CheckStackGuardState(Address* return_address,
|
||||
frame_entry<const String*>(re_frame, kInputString) = *subject;
|
||||
frame_entry<const byte*>(re_frame, kInputStart) = new_address;
|
||||
frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length;
|
||||
} else if (frame_entry<const String*>(re_frame, kInputString) != *subject) {
|
||||
// Subject string might have been a ConsString that underwent
|
||||
// short-circuiting during GC. That will not change start_address but
|
||||
// will change pointer inside the subject handle.
|
||||
frame_entry<const String*>(re_frame, kInputString) = *subject;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1141,6 +1141,11 @@ int RegExpMacroAssemblerIA32::CheckStackGuardState(Address* return_address,
|
||||
frame_entry<const String*>(re_frame, kInputString) = *subject;
|
||||
frame_entry<const byte*>(re_frame, kInputStart) = new_address;
|
||||
frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length;
|
||||
} else if (frame_entry<const String*>(re_frame, kInputString) != *subject) {
|
||||
// Subject string might have been a ConsString that underwent
|
||||
// short-circuiting during GC. That will not change start_address but
|
||||
// will change pointer inside the subject handle.
|
||||
frame_entry<const String*>(re_frame, kInputString) = *subject;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1248,6 +1248,11 @@ int RegExpMacroAssemblerX64::CheckStackGuardState(Address* return_address,
|
||||
frame_entry<const String*>(re_frame, kInputString) = *subject;
|
||||
frame_entry<const byte*>(re_frame, kInputStart) = new_address;
|
||||
frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length;
|
||||
} else if (frame_entry<const String*>(re_frame, kInputString) != *subject) {
|
||||
// Subject string might have been a ConsString that underwent
|
||||
// short-circuiting during GC. That will not change start_address but
|
||||
// will change pointer inside the subject handle.
|
||||
frame_entry<const String*>(re_frame, kInputString) = *subject;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user