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

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

Issue 195014: X64 RegExp - fix RegExp on WIN64. (Closed)
Patch Set: Created 11 years, 3 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
« src/runtime.cc ('K') | « src/x64/regexp-macro-assembler-x64.h ('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 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
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
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
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
OLDNEW
« src/runtime.cc ('K') | « src/x64/regexp-macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698