OLD | NEW |
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 __ Set(rax, 0); | 706 __ Set(rax, 0); |
702 __ jmp(&exit_label_); | 707 __ jmp(&exit_label_); |
703 } | 708 } |
704 | 709 |
705 | 710 |
706 Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { | 711 Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { |
707 // Finalize code - write the entry point code now we know how many | 712 // Finalize code - write the entry point code now we know how many |
708 // registers we need. | 713 // registers we need. |
709 // Entry code: | 714 // Entry code: |
710 __ bind(&entry_label_); | 715 __ bind(&entry_label_); |
711 // Start new stack frame. | 716 |
| 717 // Tell the system that we have a stack frame. Because the type is MANUAL, no |
| 718 // is generated. |
| 719 FrameScope scope(&masm_, StackFrame::MANUAL); |
| 720 |
| 721 // Actually emit code to start a new stack frame. |
712 __ push(rbp); | 722 __ push(rbp); |
713 __ movq(rbp, rsp); | 723 __ movq(rbp, rsp); |
714 // Save parameters and callee-save registers. Order here should correspond | 724 // Save parameters and callee-save registers. Order here should correspond |
715 // to order of kBackup_ebx etc. | 725 // to order of kBackup_ebx etc. |
716 #ifdef _WIN64 | 726 #ifdef _WIN64 |
717 // MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots. | 727 // MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots. |
718 // Store register parameters in pre-allocated stack slots, | 728 // Store register parameters in pre-allocated stack slots, |
719 __ movq(Operand(rbp, kInputString), rcx); | 729 __ movq(Operand(rbp, kInputString), rcx); |
720 __ movq(Operand(rbp, kStartIndex), rdx); // Passed as int32 in edx. | 730 __ movq(Operand(rbp, kStartIndex), rdx); // Passed as int32 in edx. |
721 __ movq(Operand(rbp, kInputStart), r8); | 731 __ movq(Operand(rbp, kInputStart), r8); |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 } | 1399 } |
1390 } | 1400 } |
1391 | 1401 |
1392 #undef __ | 1402 #undef __ |
1393 | 1403 |
1394 #endif // V8_INTERPRETED_REGEXP | 1404 #endif // V8_INTERPRETED_REGEXP |
1395 | 1405 |
1396 }} // namespace v8::internal | 1406 }} // namespace v8::internal |
1397 | 1407 |
1398 #endif // V8_TARGET_ARCH_X64 | 1408 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |