Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/regexp/jsregexp.cc

Issue 1862653002: Move MemoryAllocator and CodeRange into Heap (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/isolate.cc ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698