| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2618 int start, end; | 2618 int start, end; |
| 2619 { | 2619 { |
| 2620 AssertNoAllocation match_info_array_is_not_in_a_handle; | 2620 AssertNoAllocation match_info_array_is_not_in_a_handle; |
| 2621 FixedArray* match_info_array = | 2621 FixedArray* match_info_array = |
| 2622 FixedArray::cast(last_match_info_handle->elements()); | 2622 FixedArray::cast(last_match_info_handle->elements()); |
| 2623 | 2623 |
| 2624 start = RegExpImpl::GetCapture(match_info_array, 0); | 2624 start = RegExpImpl::GetCapture(match_info_array, 0); |
| 2625 end = RegExpImpl::GetCapture(match_info_array, 1); | 2625 end = RegExpImpl::GetCapture(match_info_array, 1); |
| 2626 } | 2626 } |
| 2627 | 2627 |
| 2628 int length = subject->length(); | 2628 int length = subject_handle->length(); |
| 2629 int new_length = length - (end - start); | 2629 int new_length = length - (end - start); |
| 2630 if (new_length == 0) { | 2630 if (new_length == 0) { |
| 2631 return Heap::empty_string(); | 2631 return Heap::empty_string(); |
| 2632 } | 2632 } |
| 2633 Handle<ResultSeqString> answer; | 2633 Handle<ResultSeqString> answer; |
| 2634 if (ResultSeqString::kHasAsciiEncoding) { | 2634 if (ResultSeqString::kHasAsciiEncoding) { |
| 2635 answer = | 2635 answer = |
| 2636 Handle<ResultSeqString>::cast(Factory::NewRawAsciiString(new_length)); | 2636 Handle<ResultSeqString>::cast(Factory::NewRawAsciiString(new_length)); |
| 2637 } else { | 2637 } else { |
| 2638 answer = | 2638 answer = |
| (...skipping 8943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11582 } else { | 11582 } else { |
| 11583 // Handle last resort GC and make sure to allow future allocations | 11583 // Handle last resort GC and make sure to allow future allocations |
| 11584 // to grow the heap without causing GCs (if possible). | 11584 // to grow the heap without causing GCs (if possible). |
| 11585 Counters::gc_last_resort_from_js.Increment(); | 11585 Counters::gc_last_resort_from_js.Increment(); |
| 11586 Heap::CollectAllGarbage(false); | 11586 Heap::CollectAllGarbage(false); |
| 11587 } | 11587 } |
| 11588 } | 11588 } |
| 11589 | 11589 |
| 11590 | 11590 |
| 11591 } } // namespace v8::internal | 11591 } } // namespace v8::internal |
| OLD | NEW |