OLD | NEW |
1 // Copyright 2006-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 start_index + slice_offset); | 1105 start_index + slice_offset); |
1106 | 1106 |
1107 if (start_address != new_address) { | 1107 if (start_address != new_address) { |
1108 // If there is a difference, update the object pointer and start and end | 1108 // If there is a difference, update the object pointer and start and end |
1109 // addresses in the RegExp stack frame to match the new value. | 1109 // addresses in the RegExp stack frame to match the new value. |
1110 const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd); | 1110 const byte* end_address = frame_entry<const byte* >(re_frame, kInputEnd); |
1111 int byte_length = static_cast<int>(end_address - start_address); | 1111 int byte_length = static_cast<int>(end_address - start_address); |
1112 frame_entry<const String*>(re_frame, kInputString) = *subject; | 1112 frame_entry<const String*>(re_frame, kInputString) = *subject; |
1113 frame_entry<const byte*>(re_frame, kInputStart) = new_address; | 1113 frame_entry<const byte*>(re_frame, kInputStart) = new_address; |
1114 frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length; | 1114 frame_entry<const byte*>(re_frame, kInputEnd) = new_address + byte_length; |
| 1115 } else if (frame_entry<const String*>(re_frame, kInputString) != *subject) { |
| 1116 // Subject string might have been a ConsString that underwent |
| 1117 // short-circuiting during GC. That will not change start_address but |
| 1118 // will change pointer inside the subject handle. |
| 1119 frame_entry<const String*>(re_frame, kInputString) = *subject; |
1115 } | 1120 } |
1116 | 1121 |
1117 return 0; | 1122 return 0; |
1118 } | 1123 } |
1119 | 1124 |
1120 | 1125 |
1121 MemOperand RegExpMacroAssemblerMIPS::register_location(int register_index) { | 1126 MemOperand RegExpMacroAssemblerMIPS::register_location(int register_index) { |
1122 ASSERT(register_index < (1<<30)); | 1127 ASSERT(register_index < (1<<30)); |
1123 if (num_registers_ <= register_index) { | 1128 if (num_registers_ <= register_index) { |
1124 num_registers_ = register_index + 1; | 1129 num_registers_ = register_index + 1; |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 } | 1270 } |
1266 | 1271 |
1267 | 1272 |
1268 #undef __ | 1273 #undef __ |
1269 | 1274 |
1270 #endif // V8_INTERPRETED_REGEXP | 1275 #endif // V8_INTERPRETED_REGEXP |
1271 | 1276 |
1272 }} // namespace v8::internal | 1277 }} // namespace v8::internal |
1273 | 1278 |
1274 #endif // V8_TARGET_ARCH_MIPS | 1279 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |