OLD | NEW |
1 // Copyright 2008-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2008-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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 | 205 |
206 void RegExpMacroAssemblerIA32::CheckCharacters(Vector<const uc16> str, | 206 void RegExpMacroAssemblerIA32::CheckCharacters(Vector<const uc16> str, |
207 int cp_offset, | 207 int cp_offset, |
208 Label* on_failure, | 208 Label* on_failure, |
209 bool check_end_of_string) { | 209 bool check_end_of_string) { |
210 #ifdef DEBUG | 210 #ifdef DEBUG |
211 // If input is ASCII, don't even bother calling here if the string to | 211 // If input is ASCII, don't even bother calling here if the string to |
212 // match contains a non-ascii character. | 212 // match contains a non-ascii character. |
213 if (mode_ == ASCII) { | 213 if (mode_ == ASCII) { |
214 for (int i = 0; i < str.length(); i++) { | 214 ASSERT(String::IsAscii(str.start(), str.length())); |
215 ASSERT(str[i] <= String::kMaxAsciiCharCodeU); | |
216 } | |
217 } | 215 } |
218 #endif | 216 #endif |
219 int byte_length = str.length() * char_size(); | 217 int byte_length = str.length() * char_size(); |
220 int byte_offset = cp_offset * char_size(); | 218 int byte_offset = cp_offset * char_size(); |
221 if (check_end_of_string) { | 219 if (check_end_of_string) { |
222 // Check that there are at least str.length() characters left in the input. | 220 // Check that there are at least str.length() characters left in the input. |
223 __ cmp(Operand(edi), Immediate(-(byte_offset + byte_length))); | 221 __ cmp(Operand(edi), Immediate(-(byte_offset + byte_length))); |
224 BranchOrBacktrack(greater, on_failure); | 222 BranchOrBacktrack(greater, on_failure); |
225 } | 223 } |
226 | 224 |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 } | 1244 } |
1247 | 1245 |
1248 | 1246 |
1249 #undef __ | 1247 #undef __ |
1250 | 1248 |
1251 #endif // V8_INTERPRETED_REGEXP | 1249 #endif // V8_INTERPRETED_REGEXP |
1252 | 1250 |
1253 }} // namespace v8::internal | 1251 }} // namespace v8::internal |
1254 | 1252 |
1255 #endif // V8_TARGET_ARCH_IA32 | 1253 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |