OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3574 // No matches at all, return failure or exception result directly. | 3574 // No matches at all, return failure or exception result directly. |
3575 return result; | 3575 return result; |
3576 } | 3576 } |
3577 | 3577 |
3578 | 3578 |
3579 RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExecMultiple) { | 3579 RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExecMultiple) { |
3580 ASSERT(args.length() == 4); | 3580 ASSERT(args.length() == 4); |
3581 HandleScope handles(isolate); | 3581 HandleScope handles(isolate); |
3582 | 3582 |
3583 CONVERT_ARG_CHECKED(String, subject, 1); | 3583 CONVERT_ARG_CHECKED(String, subject, 1); |
3584 if (!subject->IsFlat()) { FlattenString(subject); } | 3584 if (!subject->IsFlat()) FlattenString(subject); |
3585 CONVERT_ARG_CHECKED(JSRegExp, regexp, 0); | 3585 CONVERT_ARG_CHECKED(JSRegExp, regexp, 0); |
3586 CONVERT_ARG_CHECKED(JSArray, last_match_info, 2); | 3586 CONVERT_ARG_CHECKED(JSArray, last_match_info, 2); |
3587 CONVERT_ARG_CHECKED(JSArray, result_array, 3); | 3587 CONVERT_ARG_CHECKED(JSArray, result_array, 3); |
3588 | 3588 |
3589 ASSERT(last_match_info->HasFastElements()); | 3589 ASSERT(last_match_info->HasFastElements()); |
3590 ASSERT(regexp->GetFlags().is_global()); | 3590 ASSERT(regexp->GetFlags().is_global()); |
3591 Handle<FixedArray> result_elements; | 3591 Handle<FixedArray> result_elements; |
3592 if (result_array->HasFastElements()) { | 3592 if (result_array->HasFastElements()) { |
3593 result_elements = | 3593 result_elements = |
3594 Handle<FixedArray>(FixedArray::cast(result_array->elements())); | 3594 Handle<FixedArray>(FixedArray::cast(result_array->elements())); |
(...skipping 9156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12751 } else { | 12751 } else { |
12752 // Handle last resort GC and make sure to allow future allocations | 12752 // Handle last resort GC and make sure to allow future allocations |
12753 // to grow the heap without causing GCs (if possible). | 12753 // to grow the heap without causing GCs (if possible). |
12754 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12754 isolate->counters()->gc_last_resort_from_js()->Increment(); |
12755 isolate->heap()->CollectAllGarbage(false); | 12755 isolate->heap()->CollectAllGarbage(false); |
12756 } | 12756 } |
12757 } | 12757 } |
12758 | 12758 |
12759 | 12759 |
12760 } } // namespace v8::internal | 12760 } } // namespace v8::internal |
OLD | NEW |