OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 __ push(r9); | 636 __ push(r9); |
637 | 637 |
638 __ push(rbx); // Callee-save | 638 __ push(rbx); // Callee-save |
639 #endif | 639 #endif |
640 __ push(Immediate(0)); // Make room for "input start - 1" constant. | 640 __ push(Immediate(0)); // Make room for "input start - 1" constant. |
641 | 641 |
642 // Check if we have space on the stack for registers. | 642 // Check if we have space on the stack for registers. |
643 Label stack_limit_hit; | 643 Label stack_limit_hit; |
644 Label stack_ok; | 644 Label stack_ok; |
645 | 645 |
646 ExternalReference stack_guard_limit = | 646 ExternalReference stack_limit = |
647 ExternalReference::address_of_stack_guard_limit(); | 647 ExternalReference::address_of_stack_limit(); |
648 __ movq(rcx, rsp); | 648 __ movq(rcx, rsp); |
649 __ movq(kScratchRegister, stack_guard_limit); | 649 __ movq(kScratchRegister, stack_limit); |
650 __ subq(rcx, Operand(kScratchRegister, 0)); | 650 __ subq(rcx, Operand(kScratchRegister, 0)); |
651 // Handle it if the stack pointer is already below the stack limit. | 651 // Handle it if the stack pointer is already below the stack limit. |
652 __ j(below_equal, &stack_limit_hit); | 652 __ j(below_equal, &stack_limit_hit); |
653 // Check if there is room for the variable number of registers above | 653 // Check if there is room for the variable number of registers above |
654 // the stack limit. | 654 // the stack limit. |
655 __ cmpq(rcx, Immediate(num_registers_ * kPointerSize)); | 655 __ cmpq(rcx, Immediate(num_registers_ * kPointerSize)); |
656 __ j(above_equal, &stack_ok); | 656 __ j(above_equal, &stack_ok); |
657 // Exit with OutOfMemory exception. There is not enough space on the stack | 657 // Exit with OutOfMemory exception. There is not enough space on the stack |
658 // for our working registers. | 658 // for our working registers. |
659 __ movq(rax, Immediate(EXCEPTION)); | 659 __ movq(rax, Immediate(EXCEPTION)); |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 | 1189 |
1190 | 1190 |
1191 void RegExpMacroAssemblerX64::Drop() { | 1191 void RegExpMacroAssemblerX64::Drop() { |
1192 __ addq(backtrack_stackpointer(), Immediate(kIntSize)); | 1192 __ addq(backtrack_stackpointer(), Immediate(kIntSize)); |
1193 } | 1193 } |
1194 | 1194 |
1195 | 1195 |
1196 void RegExpMacroAssemblerX64::CheckPreemption() { | 1196 void RegExpMacroAssemblerX64::CheckPreemption() { |
1197 // Check for preemption. | 1197 // Check for preemption. |
1198 Label no_preempt; | 1198 Label no_preempt; |
1199 ExternalReference stack_guard_limit = | 1199 ExternalReference stack_limit = |
1200 ExternalReference::address_of_stack_guard_limit(); | 1200 ExternalReference::address_of_stack_limit(); |
1201 __ load_rax(stack_guard_limit); | 1201 __ load_rax(stack_limit); |
1202 __ cmpq(rsp, rax); | 1202 __ cmpq(rsp, rax); |
1203 __ j(above, &no_preempt); | 1203 __ j(above, &no_preempt); |
1204 | 1204 |
1205 SafeCall(&check_preempt_label_); | 1205 SafeCall(&check_preempt_label_); |
1206 | 1206 |
1207 __ bind(&no_preempt); | 1207 __ bind(&no_preempt); |
1208 } | 1208 } |
1209 | 1209 |
1210 | 1210 |
1211 void RegExpMacroAssemblerX64::CheckStackLimit() { | 1211 void RegExpMacroAssemblerX64::CheckStackLimit() { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 Operand(rsi, rdi, times_1, cp_offset * sizeof(uc16))); | 1283 Operand(rsi, rdi, times_1, cp_offset * sizeof(uc16))); |
1284 } | 1284 } |
1285 } | 1285 } |
1286 } | 1286 } |
1287 | 1287 |
1288 #undef __ | 1288 #undef __ |
1289 | 1289 |
1290 #endif // V8_NATIVE_REGEXP | 1290 #endif // V8_NATIVE_REGEXP |
1291 | 1291 |
1292 }} // namespace v8::internal | 1292 }} // namespace v8::internal |
OLD | NEW |