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 "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/compilation-cache.h" | 9 #include "src/compilation-cache.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 6744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6755 node, | 6755 node, |
6756 data->capture_count, | 6756 data->capture_count, |
6757 pattern); | 6757 pattern); |
6758 } | 6758 } |
6759 | 6759 |
6760 | 6760 |
6761 bool RegExpEngine::TooMuchRegExpCode(Handle<String> pattern) { | 6761 bool RegExpEngine::TooMuchRegExpCode(Handle<String> pattern) { |
6762 Heap* heap = pattern->GetHeap(); | 6762 Heap* heap = pattern->GetHeap(); |
6763 bool too_much = pattern->length() > RegExpImpl::kRegExpTooLargeToOptimize; | 6763 bool too_much = pattern->length() > RegExpImpl::kRegExpTooLargeToOptimize; |
6764 if (heap->total_regexp_code_generated() > RegExpImpl::kRegExpCompiledLimit && | 6764 if (heap->total_regexp_code_generated() > RegExpImpl::kRegExpCompiledLimit && |
6765 heap->isolate()->memory_allocator()->SizeExecutable() > | 6765 heap->memory_allocator()->SizeExecutable() > |
6766 RegExpImpl::kRegExpExecutableMemoryLimit) { | 6766 RegExpImpl::kRegExpExecutableMemoryLimit) { |
6767 too_much = true; | 6767 too_much = true; |
6768 } | 6768 } |
6769 return too_much; | 6769 return too_much; |
6770 } | 6770 } |
6771 | 6771 |
6772 | 6772 |
6773 Object* RegExpResultsCache::Lookup(Heap* heap, String* key_string, | 6773 Object* RegExpResultsCache::Lookup(Heap* heap, String* key_string, |
6774 Object* key_pattern, | 6774 Object* key_pattern, |
6775 FixedArray** last_match_cache, | 6775 FixedArray** last_match_cache, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6864 | 6864 |
6865 | 6865 |
6866 void RegExpResultsCache::Clear(FixedArray* cache) { | 6866 void RegExpResultsCache::Clear(FixedArray* cache) { |
6867 for (int i = 0; i < kRegExpResultsCacheSize; i++) { | 6867 for (int i = 0; i < kRegExpResultsCacheSize; i++) { |
6868 cache->set(i, Smi::FromInt(0)); | 6868 cache->set(i, Smi::FromInt(0)); |
6869 } | 6869 } |
6870 } | 6870 } |
6871 | 6871 |
6872 } // namespace internal | 6872 } // namespace internal |
6873 } // namespace v8 | 6873 } // namespace v8 |
OLD | NEW |