OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 | 217 |
218 void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str, | 218 void RegExpMacroAssemblerX64::CheckCharacters(Vector<const uc16> str, |
219 int cp_offset, | 219 int cp_offset, |
220 Label* on_failure, | 220 Label* on_failure, |
221 bool check_end_of_string) { | 221 bool check_end_of_string) { |
222 #ifdef DEBUG | 222 #ifdef DEBUG |
223 // If input is ASCII, don't even bother calling here if the string to | 223 // If input is ASCII, don't even bother calling here if the string to |
224 // match contains a non-ascii character. | 224 // match contains a non-ascii character. |
225 if (mode_ == ASCII) { | 225 if (mode_ == ASCII) { |
226 for (int i = 0; i < str.length(); i++) { | 226 ASSERT(String::IsAscii(str.start(), str.length())); |
227 ASSERT(str[i] <= String::kMaxAsciiCharCodeU); | |
228 } | |
229 } | 227 } |
230 #endif | 228 #endif |
231 int byte_length = str.length() * char_size(); | 229 int byte_length = str.length() * char_size(); |
232 int byte_offset = cp_offset * char_size(); | 230 int byte_offset = cp_offset * char_size(); |
233 if (check_end_of_string) { | 231 if (check_end_of_string) { |
234 // Check that there are at least str.length() characters left in the input. | 232 // Check that there are at least str.length() characters left in the input. |
235 __ cmpl(rdi, Immediate(-(byte_offset + byte_length))); | 233 __ cmpl(rdi, Immediate(-(byte_offset + byte_length))); |
236 BranchOrBacktrack(greater, on_failure); | 234 BranchOrBacktrack(greater, on_failure); |
237 } | 235 } |
238 | 236 |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 } | 1373 } |
1376 } | 1374 } |
1377 | 1375 |
1378 #undef __ | 1376 #undef __ |
1379 | 1377 |
1380 #endif // V8_INTERPRETED_REGEXP | 1378 #endif // V8_INTERPRETED_REGEXP |
1381 | 1379 |
1382 }} // namespace v8::internal | 1380 }} // namespace v8::internal |
1383 | 1381 |
1384 #endif // V8_TARGET_ARCH_X64 | 1382 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |