OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/regexp/jsregexp.h" | 5 #include "src/regexp/jsregexp.h" |
6 | 6 |
| 7 #include <memory> |
| 8 |
7 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
8 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
9 #include "src/compilation-cache.h" | 11 #include "src/compilation-cache.h" |
10 #include "src/compiler.h" | 12 #include "src/compiler.h" |
11 #include "src/execution.h" | 13 #include "src/execution.h" |
12 #include "src/factory.h" | 14 #include "src/factory.h" |
13 #include "src/isolate-inl.h" | 15 #include "src/isolate-inl.h" |
14 #include "src/messages.h" | 16 #include "src/messages.h" |
15 #include "src/ostreams.h" | 17 #include "src/ostreams.h" |
16 #include "src/regexp/interpreter-irregexp.h" | 18 #include "src/regexp/interpreter-irregexp.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 if (required_registers < 0) { | 591 if (required_registers < 0) { |
590 // Compiling failed with an exception. | 592 // Compiling failed with an exception. |
591 DCHECK(isolate->has_pending_exception()); | 593 DCHECK(isolate->has_pending_exception()); |
592 return MaybeHandle<Object>(); | 594 return MaybeHandle<Object>(); |
593 } | 595 } |
594 | 596 |
595 int32_t* output_registers = NULL; | 597 int32_t* output_registers = NULL; |
596 if (required_registers > Isolate::kJSRegexpStaticOffsetsVectorSize) { | 598 if (required_registers > Isolate::kJSRegexpStaticOffsetsVectorSize) { |
597 output_registers = NewArray<int32_t>(required_registers); | 599 output_registers = NewArray<int32_t>(required_registers); |
598 } | 600 } |
599 base::SmartArrayPointer<int32_t> auto_release(output_registers); | 601 std::unique_ptr<int32_t[]> auto_release(output_registers); |
600 if (output_registers == NULL) { | 602 if (output_registers == NULL) { |
601 output_registers = isolate->jsregexp_static_offsets_vector(); | 603 output_registers = isolate->jsregexp_static_offsets_vector(); |
602 } | 604 } |
603 | 605 |
604 int res = RegExpImpl::IrregexpExecRaw( | 606 int res = RegExpImpl::IrregexpExecRaw( |
605 regexp, subject, previous_index, output_registers, required_registers); | 607 regexp, subject, previous_index, output_registers, required_registers); |
606 if (res == RE_SUCCESS) { | 608 if (res == RE_SUCCESS) { |
607 int capture_count = | 609 int capture_count = |
608 IrregexpNumberOfCaptures(FixedArray::cast(regexp->data())); | 610 IrregexpNumberOfCaptures(FixedArray::cast(regexp->data())); |
609 return SetLastMatchInfo( | 611 return SetLastMatchInfo( |
(...skipping 6266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6876 | 6878 |
6877 | 6879 |
6878 void RegExpResultsCache::Clear(FixedArray* cache) { | 6880 void RegExpResultsCache::Clear(FixedArray* cache) { |
6879 for (int i = 0; i < kRegExpResultsCacheSize; i++) { | 6881 for (int i = 0; i < kRegExpResultsCacheSize; i++) { |
6880 cache->set(i, Smi::FromInt(0)); | 6882 cache->set(i, Smi::FromInt(0)); |
6881 } | 6883 } |
6882 } | 6884 } |
6883 | 6885 |
6884 } // namespace internal | 6886 } // namespace internal |
6885 } // namespace v8 | 6887 } // namespace v8 |
OLD | NEW |