OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 4359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4370 } | 4370 } |
4371 return; | 4371 return; |
4372 } | 4372 } |
4373 default: | 4373 default: |
4374 UNREACHABLE(); | 4374 UNREACHABLE(); |
4375 return; | 4375 return; |
4376 } | 4376 } |
4377 } | 4377 } |
4378 | 4378 |
4379 template <typename schar> | 4379 template <typename schar> |
4380 void inline FindCharIndices(Vector<const schar> subject, | 4380 inline void FindCharIndices(Vector<const schar> subject, |
4381 const schar pattern_char, | 4381 const schar pattern_char, |
4382 ZoneList<int>* indices, | 4382 ZoneList<int>* indices, |
4383 unsigned int limit) { | 4383 unsigned int limit) { |
4384 // Collect indices of pattern_char in subject, and the end-of-string index. | 4384 // Collect indices of pattern_char in subject, and the end-of-string index. |
4385 // Stop after finding at most limit values. | 4385 // Stop after finding at most limit values. |
4386 int index = 0; | 4386 int index = 0; |
4387 while (limit > 0) { | 4387 while (limit > 0) { |
4388 index = SingleCharIndexOf(subject, pattern_char, index); | 4388 index = SingleCharIndexOf(subject, pattern_char, index); |
4389 if (index < 0) return; | 4389 if (index < 0) return; |
4390 indices->Add(index); | 4390 indices->Add(index); |
(...skipping 4980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9371 } else { | 9371 } else { |
9372 // Handle last resort GC and make sure to allow future allocations | 9372 // Handle last resort GC and make sure to allow future allocations |
9373 // to grow the heap without causing GCs (if possible). | 9373 // to grow the heap without causing GCs (if possible). |
9374 Counters::gc_last_resort_from_js.Increment(); | 9374 Counters::gc_last_resort_from_js.Increment(); |
9375 Heap::CollectAllGarbage(false); | 9375 Heap::CollectAllGarbage(false); |
9376 } | 9376 } |
9377 } | 9377 } |
9378 | 9378 |
9379 | 9379 |
9380 } } // namespace v8::internal | 9380 } } // namespace v8::internal |
OLD | NEW |