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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 __ bind(&entry_label_); | 605 __ bind(&entry_label_); |
606 // Start new stack frame. | 606 // Start new stack frame. |
607 __ push(rbp); | 607 __ push(rbp); |
608 __ movq(rbp, rsp); | 608 __ movq(rbp, rsp); |
609 // Save parameters and callee-save registers. Order here should correspond | 609 // Save parameters and callee-save registers. Order here should correspond |
610 // to order of kBackup_ebx etc. | 610 // to order of kBackup_ebx etc. |
611 #ifdef _WIN64 | 611 #ifdef _WIN64 |
612 // MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots. | 612 // MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots. |
613 // Store register parameters in pre-allocated stack slots, | 613 // Store register parameters in pre-allocated stack slots, |
614 __ movq(Operand(rbp, kInputString), rcx); | 614 __ movq(Operand(rbp, kInputString), rcx); |
615 __ movq(Operand(rbp, kStartIndex), rdx); | 615 __ movzxlq(Operand(rbp, kStartIndex), rdx); // Passed as int in eax. |
616 __ movq(Operand(rbp, kInputStart), r8); | 616 __ movq(Operand(rbp, kInputStart), r8); |
617 __ movq(Operand(rbp, kInputEnd), r9); | 617 __ movq(Operand(rbp, kInputEnd), r9); |
618 // Callee-save on Win64. | 618 // Callee-save on Win64. |
619 __ push(rsi); | 619 __ push(rsi); |
620 __ push(rdi); | 620 __ push(rdi); |
621 __ push(rbx); | 621 __ push(rbx); |
622 #else | 622 #else |
623 // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9 (and then on stack). | 623 // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9 (and then on stack). |
624 // Push register parameters on stack for reference. | 624 // Push register parameters on stack for reference. |
625 ASSERT_EQ(kInputString, -1 * kPointerSize); | 625 ASSERT_EQ(kInputString, -1 * kPointerSize); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 i += kRegistersPerPage) { | 704 i += kRegistersPerPage) { |
705 __ movq(register_location(i), rax); // One write every page. | 705 __ movq(register_location(i), rax); // One write every page. |
706 } | 706 } |
707 | 707 |
708 // Initialize backtrack stack pointer. | 708 // Initialize backtrack stack pointer. |
709 __ movq(backtrack_stackpointer(), Operand(rbp, kStackHighEnd)); | 709 __ movq(backtrack_stackpointer(), Operand(rbp, kStackHighEnd)); |
710 // Initialize code object pointer. | 710 // Initialize code object pointer. |
711 __ Move(code_object_pointer(), masm_->CodeObject()); | 711 __ Move(code_object_pointer(), masm_->CodeObject()); |
712 // Load previous char as initial value of current-character. | 712 // Load previous char as initial value of current-character. |
713 Label at_start; | 713 Label at_start; |
714 __ cmpq(Operand(rbp, kAtStart), Immediate(0)); | 714 __ cmpb(Operand(rbp, kAtStart), Immediate(0)); |
715 __ j(not_equal, &at_start); | 715 __ j(not_equal, &at_start); |
716 LoadCurrentCharacterUnchecked(-1, 1); // Load previous char. | 716 LoadCurrentCharacterUnchecked(-1, 1); // Load previous char. |
717 __ jmp(&start_label_); | 717 __ jmp(&start_label_); |
718 __ bind(&at_start); | 718 __ bind(&at_start); |
719 __ movq(current_character(), Immediate('\n')); | 719 __ movq(current_character(), Immediate('\n')); |
720 __ jmp(&start_label_); | 720 __ jmp(&start_label_); |
721 | 721 |
722 | 722 |
723 // Exit code: | 723 // Exit code: |
724 if (success_label_.is_linked()) { | 724 if (success_label_.is_linked()) { |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 | 1290 |
1291 void RegExpCEntryStub::Generate(MacroAssembler* masm_) { | 1291 void RegExpCEntryStub::Generate(MacroAssembler* masm_) { |
1292 __ int3(); // Unused on x64. | 1292 __ int3(); // Unused on x64. |
1293 } | 1293 } |
1294 | 1294 |
1295 #undef __ | 1295 #undef __ |
1296 | 1296 |
1297 #endif // V8_NATIVE_REGEXP | 1297 #endif // V8_NATIVE_REGEXP |
1298 | 1298 |
1299 }} // namespace v8::internal | 1299 }} // namespace v8::internal |
OLD | NEW |