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

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

Issue 8139027: Version 3.6.5 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 2 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/x64/macro-assembler-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 void RegExpMacroAssemblerX64::CheckCharacterGT(uc16 limit, Label* on_greater) { 187 void RegExpMacroAssemblerX64::CheckCharacterGT(uc16 limit, Label* on_greater) {
188 __ cmpl(current_character(), Immediate(limit)); 188 __ cmpl(current_character(), Immediate(limit));
189 BranchOrBacktrack(greater, on_greater); 189 BranchOrBacktrack(greater, on_greater);
190 } 190 }
191 191
192 192
193 void RegExpMacroAssemblerX64::CheckAtStart(Label* on_at_start) { 193 void RegExpMacroAssemblerX64::CheckAtStart(Label* on_at_start) {
194 Label not_at_start; 194 Label not_at_start;
195 // Did we start the match at the start of the string at all? 195 // Did we start the match at the start of the string at all?
196 __ cmpb(Operand(rbp, kStartIndex), Immediate(0)); 196 __ cmpl(Operand(rbp, kStartIndex), Immediate(0));
197 BranchOrBacktrack(not_equal, &not_at_start); 197 BranchOrBacktrack(not_equal, &not_at_start);
198 // If we did, are we still at the start of the input? 198 // If we did, are we still at the start of the input?
199 __ lea(rax, Operand(rsi, rdi, times_1, 0)); 199 __ lea(rax, Operand(rsi, rdi, times_1, 0));
200 __ cmpq(rax, Operand(rbp, kInputStart)); 200 __ cmpq(rax, Operand(rbp, kInputStart));
201 BranchOrBacktrack(equal, on_at_start); 201 BranchOrBacktrack(equal, on_at_start);
202 __ bind(&not_at_start); 202 __ bind(&not_at_start);
203 } 203 }
204 204
205 205
206 void RegExpMacroAssemblerX64::CheckNotAtStart(Label* on_not_at_start) { 206 void RegExpMacroAssemblerX64::CheckNotAtStart(Label* on_not_at_start) {
207 // Did we start the match at the start of the string at all? 207 // Did we start the match at the start of the string at all?
208 __ cmpb(Operand(rbp, kStartIndex), Immediate(0)); 208 __ cmpl(Operand(rbp, kStartIndex), Immediate(0));
209 BranchOrBacktrack(not_equal, on_not_at_start); 209 BranchOrBacktrack(not_equal, on_not_at_start);
210 // If we did, are we still at the start of the input? 210 // If we did, are we still at the start of the input?
211 __ lea(rax, Operand(rsi, rdi, times_1, 0)); 211 __ lea(rax, Operand(rsi, rdi, times_1, 0));
212 __ cmpq(rax, Operand(rbp, kInputStart)); 212 __ cmpq(rax, Operand(rbp, kInputStart));
213 BranchOrBacktrack(not_equal, on_not_at_start); 213 BranchOrBacktrack(not_equal, on_not_at_start);
214 } 214 }
215 215
216 216
217 void RegExpMacroAssemblerX64::CheckCharacterLT(uc16 limit, Label* on_less) { 217 void RegExpMacroAssemblerX64::CheckCharacterLT(uc16 limit, Label* on_less) {
218 __ cmpl(current_character(), Immediate(limit)); 218 __ cmpl(current_character(), Immediate(limit));
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 __ lea(rax, Operand(rsi, rdi, times_1, 0)); 424 __ lea(rax, Operand(rsi, rdi, times_1, 0));
425 // Compute and set byte_offset1 (start of capture). 425 // Compute and set byte_offset1 (start of capture).
426 __ lea(rdi, Operand(rsi, rdx, times_1, 0)); 426 __ lea(rdi, Operand(rsi, rdx, times_1, 0));
427 // Set byte_offset2. 427 // Set byte_offset2.
428 __ movq(rsi, rax); 428 __ movq(rsi, rax);
429 // Set byte_length. 429 // Set byte_length.
430 __ movq(rdx, rbx); 430 __ movq(rdx, rbx);
431 // Isolate. 431 // Isolate.
432 __ LoadAddress(rcx, ExternalReference::isolate_address()); 432 __ LoadAddress(rcx, ExternalReference::isolate_address());
433 #endif 433 #endif
434 ExternalReference compare = 434
435 ExternalReference::re_case_insensitive_compare_uc16(masm_.isolate()); 435 { // NOLINT: Can't find a way to open this scope without confusing the
436 __ CallCFunction(compare, num_arguments); 436 // linter.
437 AllowExternalCallThatCantCauseGC scope(&masm_);
438 ExternalReference compare =
439 ExternalReference::re_case_insensitive_compare_uc16(masm_.isolate());
440 __ CallCFunction(compare, num_arguments);
441 }
437 442
438 // Restore original values before reacting on result value. 443 // Restore original values before reacting on result value.
439 __ Move(code_object_pointer(), masm_.CodeObject()); 444 __ Move(code_object_pointer(), masm_.CodeObject());
440 __ pop(backtrack_stackpointer()); 445 __ pop(backtrack_stackpointer());
441 #ifndef _WIN64 446 #ifndef _WIN64
442 __ pop(rdi); 447 __ pop(rdi);
443 __ pop(rsi); 448 __ pop(rsi);
444 #endif 449 #endif
445 450
446 // Check if function returned non-zero for success or zero for failure. 451 // Check if function returned non-zero for success or zero for failure.
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 __ Set(rax, 0); 704 __ Set(rax, 0);
700 __ jmp(&exit_label_); 705 __ jmp(&exit_label_);
701 } 706 }
702 707
703 708
704 Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { 709 Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
705 // Finalize code - write the entry point code now we know how many 710 // Finalize code - write the entry point code now we know how many
706 // registers we need. 711 // registers we need.
707 // Entry code: 712 // Entry code:
708 __ bind(&entry_label_); 713 __ bind(&entry_label_);
709 // Start new stack frame. 714
715 // Tell the system that we have a stack frame. Because the type is MANUAL, no
716 // is generated.
717 FrameScope scope(&masm_, StackFrame::MANUAL);
718
719 // Actually emit code to start a new stack frame.
710 __ push(rbp); 720 __ push(rbp);
711 __ movq(rbp, rsp); 721 __ movq(rbp, rsp);
712 // Save parameters and callee-save registers. Order here should correspond 722 // Save parameters and callee-save registers. Order here should correspond
713 // to order of kBackup_ebx etc. 723 // to order of kBackup_ebx etc.
714 #ifdef _WIN64 724 #ifdef _WIN64
715 // MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots. 725 // MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots.
716 // Store register parameters in pre-allocated stack slots, 726 // Store register parameters in pre-allocated stack slots,
717 __ movq(Operand(rbp, kInputString), rcx); 727 __ movq(Operand(rbp, kInputString), rcx);
718 __ movq(Operand(rbp, kStartIndex), rdx); // Passed as int32 in edx. 728 __ movq(Operand(rbp, kStartIndex), rdx); // Passed as int32 in edx.
719 __ movq(Operand(rbp, kInputStart), r8); 729 __ movq(Operand(rbp, kInputStart), r8);
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 } 1411 }
1402 } 1412 }
1403 1413
1404 #undef __ 1414 #undef __
1405 1415
1406 #endif // V8_INTERPRETED_REGEXP 1416 #endif // V8_INTERPRETED_REGEXP
1407 1417
1408 }} // namespace v8::internal 1418 }} // namespace v8::internal
1409 1419
1410 #endif // V8_TARGET_ARCH_X64 1420 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698