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 #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 Loading... |
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 Loading... |
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_ |
OLD | NEW |