| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 21 matching lines...) Expand all Loading... |
| 32 #include "unicode.h" | 32 #include "unicode.h" |
| 33 #include "utils.h" | 33 #include "utils.h" |
| 34 #include "ast.h" | 34 #include "ast.h" |
| 35 #include "bytecodes-irregexp.h" | 35 #include "bytecodes-irregexp.h" |
| 36 #include "interpreter-irregexp.h" | 36 #include "interpreter-irregexp.h" |
| 37 | 37 |
| 38 | 38 |
| 39 namespace v8 { namespace internal { | 39 namespace v8 { namespace internal { |
| 40 | 40 |
| 41 | 41 |
| 42 static unibrow::Mapping<unibrow::Ecma262Canonicalize> canonicalize; | 42 static unibrow::Mapping<unibrow::Ecma262Canonicalize> interp_canonicalize; |
| 43 | 43 |
| 44 | 44 |
| 45 static bool BackRefMatchesNoCase(int from, | 45 static bool BackRefMatchesNoCase(int from, |
| 46 int current, | 46 int current, |
| 47 int len, | 47 int len, |
| 48 Vector<const uc16> subject) { | 48 Vector<const uc16> subject) { |
| 49 for (int i = 0; i < len; i++) { | 49 for (int i = 0; i < len; i++) { |
| 50 unibrow::uchar old_char = subject[from++]; | 50 unibrow::uchar old_char = subject[from++]; |
| 51 unibrow::uchar new_char = subject[current++]; | 51 unibrow::uchar new_char = subject[current++]; |
| 52 if (old_char == new_char) continue; | 52 if (old_char == new_char) continue; |
| 53 canonicalize.get(old_char, '\0', &old_char); | 53 interp_canonicalize.get(old_char, '\0', &old_char); |
| 54 canonicalize.get(new_char, '\0', &new_char); | 54 interp_canonicalize.get(new_char, '\0', &new_char); |
| 55 if (old_char != new_char) { | 55 if (old_char != new_char) { |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 | 62 |
| 63 static bool BackRefMatchesNoCase(int from, | 63 static bool BackRefMatchesNoCase(int from, |
| 64 int current, | 64 int current, |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 if (start_position != 0) previous_char = subject_vector[start_position - 1]; | 588 if (start_position != 0) previous_char = subject_vector[start_position - 1]; |
| 589 return RawMatch(code_base, | 589 return RawMatch(code_base, |
| 590 subject_vector, | 590 subject_vector, |
| 591 registers, | 591 registers, |
| 592 start_position, | 592 start_position, |
| 593 previous_char); | 593 previous_char); |
| 594 } | 594 } |
| 595 } | 595 } |
| 596 | 596 |
| 597 } } // namespace v8::internal | 597 } } // namespace v8::internal |
| OLD | NEW |