| OLD | NEW |
| 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 using namespace v8::internal; | 38 using namespace v8::internal; |
| 39 | 39 |
| 40 // Anonymous namespace. | 40 // Anonymous namespace. |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 class StringCompareInput : public Comparator::Input { | 43 class StringCompareInput : public Comparator::Input { |
| 44 public: | 44 public: |
| 45 StringCompareInput(const char* s1, const char* s2) : s1_(s1), s2_(s2) { | 45 StringCompareInput(const char* s1, const char* s2) : s1_(s1), s2_(s2) { |
| 46 } | 46 } |
| 47 int getLength1() { | 47 int GetLength1() { |
| 48 return StrLength(s1_); | 48 return StrLength(s1_); |
| 49 } | 49 } |
| 50 int getLength2() { | 50 int GetLength2() { |
| 51 return StrLength(s2_); | 51 return StrLength(s2_); |
| 52 } | 52 } |
| 53 bool equals(int index1, int index2) { | 53 bool Equals(int index1, int index2) { |
| 54 return s1_[index1] == s2_[index2]; | 54 return s1_[index1] == s2_[index2]; |
| 55 } | 55 } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 const char* s1_; | 58 const char* s1_; |
| 59 const char* s2_; | 59 const char* s2_; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 | 62 |
| 63 class DiffChunkStruct : public ZoneObject { | 63 class DiffChunkStruct : public ZoneObject { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 CompareStrings("cat", "ct", 1); | 170 CompareStrings("cat", "ct", 1); |
| 171 CompareStrings("cat", "cat", 0); | 171 CompareStrings("cat", "cat", 0); |
| 172 CompareStrings("", "", 0); | 172 CompareStrings("", "", 0); |
| 173 CompareStrings("cat", "", 3); | 173 CompareStrings("cat", "", 3); |
| 174 CompareStrings("a cat", "a capybara", 7); | 174 CompareStrings("a cat", "a capybara", 7); |
| 175 CompareStrings("abbabababababaaabbabababababbabbbbbbbababa", | 175 CompareStrings("abbabababababaaabbabababababbabbbbbbbababa", |
| 176 "bbbbabababbbabababbbabababababbabbababa"); | 176 "bbbbabababbbabababbbabababababbabbababa"); |
| 177 } | 177 } |
| 178 | 178 |
| 179 #endif // ENABLE_DEBUGGER_SUPPORT | 179 #endif // ENABLE_DEBUGGER_SUPPORT |
| OLD | NEW |