Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: src/x64/regexp-macro-assembler-x64.cc

Issue 10407095: Fix stack push order when reserving space for regexp registers on Windows. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 __ neg(rbx); 848 __ neg(rbx);
849 if (mode_ == UC16) { 849 if (mode_ == UC16) {
850 __ lea(rax, Operand(rdi, rbx, times_2, -char_size())); 850 __ lea(rax, Operand(rdi, rbx, times_2, -char_size()));
851 } else { 851 } else {
852 __ lea(rax, Operand(rdi, rbx, times_1, -char_size())); 852 __ lea(rax, Operand(rdi, rbx, times_1, -char_size()));
853 } 853 }
854 // Store this value in a local variable, for use when clearing 854 // Store this value in a local variable, for use when clearing
855 // position registers. 855 // position registers.
856 __ movq(Operand(rbp, kInputStartMinusOne), rax); 856 __ movq(Operand(rbp, kInputStartMinusOne), rax);
857 857
858 #ifdef WIN32
859 // Ensure that we have written to each stack page, in order. Skipping a page
860 // on Windows can cause segmentation faults. Assuming page size is 4k.
861 const int kPageSize = 4096;
862 const int kRegistersPerPage = kPageSize / kPointerSize;
863 for (int i = num_saved_registers_ + kRegistersPerPage - 1;
864 i < num_registers_;
865 i += kRegistersPerPage) {
866 __ movq(register_location(i), rax); // One write every page.
867 }
868 #endif // WIN32
869
858 // Initialize code object pointer. 870 // Initialize code object pointer.
859 __ Move(code_object_pointer(), masm_.CodeObject()); 871 __ Move(code_object_pointer(), masm_.CodeObject());
860 872
861 Label load_char_start_regexp, start_regexp; 873 Label load_char_start_regexp, start_regexp;
862 // Load newline if index is at start, previous character otherwise. 874 // Load newline if index is at start, previous character otherwise.
863 __ cmpb(Operand(rbp, kStartIndex), Immediate(0)); 875 __ cmpb(Operand(rbp, kStartIndex), Immediate(0));
864 __ j(not_equal, &load_char_start_regexp, Label::kNear); 876 __ j(not_equal, &load_char_start_regexp, Label::kNear);
865 __ Set(current_character(), '\n'); 877 __ Set(current_character(), '\n');
866 __ jmp(&start_regexp, Label::kNear); 878 __ jmp(&start_regexp, Label::kNear);
867 879
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 } 1531 }
1520 } 1532 }
1521 1533
1522 #undef __ 1534 #undef __
1523 1535
1524 #endif // V8_INTERPRETED_REGEXP 1536 #endif // V8_INTERPRETED_REGEXP
1525 1537
1526 }} // namespace v8::internal 1538 }} // namespace v8::internal
1527 1539
1528 #endif // V8_TARGET_ARCH_X64 1540 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/regexp-macro-assembler-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698