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

Side by Side Diff: src/jsregexp.h

Issue 1174713002: Reland of 'Optimize trivial regexp disjunctions' CL 1176453002 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix for the out-of-bounds sort that caused the revert Created 5 years, 6 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/ast.h ('k') | src/jsregexp.cc » ('j') | src/jsregexp.cc » ('J')
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 #ifndef V8_JSREGEXP_H_ 5 #ifndef V8_JSREGEXP_H_
6 #define V8_JSREGEXP_H_ 6 #define V8_JSREGEXP_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assembler.h" 9 #include "src/assembler.h"
10 10
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 static ByteArray* IrregexpByteCode(FixedArray* re, bool is_one_byte); 205 static ByteArray* IrregexpByteCode(FixedArray* re, bool is_one_byte);
206 static Code* IrregexpNativeCode(FixedArray* re, bool is_one_byte); 206 static Code* IrregexpNativeCode(FixedArray* re, bool is_one_byte);
207 207
208 // Limit the space regexps take up on the heap. In order to limit this we 208 // Limit the space regexps take up on the heap. In order to limit this we
209 // would like to keep track of the amount of regexp code on the heap. This 209 // would like to keep track of the amount of regexp code on the heap. This
210 // is not tracked, however. As a conservative approximation we track the 210 // is not tracked, however. As a conservative approximation we track the
211 // total regexp code compiled including code that has subsequently been freed 211 // total regexp code compiled including code that has subsequently been freed
212 // and the total executable memory at any point. 212 // and the total executable memory at any point.
213 static const int kRegExpExecutableMemoryLimit = 16 * MB; 213 static const int kRegExpExecutableMemoryLimit = 16 * MB;
214 static const int kRegExpCompiledLimit = 1 * MB; 214 static const int kRegExpCompiledLimit = 1 * MB;
215 static const int kRegExpTooLargeToOptimize = 10 * KB; 215 static const int kRegExpTooLargeToOptimize = 20 * KB;
216 216
217 private: 217 private:
218 static bool CompileIrregexp(Handle<JSRegExp> re, 218 static bool CompileIrregexp(Handle<JSRegExp> re,
219 Handle<String> sample_subject, bool is_one_byte); 219 Handle<String> sample_subject, bool is_one_byte);
220 static inline bool EnsureCompiledIrregexp(Handle<JSRegExp> re, 220 static inline bool EnsureCompiledIrregexp(Handle<JSRegExp> re,
221 Handle<String> sample_subject, 221 Handle<String> sample_subject,
222 bool is_one_byte); 222 bool is_one_byte);
223 }; 223 };
224 224
225 225
(...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 1655
1656 static bool TooMuchRegExpCode(Handle<String> pattern); 1656 static bool TooMuchRegExpCode(Handle<String> pattern);
1657 1657
1658 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case); 1658 static void DotPrint(const char* label, RegExpNode* node, bool ignore_case);
1659 }; 1659 };
1660 1660
1661 1661
1662 } } // namespace v8::internal 1662 } } // namespace v8::internal
1663 1663
1664 #endif // V8_JSREGEXP_H_ 1664 #endif // V8_JSREGEXP_H_
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/jsregexp.cc » ('j') | src/jsregexp.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698