| OLD | NEW |
| 1 // Copyright 2008-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2008-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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 // Set byte_offset2. | 389 // Set byte_offset2. |
| 390 // Found by adding negative string-end offset of current position (edi) | 390 // Found by adding negative string-end offset of current position (edi) |
| 391 // to end of string. | 391 // to end of string. |
| 392 __ add(edi, Operand(esi)); | 392 __ add(edi, Operand(esi)); |
| 393 __ mov(Operand(esp, 1 * kPointerSize), edi); | 393 __ mov(Operand(esp, 1 * kPointerSize), edi); |
| 394 // Set byte_offset1. | 394 // Set byte_offset1. |
| 395 // Start of capture, where edx already holds string-end negative offset. | 395 // Start of capture, where edx already holds string-end negative offset. |
| 396 __ add(edx, Operand(esi)); | 396 __ add(edx, Operand(esi)); |
| 397 __ mov(Operand(esp, 0 * kPointerSize), edx); | 397 __ mov(Operand(esp, 0 * kPointerSize), edx); |
| 398 | 398 |
| 399 ExternalReference compare = | 399 { |
| 400 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate()); | 400 // The compare function can't cause a GC. Tell the system that it is OK |
| 401 __ CallCFunction(compare, argument_count); | 401 // to call into C++ without having a stack frame in place. |
| 402 FrameScope scope(masm_, StackFrame::NONE); |
| 403 ExternalReference compare = |
| 404 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate()); |
| 405 __ CallCFunction(compare, argument_count); |
| 406 } |
| 402 // Pop original values before reacting on result value. | 407 // Pop original values before reacting on result value. |
| 403 __ pop(ebx); | 408 __ pop(ebx); |
| 404 __ pop(backtrack_stackpointer()); | 409 __ pop(backtrack_stackpointer()); |
| 405 __ pop(edi); | 410 __ pop(edi); |
| 406 __ pop(esi); | 411 __ pop(esi); |
| 407 | 412 |
| 408 // Check if function returned non-zero for success or zero for failure. | 413 // Check if function returned non-zero for success or zero for failure. |
| 409 __ or_(eax, Operand(eax)); | 414 __ or_(eax, Operand(eax)); |
| 410 BranchOrBacktrack(zero, on_no_match); | 415 BranchOrBacktrack(zero, on_no_match); |
| 411 // On success, increment position by length of capture. | 416 // On success, increment position by length of capture. |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 __ jmp(&exit_label_); | 666 __ jmp(&exit_label_); |
| 662 } | 667 } |
| 663 | 668 |
| 664 | 669 |
| 665 Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) { | 670 Handle<HeapObject> RegExpMacroAssemblerIA32::GetCode(Handle<String> source) { |
| 666 // Finalize code - write the entry point code now we know how many | 671 // Finalize code - write the entry point code now we know how many |
| 667 // registers we need. | 672 // registers we need. |
| 668 | 673 |
| 669 // Entry code: | 674 // Entry code: |
| 670 __ bind(&entry_label_); | 675 __ bind(&entry_label_); |
| 671 // Start new stack frame. | 676 |
| 677 // Tell the system that we have a stack frame. Because the type is NONE, no |
| 678 // is generated. |
| 679 FrameScope scope(masm_, StackFrame::NONE); |
| 680 |
| 681 // Actually emit code to start a new stack frame. |
| 672 __ push(ebp); | 682 __ push(ebp); |
| 673 __ mov(ebp, esp); | 683 __ mov(ebp, esp); |
| 674 // Save callee-save registers. Order here should correspond to order of | 684 // Save callee-save registers. Order here should correspond to order of |
| 675 // kBackup_ebx etc. | 685 // kBackup_ebx etc. |
| 676 __ push(esi); | 686 __ push(esi); |
| 677 __ push(edi); | 687 __ push(edi); |
| 678 __ push(ebx); // Callee-save on MacOS. | 688 __ push(ebx); // Callee-save on MacOS. |
| 679 __ push(Immediate(0)); // Make room for "input start - 1" constant. | 689 __ push(Immediate(0)); // Make room for "input start - 1" constant. |
| 680 | 690 |
| 681 // Check if we have space on the stack for registers. | 691 // Check if we have space on the stack for registers. |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1254 } | 1264 } |
| 1255 | 1265 |
| 1256 | 1266 |
| 1257 #undef __ | 1267 #undef __ |
| 1258 | 1268 |
| 1259 #endif // V8_INTERPRETED_REGEXP | 1269 #endif // V8_INTERPRETED_REGEXP |
| 1260 | 1270 |
| 1261 }} // namespace v8::internal | 1271 }} // namespace v8::internal |
| 1262 | 1272 |
| 1263 #endif // V8_TARGET_ARCH_IA32 | 1273 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |