OLD | NEW |
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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 __ neg(ebx); | 783 __ neg(ebx); |
784 if (mode_ == UC16) { | 784 if (mode_ == UC16) { |
785 __ lea(eax, Operand(edi, ebx, times_2, -char_size())); | 785 __ lea(eax, Operand(edi, ebx, times_2, -char_size())); |
786 } else { | 786 } else { |
787 __ lea(eax, Operand(edi, ebx, times_1, -char_size())); | 787 __ lea(eax, Operand(edi, ebx, times_1, -char_size())); |
788 } | 788 } |
789 // Store this value in a local variable, for use when clearing | 789 // Store this value in a local variable, for use when clearing |
790 // position registers. | 790 // position registers. |
791 __ mov(Operand(ebp, kInputStartMinusOne), eax); | 791 __ mov(Operand(ebp, kInputStartMinusOne), eax); |
792 | 792 |
| 793 #ifdef WIN32 |
| 794 // Ensure that we write to each stack page, in order. Skipping a page |
| 795 // on Windows can cause segmentation faults. Assuming page size is 4k. |
| 796 const int kPageSize = 4096; |
| 797 const int kRegistersPerPage = kPageSize / kPointerSize; |
| 798 for (int i = num_saved_registers_ + kRegistersPerPage - 1; |
| 799 i < num_registers_; |
| 800 i += kRegistersPerPage) { |
| 801 __ mov(register_location(i), eax); // One write every page. |
| 802 } |
| 803 #endif // WIN32 |
| 804 |
793 Label load_char_start_regexp, start_regexp; | 805 Label load_char_start_regexp, start_regexp; |
794 // Load newline if index is at start, previous character otherwise. | 806 // Load newline if index is at start, previous character otherwise. |
795 __ cmp(Operand(ebp, kStartIndex), Immediate(0)); | 807 __ cmp(Operand(ebp, kStartIndex), Immediate(0)); |
796 __ j(not_equal, &load_char_start_regexp, Label::kNear); | 808 __ j(not_equal, &load_char_start_regexp, Label::kNear); |
797 __ mov(current_character(), '\n'); | 809 __ mov(current_character(), '\n'); |
798 __ jmp(&start_regexp, Label::kNear); | 810 __ jmp(&start_regexp, Label::kNear); |
799 | 811 |
800 // Global regexp restarts matching here. | 812 // Global regexp restarts matching here. |
801 __ bind(&load_char_start_regexp); | 813 __ bind(&load_char_start_regexp); |
802 // Load previous char as initial value of current character register. | 814 // Load previous char as initial value of current character register. |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1386 } | 1398 } |
1387 | 1399 |
1388 | 1400 |
1389 #undef __ | 1401 #undef __ |
1390 | 1402 |
1391 #endif // V8_INTERPRETED_REGEXP | 1403 #endif // V8_INTERPRETED_REGEXP |
1392 | 1404 |
1393 }} // namespace v8::internal | 1405 }} // namespace v8::internal |
1394 | 1406 |
1395 #endif // V8_TARGET_ARCH_IA32 | 1407 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |