Commit 7ab5dcf4 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix stack push order when reserving space for regexp registers on Windows.

TBR=erik.corry@gmail.com
BUG=
TEST=test-regexp/MacroAssemblerNativeLotsOfRegisters

Review URL: https://chromiumcodereview.appspot.com/10407095

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11625 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 99d69e0f
......@@ -790,6 +790,18 @@ Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) {
// position registers.
__ mov(Operand(ebp, kInputStartMinusOne), eax);
#ifdef WIN32
// Ensure that we write to each stack page, in order. Skipping a page
// on Windows can cause segmentation faults. Assuming page size is 4k.
const int kPageSize = 4096;
const int kRegistersPerPage = kPageSize / kPointerSize;
for (int i = num_saved_registers_ + kRegistersPerPage - 1;
i < num_registers_;
i += kRegistersPerPage) {
__ mov(register_location(i), eax); // One write every page.
}
#endif // WIN32
Label load_char_start_regexp, start_regexp;
// Load newline if index is at start, previous character otherwise.
__ cmp(Operand(ebp, kStartIndex), Immediate(0));
......
......@@ -855,6 +855,18 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
// position registers.
__ movq(Operand(rbp, kInputStartMinusOne), rax);
#ifdef WIN32
// Ensure that we have written to each stack page, in order. Skipping a page
// on Windows can cause segmentation faults. Assuming page size is 4k.
const int kPageSize = 4096;
const int kRegistersPerPage = kPageSize / kPointerSize;
for (int i = num_saved_registers_ + kRegistersPerPage - 1;
i < num_registers_;
i += kRegistersPerPage) {
__ movq(register_location(i), rax); // One write every page.
}
#endif // WIN32
// Initialize code object pointer.
__ Move(code_object_pointer(), masm_.CodeObject());
......
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