OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 7164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7175 Label next_capture, done; | 7175 Label next_capture, done; |
7176 __ movq(rax, Operand(rsp, kPreviousIndexOffset)); | 7176 __ movq(rax, Operand(rsp, kPreviousIndexOffset)); |
7177 // Capture register counter starts from number of capture registers and | 7177 // Capture register counter starts from number of capture registers and |
7178 // counts down until wraping after zero. | 7178 // counts down until wraping after zero. |
7179 __ bind(&next_capture); | 7179 __ bind(&next_capture); |
7180 __ subq(rdx, Immediate(1)); | 7180 __ subq(rdx, Immediate(1)); |
7181 __ j(negative, &done); | 7181 __ j(negative, &done); |
7182 // Read the value from the static offsets vector buffer and make it a smi. | 7182 // Read the value from the static offsets vector buffer and make it a smi. |
7183 __ movl(rdi, Operand(rcx, rdx, times_int_size, 0)); | 7183 __ movl(rdi, Operand(rcx, rdx, times_int_size, 0)); |
7184 __ Integer32ToSmi(rdi, rdi, &runtime); | 7184 __ Integer32ToSmi(rdi, rdi, &runtime); |
7185 // Add previous index (from its stack slot) if value is not negative. | |
7186 Label capture_negative; | |
7187 // Negative flag set by smi convertion above. | |
7188 __ j(negative, &capture_negative); | |
7189 __ SmiAdd(rdi, rdi, rax, &runtime); // Add previous index. | |
7190 __ bind(&capture_negative); | |
7191 // Store the smi value in the last match info. | 7185 // Store the smi value in the last match info. |
7192 __ movq(FieldOperand(rbx, | 7186 __ movq(FieldOperand(rbx, |
7193 rdx, | 7187 rdx, |
7194 times_pointer_size, | 7188 times_pointer_size, |
7195 RegExpImpl::kFirstCaptureOffset), | 7189 RegExpImpl::kFirstCaptureOffset), |
7196 rdi); | 7190 rdi); |
7197 __ jmp(&next_capture); | 7191 __ jmp(&next_capture); |
7198 __ bind(&done); | 7192 __ bind(&done); |
7199 | 7193 |
7200 // Return last match info. | 7194 // Return last match info. |
(...skipping 2685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9886 // Call the function from C++. | 9880 // Call the function from C++. |
9887 return FUNCTION_CAST<ModuloFunction>(buffer); | 9881 return FUNCTION_CAST<ModuloFunction>(buffer); |
9888 } | 9882 } |
9889 | 9883 |
9890 #endif | 9884 #endif |
9891 | 9885 |
9892 | 9886 |
9893 #undef __ | 9887 #undef __ |
9894 | 9888 |
9895 } } // namespace v8::internal | 9889 } } // namespace v8::internal |
OLD | NEW |