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 // The compare function can't cause a GC. Tell the system that it is OK |
| 438 // to call into C++ without having a stack frame in place. |
| 439 FrameScope scope(&masm_, StackFrame::NONE); |
| 440 ExternalReference compare = |
| 441 ExternalReference::re_case_insensitive_compare_uc16(masm_.isolate()); |
| 442 __ CallCFunction(compare, num_arguments); |
| 443 } |
437 | 444 |
438 // Restore original values before reacting on result value. | 445 // Restore original values before reacting on result value. |
439 __ Move(code_object_pointer(), masm_.CodeObject()); | 446 __ Move(code_object_pointer(), masm_.CodeObject()); |
440 __ pop(backtrack_stackpointer()); | 447 __ pop(backtrack_stackpointer()); |
441 #ifndef _WIN64 | 448 #ifndef _WIN64 |
442 __ pop(rdi); | 449 __ pop(rdi); |
443 __ pop(rsi); | 450 __ pop(rsi); |
444 #endif | 451 #endif |
445 | 452 |
446 // Check if function returned non-zero for success or zero for failure. | 453 // 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); | 708 __ Set(rax, 0); |
702 __ jmp(&exit_label_); | 709 __ jmp(&exit_label_); |
703 } | 710 } |
704 | 711 |
705 | 712 |
706 Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { | 713 Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) { |
707 // Finalize code - write the entry point code now we know how many | 714 // Finalize code - write the entry point code now we know how many |
708 // registers we need. | 715 // registers we need. |
709 // Entry code: | 716 // Entry code: |
710 __ bind(&entry_label_); | 717 __ bind(&entry_label_); |
711 // Start new stack frame. | 718 |
| 719 // Tell the system that we have a stack frame. Because the type is NONE, no |
| 720 // is generated. |
| 721 FrameScope scope(&masm_, StackFrame::NONE); |
| 722 |
| 723 // Actually emit code to start a new stack frame. |
712 __ push(rbp); | 724 __ push(rbp); |
713 __ movq(rbp, rsp); | 725 __ movq(rbp, rsp); |
714 // Save parameters and callee-save registers. Order here should correspond | 726 // Save parameters and callee-save registers. Order here should correspond |
715 // to order of kBackup_ebx etc. | 727 // to order of kBackup_ebx etc. |
716 #ifdef _WIN64 | 728 #ifdef _WIN64 |
717 // MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots. | 729 // MSVC passes arguments in rcx, rdx, r8, r9, with backing stack slots. |
718 // Store register parameters in pre-allocated stack slots, | 730 // Store register parameters in pre-allocated stack slots, |
719 __ movq(Operand(rbp, kInputString), rcx); | 731 __ movq(Operand(rbp, kInputString), rcx); |
720 __ movq(Operand(rbp, kStartIndex), rdx); // Passed as int32 in edx. | 732 __ movq(Operand(rbp, kStartIndex), rdx); // Passed as int32 in edx. |
721 __ movq(Operand(rbp, kInputStart), r8); | 733 __ movq(Operand(rbp, kInputStart), r8); |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 } | 1401 } |
1390 } | 1402 } |
1391 | 1403 |
1392 #undef __ | 1404 #undef __ |
1393 | 1405 |
1394 #endif // V8_INTERPRETED_REGEXP | 1406 #endif // V8_INTERPRETED_REGEXP |
1395 | 1407 |
1396 }} // namespace v8::internal | 1408 }} // namespace v8::internal |
1397 | 1409 |
1398 #endif // V8_TARGET_ARCH_X64 | 1410 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |