Index: src/jsregexp.h |
=================================================================== |
--- src/jsregexp.h (revision 7820) |
+++ src/jsregexp.h (working copy) |
@@ -176,6 +176,14 @@ |
static ByteArray* IrregexpByteCode(FixedArray* re, bool is_ascii); |
static Code* IrregexpNativeCode(FixedArray* re, bool is_ascii); |
+ // Limit the space regexps take up on the heap. In order to limit this we |
+ // would like to keep track of the amount of regexp code on the heap. This |
+ // is not tracked, however. As a conservative approximation we track the |
+ // total regexp code compiled including code that has subsequently been freed |
+ // and the total executable memory at any point. |
+ static const int kRegExpExecutableMemoryLimit = 16 * MB; |
+ static const int kRegWxpCompiledLimit = 1 * MB; |
+ |
private: |
static String* last_ascii_string_; |
static String* two_byte_cached_string_; |