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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 | 211 |
212 void RegExpMacroAssemblerIA32::CheckCharacters(Vector<const uc16> str, | 212 void RegExpMacroAssemblerIA32::CheckCharacters(Vector<const uc16> str, |
213 int cp_offset, | 213 int cp_offset, |
214 Label* on_failure, | 214 Label* on_failure, |
215 bool check_end_of_string) { | 215 bool check_end_of_string) { |
216 #ifdef DEBUG | 216 #ifdef DEBUG |
217 // If input is ASCII, don't even bother calling here if the string to | 217 // If input is ASCII, don't even bother calling here if the string to |
218 // match contains a non-ASCII character. | 218 // match contains a non-ASCII character. |
219 if (mode_ == ASCII) { | 219 if (mode_ == ASCII) { |
220 ASSERT(String::IsAscii(str.start(), str.length())); | 220 ASSERT(String::IsOneByte(str.start(), str.length())); |
221 } | 221 } |
222 #endif | 222 #endif |
223 int byte_length = str.length() * char_size(); | 223 int byte_length = str.length() * char_size(); |
224 int byte_offset = cp_offset * char_size(); | 224 int byte_offset = cp_offset * char_size(); |
225 if (check_end_of_string) { | 225 if (check_end_of_string) { |
226 // Check that there are at least str.length() characters left in the input. | 226 // Check that there are at least str.length() characters left in the input. |
227 __ cmp(edi, Immediate(-(byte_offset + byte_length))); | 227 __ cmp(edi, Immediate(-(byte_offset + byte_length))); |
228 BranchOrBacktrack(greater, on_failure); | 228 BranchOrBacktrack(greater, on_failure); |
229 } | 229 } |
230 | 230 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 __ cmp(eax, to - from); | 562 __ cmp(eax, to - from); |
563 BranchOrBacktrack(above, on_not_in_range); | 563 BranchOrBacktrack(above, on_not_in_range); |
564 } | 564 } |
565 | 565 |
566 | 566 |
567 void RegExpMacroAssemblerIA32::CheckBitInTable( | 567 void RegExpMacroAssemblerIA32::CheckBitInTable( |
568 Handle<ByteArray> table, | 568 Handle<ByteArray> table, |
569 Label* on_bit_set) { | 569 Label* on_bit_set) { |
570 __ mov(eax, Immediate(table)); | 570 __ mov(eax, Immediate(table)); |
571 Register index = current_character(); | 571 Register index = current_character(); |
572 if (mode_ != ASCII || kTableMask != String::kMaxAsciiCharCode) { | 572 if (mode_ != ASCII || kTableMask != String::kMaxOneByteCharCode) { |
573 __ mov(ebx, kTableSize - 1); | 573 __ mov(ebx, kTableSize - 1); |
574 __ and_(ebx, current_character()); | 574 __ and_(ebx, current_character()); |
575 index = ebx; | 575 index = ebx; |
576 } | 576 } |
577 __ cmpb(FieldOperand(eax, index, times_1, ByteArray::kHeaderSize), 0); | 577 __ cmpb(FieldOperand(eax, index, times_1, ByteArray::kHeaderSize), 0); |
578 BranchOrBacktrack(not_equal, on_bit_set); | 578 BranchOrBacktrack(not_equal, on_bit_set); |
579 } | 579 } |
580 | 580 |
581 | 581 |
582 bool RegExpMacroAssemblerIA32::CheckSpecialCharacterClass(uc16 type, | 582 bool RegExpMacroAssemblerIA32::CheckSpecialCharacterClass(uc16 type, |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 } | 1399 } |
1400 | 1400 |
1401 | 1401 |
1402 #undef __ | 1402 #undef __ |
1403 | 1403 |
1404 #endif // V8_INTERPRETED_REGEXP | 1404 #endif // V8_INTERPRETED_REGEXP |
1405 | 1405 |
1406 }} // namespace v8::internal | 1406 }} // namespace v8::internal |
1407 | 1407 |
1408 #endif // V8_TARGET_ARCH_IA32 | 1408 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |