| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1143 return RETRY; | 1143 return RETRY; |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 // Prepare for possible GC. | 1146 // Prepare for possible GC. |
| 1147 HandleScope handles(isolate); | 1147 HandleScope handles(isolate); |
| 1148 Handle<Code> code_handle(re_code); | 1148 Handle<Code> code_handle(re_code); |
| 1149 | 1149 |
| 1150 Handle<String> subject(frame_entry<String*>(re_frame, kInputString)); | 1150 Handle<String> subject(frame_entry<String*>(re_frame, kInputString)); |
| 1151 | 1151 |
| 1152 // Current string. | 1152 // Current string. |
| 1153 bool is_ascii = subject->IsAsciiRepresentationUnderneath(); | 1153 bool is_ascii = subject->IsOneByteRepresentationUnderneath(); |
| 1154 | 1154 |
| 1155 ASSERT(re_code->instruction_start() <= *return_address); | 1155 ASSERT(re_code->instruction_start() <= *return_address); |
| 1156 ASSERT(*return_address <= | 1156 ASSERT(*return_address <= |
| 1157 re_code->instruction_start() + re_code->instruction_size()); | 1157 re_code->instruction_start() + re_code->instruction_size()); |
| 1158 | 1158 |
| 1159 MaybeObject* result = Execution::HandleStackGuardInterrupt(isolate); | 1159 MaybeObject* result = Execution::HandleStackGuardInterrupt(isolate); |
| 1160 | 1160 |
| 1161 if (*code_handle != re_code) { // Return address no longer valid | 1161 if (*code_handle != re_code) { // Return address no longer valid |
| 1162 int delta = code_handle->address() - re_code->address(); | 1162 int delta = code_handle->address() - re_code->address(); |
| 1163 // Overwrite the return address on the stack. | 1163 // Overwrite the return address on the stack. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1174 // Extract the underlying string and the slice offset. | 1174 // Extract the underlying string and the slice offset. |
| 1175 if (StringShape(*subject_tmp).IsCons()) { | 1175 if (StringShape(*subject_tmp).IsCons()) { |
| 1176 subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first()); | 1176 subject_tmp = Handle<String>(ConsString::cast(*subject_tmp)->first()); |
| 1177 } else if (StringShape(*subject_tmp).IsSliced()) { | 1177 } else if (StringShape(*subject_tmp).IsSliced()) { |
| 1178 SlicedString* slice = SlicedString::cast(*subject_tmp); | 1178 SlicedString* slice = SlicedString::cast(*subject_tmp); |
| 1179 subject_tmp = Handle<String>(slice->parent()); | 1179 subject_tmp = Handle<String>(slice->parent()); |
| 1180 slice_offset = slice->offset(); | 1180 slice_offset = slice->offset(); |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 // String might have changed. | 1183 // String might have changed. |
| 1184 if (subject_tmp->IsAsciiRepresentation() != is_ascii) { | 1184 if (subject_tmp->IsOneByteRepresentation() != is_ascii) { |
| 1185 // If we changed between an ASCII and an UC16 string, the specialized | 1185 // If we changed between an ASCII and an UC16 string, the specialized |
| 1186 // code cannot be used, and we need to restart regexp matching from | 1186 // code cannot be used, and we need to restart regexp matching from |
| 1187 // scratch (including, potentially, compiling a new version of the code). | 1187 // scratch (including, potentially, compiling a new version of the code). |
| 1188 return RETRY; | 1188 return RETRY; |
| 1189 } | 1189 } |
| 1190 | 1190 |
| 1191 // Otherwise, the content of the string might have moved. It must still | 1191 // Otherwise, the content of the string might have moved. It must still |
| 1192 // be a sequential or external string with the same content. | 1192 // be a sequential or external string with the same content. |
| 1193 // Update the start and end pointers in the stack frame to the current | 1193 // Update the start and end pointers in the stack frame to the current |
| 1194 // location (whether it has actually moved or not). | 1194 // location (whether it has actually moved or not). |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); | 1411 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); |
| 1412 } | 1412 } |
| 1413 | 1413 |
| 1414 #undef __ | 1414 #undef __ |
| 1415 | 1415 |
| 1416 #endif // V8_INTERPRETED_REGEXP | 1416 #endif // V8_INTERPRETED_REGEXP |
| 1417 | 1417 |
| 1418 }} // namespace v8::internal | 1418 }} // namespace v8::internal |
| 1419 | 1419 |
| 1420 #endif // V8_TARGET_ARCH_ARM | 1420 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |