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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 static bool BackRefMatchesNoCase(Canonicalize* interp_canonicalize, | 67 static bool BackRefMatchesNoCase(Canonicalize* interp_canonicalize, |
68 int from, | 68 int from, |
69 int current, | 69 int current, |
70 int len, | 70 int len, |
71 Vector<const uint8_t> subject) { | 71 Vector<const uint8_t> subject) { |
72 for (int i = 0; i < len; i++) { | 72 for (int i = 0; i < len; i++) { |
73 unsigned int old_char = subject[from++]; | 73 unsigned int old_char = subject[from++]; |
74 unsigned int new_char = subject[current++]; | 74 unsigned int new_char = subject[current++]; |
75 if (old_char == new_char) continue; | 75 if (old_char == new_char) continue; |
76 if (old_char - 'A' <= 'Z' - 'A') old_char |= 0x20; | 76 // Convert both characters to lower case. |
77 if (new_char - 'A' <= 'Z' - 'A') new_char |= 0x20; | 77 old_char |= 0x20; |
| 78 new_char |= 0x20; |
78 if (old_char != new_char) return false; | 79 if (old_char != new_char) return false; |
| 80 // Not letters in the ASCII range and Latin-1 range. |
| 81 if (!(old_char - 'a' <= 'z' - 'a') && |
| 82 !(old_char - 224 <= 254 - 224 && old_char != 247)) { |
| 83 return false; |
| 84 } |
79 } | 85 } |
80 return true; | 86 return true; |
81 } | 87 } |
82 | 88 |
83 | 89 |
84 #ifdef DEBUG | 90 #ifdef DEBUG |
85 static void TraceInterpreter(const byte* code_base, | 91 static void TraceInterpreter(const byte* code_base, |
86 const byte* pc, | 92 const byte* pc, |
87 int stack_depth, | 93 int stack_depth, |
88 int current_position, | 94 int current_position, |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 return RawMatch(isolate, | 638 return RawMatch(isolate, |
633 code_base, | 639 code_base, |
634 subject_vector, | 640 subject_vector, |
635 registers, | 641 registers, |
636 start_position, | 642 start_position, |
637 previous_char); | 643 previous_char); |
638 } | 644 } |
639 } | 645 } |
640 | 646 |
641 } } // namespace v8::internal | 647 } } // namespace v8::internal |
OLD | NEW |