5 #ifndef V8_REGEXP_REGEXP_STACK_H_ 6 #define V8_REGEXP_REGEXP_STACK_H_ 8 #include "src/base/logging.h" 9 #include "src/base/macros.h" 10 #include "src/globals.h" 30 RegExpStack* stack()
const {
return regexp_stack_; }
44 static const int kStackLimitSlack = 32;
48 DCHECK_NE(0, thread_local_.memory_size_);
49 return reinterpret_cast<Address>(thread_local_.memory_) +
50 thread_local_.memory_size_;
54 size_t stack_capacity() {
return thread_local_.memory_size_; }
61 Address* limit_address() {
return &(thread_local_.limit_); }
65 Address EnsureCapacity(
size_t size);
68 static int ArchiveSpacePerThread() {
69 return static_cast<int>(
sizeof(ThreadLocal));
71 char* ArchiveStack(
char* to);
72 char* RestoreStack(
char* from);
73 void FreeThreadResources() { thread_local_.Free(); }
80 static const Address kMemoryTop =
84 static const size_t kMinimumStackSize = 1 * KB;
87 static const size_t kMaximumStackSize = 64 * MB;
91 ThreadLocal() { Clear(); }
106 return reinterpret_cast<Address>(&thread_local_.memory_);
110 Address memory_size_address() {
111 return reinterpret_cast<Address>(&thread_local_.memory_size_);
119 ThreadLocal thread_local_;
132 #endif // V8_REGEXP_REGEXP_STACK_H_