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

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

Issue 2395563002: [heap] Use size_t throughout MemoryAllocator (Closed)
Patch Set: Fix compilation Created 4 years, 2 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
« src/heap/spaces.h ('K') | « src/heap/spaces.cc ('k') | no next file » | 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 #ifndef V8_REGEXP_JSREGEXP_H_ 5 #ifndef V8_REGEXP_JSREGEXP_H_
6 #define V8_REGEXP_JSREGEXP_H_ 6 #define V8_REGEXP_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 #include "src/regexp/regexp-ast.h" 10 #include "src/regexp/regexp-ast.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 static int IrregexpNumberOfCaptures(FixedArray* re); 193 static int IrregexpNumberOfCaptures(FixedArray* re);
194 static int IrregexpNumberOfRegisters(FixedArray* re); 194 static int IrregexpNumberOfRegisters(FixedArray* re);
195 static ByteArray* IrregexpByteCode(FixedArray* re, bool is_one_byte); 195 static ByteArray* IrregexpByteCode(FixedArray* re, bool is_one_byte);
196 static Code* IrregexpNativeCode(FixedArray* re, bool is_one_byte); 196 static Code* IrregexpNativeCode(FixedArray* re, bool is_one_byte);
197 197
198 // Limit the space regexps take up on the heap. In order to limit this we 198 // Limit the space regexps take up on the heap. In order to limit this we
199 // would like to keep track of the amount of regexp code on the heap. This 199 // would like to keep track of the amount of regexp code on the heap. This
200 // is not tracked, however. As a conservative approximation we track the 200 // is not tracked, however. As a conservative approximation we track the
201 // total regexp code compiled including code that has subsequently been freed 201 // total regexp code compiled including code that has subsequently been freed
202 // and the total executable memory at any point. 202 // and the total executable memory at any point.
203 static const int kRegExpExecutableMemoryLimit = 16 * MB; 203 static const size_t kRegExpExecutableMemoryLimit = 16 * MB;
204 static const int kRegExpCompiledLimit = 1 * MB; 204 static const int kRegExpCompiledLimit = 1 * MB;
205 static const int kRegExpTooLargeToOptimize = 20 * KB; 205 static const int kRegExpTooLargeToOptimize = 20 * KB;
206 206
207 private: 207 private:
208 static bool CompileIrregexp(Handle<JSRegExp> re, 208 static bool CompileIrregexp(Handle<JSRegExp> re,
209 Handle<String> sample_subject, bool is_one_byte); 209 Handle<String> sample_subject, bool is_one_byte);
210 static inline bool EnsureCompiledIrregexp(Handle<JSRegExp> re, 210 static inline bool EnsureCompiledIrregexp(Handle<JSRegExp> re,
211 Handle<String> sample_subject, 211 Handle<String> sample_subject,
212 bool is_one_byte); 212 bool is_one_byte);
213 }; 213 };
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 static const int kStringOffset = 0; 1578 static const int kStringOffset = 0;
1579 static const int kPatternOffset = 1; 1579 static const int kPatternOffset = 1;
1580 static const int kArrayOffset = 2; 1580 static const int kArrayOffset = 2;
1581 static const int kLastMatchOffset = 3; 1581 static const int kLastMatchOffset = 3;
1582 }; 1582 };
1583 1583
1584 } // namespace internal 1584 } // namespace internal
1585 } // namespace v8 1585 } // namespace v8
1586 1586
1587 #endif // V8_REGEXP_JSREGEXP_H_ 1587 #endif // V8_REGEXP_JSREGEXP_H_
OLDNEW
« src/heap/spaces.h ('K') | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698