OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 start_index + slice_offset); | 1241 start_index + slice_offset); |
1242 | 1242 |
1243 if (start_address != new_address) { | 1243 if (start_address != new_address) { |
1244 // If there is a difference, update the object pointer and start and end | 1244 // If there is a difference, update the object pointer and start and end |
1245 // addresses in the RegExp stack frame to match the new value. | 1245 // addresses in the RegExp stack frame to match the new value. |
1246 const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd); | 1246 const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd); |
1247 int byte_length = static_cast<int>(end_address - start_address); | 1247 int byte_length = static_cast<int>(end_address - start_address); |
1248 frame_entry<const String*>(re_frame, kInputString) = *subject; | 1248 frame_entry<const String*>(re_frame, kInputString) = *subject; |
1249 frame_entry<const byte*>(re_frame, kInputStart) = new_address; | 1249 frame_entry<const byte*>(re_frame, kInputStart) = new_address; |
1250 frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length; | 1250 frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length; |
| 1251 } else if (frame_entry<const String*>(re_frame, kInputString) != *subject) { |
| 1252 // Subject string might have been a ConsString that underwent |
| 1253 // short-circuiting during GC. That will not change start_address but |
| 1254 // will change pointer inside the subject handle. |
| 1255 frame_entry<const String*>(re_frame, kInputString) = *subject; |
1251 } | 1256 } |
1252 | 1257 |
1253 return 0; | 1258 return 0; |
1254 } | 1259 } |
1255 | 1260 |
1256 | 1261 |
1257 Operand RegExpMacroAssemblerX64::register_location(int register_index) { | 1262 Operand RegExpMacroAssemblerX64::register_location(int register_index) { |
1258 ASSERT(register_index < (1<<30)); | 1263 ASSERT(register_index < (1<<30)); |
1259 if (num_registers_ <= register_index) { | 1264 if (num_registers_ <= register_index) { |
1260 num_registers_ = register_index + 1; | 1265 num_registers_ = register_index + 1; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 } | 1416 } |
1412 } | 1417 } |
1413 | 1418 |
1414 #undef __ | 1419 #undef __ |
1415 | 1420 |
1416 #endif // V8_INTERPRETED_REGEXP | 1421 #endif // V8_INTERPRETED_REGEXP |
1417 | 1422 |
1418 }} // namespace v8::internal | 1423 }} // namespace v8::internal |
1419 | 1424 |
1420 #endif // V8_TARGET_ARCH_X64 | 1425 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |