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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 // Compute new value of character position after the matched part. | 365 // Compute new value of character position after the matched part. |
366 __ sub(edi, Operand(esi)); | 366 __ sub(edi, Operand(esi)); |
367 } else { | 367 } else { |
368 ASSERT(mode_ == UC16); | 368 ASSERT(mode_ == UC16); |
369 // Save registers before calling C function. | 369 // Save registers before calling C function. |
370 __ push(esi); | 370 __ push(esi); |
371 __ push(edi); | 371 __ push(edi); |
372 __ push(backtrack_stackpointer()); | 372 __ push(backtrack_stackpointer()); |
373 __ push(ebx); | 373 __ push(ebx); |
374 | 374 |
375 static const int argument_count = 3; | 375 static const int argument_count = 4; |
376 __ PrepareCallCFunction(argument_count, ecx); | 376 __ PrepareCallCFunction(argument_count, ecx); |
377 // Put arguments into allocated stack area, last argument highest on stack. | 377 // Put arguments into allocated stack area, last argument highest on stack. |
378 // Parameters are | 378 // Parameters are |
379 // Address byte_offset1 - Address captured substring's start. | 379 // Address byte_offset1 - Address captured substring's start. |
380 // Address byte_offset2 - Address of current character position. | 380 // Address byte_offset2 - Address of current character position. |
381 // size_t byte_length - length of capture in bytes(!) | 381 // size_t byte_length - length of capture in bytes(!) |
| 382 // Isolate* isolate |
382 | 383 |
| 384 // Set isolate. |
| 385 __ mov(Operand(esp, 3 * kPointerSize), |
| 386 Immediate(ExternalReference::isolate_address())); |
383 // Set byte_length. | 387 // Set byte_length. |
384 __ mov(Operand(esp, 2 * kPointerSize), ebx); | 388 __ mov(Operand(esp, 2 * kPointerSize), ebx); |
385 // Set byte_offset2. | 389 // Set byte_offset2. |
386 // Found by adding negative string-end offset of current position (edi) | 390 // Found by adding negative string-end offset of current position (edi) |
387 // to end of string. | 391 // to end of string. |
388 __ add(edi, Operand(esi)); | 392 __ add(edi, Operand(esi)); |
389 __ mov(Operand(esp, 1 * kPointerSize), edi); | 393 __ mov(Operand(esp, 1 * kPointerSize), edi); |
390 // Set byte_offset1. | 394 // Set byte_offset1. |
391 // Start of capture, where edx already holds string-end negative offset. | 395 // Start of capture, where edx already holds string-end negative offset. |
392 __ add(edx, Operand(esi)); | 396 __ add(edx, Operand(esi)); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 if (stack_overflow_label_.is_linked()) { | 835 if (stack_overflow_label_.is_linked()) { |
832 SafeCallTarget(&stack_overflow_label_); | 836 SafeCallTarget(&stack_overflow_label_); |
833 // Reached if the backtrack-stack limit has been hit. | 837 // Reached if the backtrack-stack limit has been hit. |
834 | 838 |
835 Label grow_failed; | 839 Label grow_failed; |
836 // Save registers before calling C function | 840 // Save registers before calling C function |
837 __ push(esi); | 841 __ push(esi); |
838 __ push(edi); | 842 __ push(edi); |
839 | 843 |
840 // Call GrowStack(backtrack_stackpointer()) | 844 // Call GrowStack(backtrack_stackpointer()) |
841 static const int num_arguments = 2; | 845 static const int num_arguments = 3; |
842 __ PrepareCallCFunction(num_arguments, ebx); | 846 __ PrepareCallCFunction(num_arguments, ebx); |
| 847 __ mov(Operand(esp, 2 * kPointerSize), |
| 848 Immediate(ExternalReference::isolate_address())); |
843 __ lea(eax, Operand(ebp, kStackHighEnd)); | 849 __ lea(eax, Operand(ebp, kStackHighEnd)); |
844 __ mov(Operand(esp, 1 * kPointerSize), eax); | 850 __ mov(Operand(esp, 1 * kPointerSize), eax); |
845 __ mov(Operand(esp, 0 * kPointerSize), backtrack_stackpointer()); | 851 __ mov(Operand(esp, 0 * kPointerSize), backtrack_stackpointer()); |
846 ExternalReference grow_stack = | 852 ExternalReference grow_stack = |
847 ExternalReference::re_grow_stack(masm_->isolate()); | 853 ExternalReference::re_grow_stack(masm_->isolate()); |
848 __ CallCFunction(grow_stack, num_arguments); | 854 __ CallCFunction(grow_stack, num_arguments); |
849 // If return NULL, we have failed to grow the stack, and | 855 // If return NULL, we have failed to grow the stack, and |
850 // must exit with a stack-overflow exception. | 856 // must exit with a stack-overflow exception. |
851 __ or_(eax, Operand(eax)); | 857 __ or_(eax, Operand(eax)); |
852 __ j(equal, &exit_with_exception); | 858 __ j(equal, &exit_with_exception); |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 } | 1255 } |
1250 | 1256 |
1251 | 1257 |
1252 #undef __ | 1258 #undef __ |
1253 | 1259 |
1254 #endif // V8_INTERPRETED_REGEXP | 1260 #endif // V8_INTERPRETED_REGEXP |
1255 | 1261 |
1256 }} // namespace v8::internal | 1262 }} // namespace v8::internal |
1257 | 1263 |
1258 #endif // V8_TARGET_ARCH_IA32 | 1264 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |