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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // Compute new value of character position after the matched part. | 317 // Compute new value of character position after the matched part. |
318 __ sub(edi, Operand(esi)); | 318 __ sub(edi, Operand(esi)); |
319 } else { | 319 } else { |
320 ASSERT(mode_ == UC16); | 320 ASSERT(mode_ == UC16); |
321 // Save registers before calling C function. | 321 // Save registers before calling C function. |
322 __ push(esi); | 322 __ push(esi); |
323 __ push(edi); | 323 __ push(edi); |
324 __ push(backtrack_stackpointer()); | 324 __ push(backtrack_stackpointer()); |
325 __ push(ebx); | 325 __ push(ebx); |
326 | 326 |
327 const int argument_count = 3; | 327 static const int argument_count = 3; |
328 __ PrepareCallCFunction(argument_count, ecx); | 328 __ PrepareCallCFunction(argument_count, ecx); |
329 // Put arguments into allocated stack area, last argument highest on stack. | 329 // Put arguments into allocated stack area, last argument highest on stack. |
330 // Parameters are | 330 // Parameters are |
331 // Address byte_offset1 - Address captured substring's start. | 331 // Address byte_offset1 - Address captured substring's start. |
332 // Address byte_offset2 - Address of current character position. | 332 // Address byte_offset2 - Address of current character position. |
333 // size_t byte_length - length of capture in bytes(!) | 333 // size_t byte_length - length of capture in bytes(!) |
334 | 334 |
335 // Set byte_length. | 335 // Set byte_length. |
336 __ mov(Operand(esp, 2 * kPointerSize), ebx); | 336 __ mov(Operand(esp, 2 * kPointerSize), ebx); |
337 // Set byte_offset2. | 337 // Set byte_offset2. |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 if (stack_overflow_label_.is_linked()) { | 777 if (stack_overflow_label_.is_linked()) { |
778 SafeCallTarget(&stack_overflow_label_); | 778 SafeCallTarget(&stack_overflow_label_); |
779 // Reached if the backtrack-stack limit has been hit. | 779 // Reached if the backtrack-stack limit has been hit. |
780 | 780 |
781 Label grow_failed; | 781 Label grow_failed; |
782 // Save registers before calling C function | 782 // Save registers before calling C function |
783 __ push(esi); | 783 __ push(esi); |
784 __ push(edi); | 784 __ push(edi); |
785 | 785 |
786 // Call GrowStack(backtrack_stackpointer()) | 786 // Call GrowStack(backtrack_stackpointer()) |
787 int num_arguments = 2; | 787 static const int num_arguments = 2; |
788 __ PrepareCallCFunction(num_arguments, ebx); | 788 __ PrepareCallCFunction(num_arguments, ebx); |
789 __ lea(eax, Operand(ebp, kStackHighEnd)); | 789 __ lea(eax, Operand(ebp, kStackHighEnd)); |
790 __ mov(Operand(esp, 1 * kPointerSize), eax); | 790 __ mov(Operand(esp, 1 * kPointerSize), eax); |
791 __ mov(Operand(esp, 0 * kPointerSize), backtrack_stackpointer()); | 791 __ mov(Operand(esp, 0 * kPointerSize), backtrack_stackpointer()); |
792 ExternalReference grow_stack = ExternalReference::re_grow_stack(); | 792 ExternalReference grow_stack = ExternalReference::re_grow_stack(); |
793 __ CallCFunction(grow_stack, num_arguments); | 793 __ CallCFunction(grow_stack, num_arguments); |
794 // If return NULL, we have failed to grow the stack, and | 794 // If return NULL, we have failed to grow the stack, and |
795 // must exit with a stack-overflow exception. | 795 // must exit with a stack-overflow exception. |
796 __ or_(eax, Operand(eax)); | 796 __ or_(eax, Operand(eax)); |
797 __ j(equal, &exit_with_exception); | 797 __ j(equal, &exit_with_exception); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 void RegExpMacroAssemblerIA32::WriteStackPointerToRegister(int reg) { | 944 void RegExpMacroAssemblerIA32::WriteStackPointerToRegister(int reg) { |
945 __ mov(eax, backtrack_stackpointer()); | 945 __ mov(eax, backtrack_stackpointer()); |
946 __ sub(eax, Operand(ebp, kStackHighEnd)); | 946 __ sub(eax, Operand(ebp, kStackHighEnd)); |
947 __ mov(register_location(reg), eax); | 947 __ mov(register_location(reg), eax); |
948 } | 948 } |
949 | 949 |
950 | 950 |
951 // Private methods: | 951 // Private methods: |
952 | 952 |
953 void RegExpMacroAssemblerIA32::CallCheckStackGuardState(Register scratch) { | 953 void RegExpMacroAssemblerIA32::CallCheckStackGuardState(Register scratch) { |
954 int num_arguments = 3; | 954 static const int num_arguments = 3; |
955 __ PrepareCallCFunction(num_arguments, scratch); | 955 __ PrepareCallCFunction(num_arguments, scratch); |
956 // RegExp code frame pointer. | 956 // RegExp code frame pointer. |
957 __ mov(Operand(esp, 2 * kPointerSize), ebp); | 957 __ mov(Operand(esp, 2 * kPointerSize), ebp); |
958 // Code* of self. | 958 // Code* of self. |
959 __ mov(Operand(esp, 1 * kPointerSize), Immediate(masm_->CodeObject())); | 959 __ mov(Operand(esp, 1 * kPointerSize), Immediate(masm_->CodeObject())); |
960 // Next address on the stack (will be address of return address). | 960 // Next address on the stack (will be address of return address). |
961 __ lea(eax, Operand(esp, -kPointerSize)); | 961 __ lea(eax, Operand(esp, -kPointerSize)); |
962 __ mov(Operand(esp, 0 * kPointerSize), eax); | 962 __ mov(Operand(esp, 0 * kPointerSize), eax); |
963 ExternalReference check_stack_guard = | 963 ExternalReference check_stack_guard = |
964 ExternalReference::re_check_stack_guard_state(); | 964 ExternalReference::re_check_stack_guard_state(); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 } | 1176 } |
1177 } | 1177 } |
1178 } | 1178 } |
1179 | 1179 |
1180 | 1180 |
1181 #undef __ | 1181 #undef __ |
1182 | 1182 |
1183 #endif // V8_NATIVE_REGEXP | 1183 #endif // V8_NATIVE_REGEXP |
1184 | 1184 |
1185 }} // namespace v8::internal | 1185 }} // namespace v8::internal |
OLD | NEW |