Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: test/cctest/test-liveedit.cc

Issue 7080029: Fix Issue 1320: LiveEdit: text differencer fails with out of memory on large files (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: merge Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/liveedit.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 private: 88 private:
89 DiffChunkStruct** next_chunk_pointer_; 89 DiffChunkStruct** next_chunk_pointer_;
90 DiffChunkStruct* current_chunk_; 90 DiffChunkStruct* current_chunk_;
91 }; 91 };
92 92
93 93
94 void CompareStringsOneWay(const char* s1, const char* s2, 94 void CompareStringsOneWay(const char* s1, const char* s2,
95 int expected_diff_parameter = -1) { 95 int expected_diff_parameter = -1) {
96 StringCompareInput input(s1, s2); 96 StringCompareInput input(s1, s2);
97 97
98 ZoneScope zone_scope(Isolate::Current(), DELETE_ON_EXIT); 98 Isolate* isolate = Isolate::Current();
99 ZoneScope zone_scope(isolate, DELETE_ON_EXIT);
99 100
100 DiffChunkStruct* first_chunk; 101 DiffChunkStruct* first_chunk;
101 ListDiffOutputWriter writer(&first_chunk); 102 ListDiffOutputWriter writer(&first_chunk);
102 103
103 Comparator::CalculateDifference(&input, &writer); 104 {
105 MaybeObject* maybe_result =
106 Comparator::CalculateDifference(&input, &writer, isolate);
107 ASSERT_EQ(maybe_result->IsFailure(), false);
108 USE(maybe_result);
109 }
104 110
105 int len1 = StrLength(s1); 111 int len1 = StrLength(s1);
106 int len2 = StrLength(s2); 112 int len2 = StrLength(s2);
107 113
108 int pos1 = 0; 114 int pos1 = 0;
109 int pos2 = 0; 115 int pos2 = 0;
110 116
111 int diff_parameter = 0; 117 int diff_parameter = 0;
112 118
113 for (DiffChunkStruct* chunk = first_chunk; 119 for (DiffChunkStruct* chunk = first_chunk;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 CompareStrings("cat", "ct", 1); 176 CompareStrings("cat", "ct", 1);
171 CompareStrings("cat", "cat", 0); 177 CompareStrings("cat", "cat", 0);
172 CompareStrings("", "", 0); 178 CompareStrings("", "", 0);
173 CompareStrings("cat", "", 3); 179 CompareStrings("cat", "", 3);
174 CompareStrings("a cat", "a capybara", 7); 180 CompareStrings("a cat", "a capybara", 7);
175 CompareStrings("abbabababababaaabbabababababbabbbbbbbababa", 181 CompareStrings("abbabababababaaabbabababababbabbbbbbbababa",
176 "bbbbabababbbabababbbabababababbabbababa"); 182 "bbbbabababbbabababbbabababababbabbababa");
177 } 183 }
178 184
179 #endif // ENABLE_DEBUGGER_SUPPORT 185 #endif // ENABLE_DEBUGGER_SUPPORT
OLDNEW
« src/liveedit.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698