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

Side by Side Diff: src/regexp-stack.h

Issue 18844: * Irregexp-ia32: Grow stack larger if necessary. (Closed)
Patch Set: Created 11 years, 11 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 | « no previous file | 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 static char* RestoreStack(char* from); 72 static char* RestoreStack(char* from);
73 73
74 private: 74 private:
75 // Artificial limit used when no memory has been allocated. 75 // Artificial limit used when no memory has been allocated.
76 static const uint32_t kMemoryTop = 0xffffffff; 76 static const uint32_t kMemoryTop = 0xffffffff;
77 77
78 // Minimal size of allocated stack area. 78 // Minimal size of allocated stack area.
79 static const size_t kMinimumStackSize = 1 * KB; 79 static const size_t kMinimumStackSize = 1 * KB;
80 80
81 // Maximal size of allocated stack area. 81 // Maximal size of allocated stack area.
82 static const size_t kMaximumStackSize = 256 * KB; 82 static const size_t kMaximumStackSize = 64 * MB;
83 83
84 // Structure holding the allocated memory, size and limit. 84 // Structure holding the allocated memory, size and limit.
85 struct ThreadLocal { 85 struct ThreadLocal {
86 ThreadLocal() 86 ThreadLocal()
87 : memory_(NULL), 87 : memory_(NULL),
88 memory_size_(0), 88 memory_size_(0),
89 limit_(reinterpret_cast<Address>(kMemoryTop)) {} 89 limit_(reinterpret_cast<Address>(kMemoryTop)) {}
90 // If memory_size_ > 0 then memory_ must be non-NULL. 90 // If memory_size_ > 0 then memory_ must be non-NULL.
91 Address memory_; 91 Address memory_;
92 size_t memory_size_; 92 size_t memory_size_;
93 Address limit_; 93 Address limit_;
94 }; 94 };
95 95
96 // Resets the buffer if it has grown beyond the default/minimum size. 96 // Resets the buffer if it has grown beyond the default/minimum size.
97 // After this, the buffer is either the default size, or it is empty, so 97 // After this, the buffer is either the default size, or it is empty, so
98 // you have to call EnsureCapacity before using it again. 98 // you have to call EnsureCapacity before using it again.
99 static void Reset(); 99 static void Reset();
100 100
101 static ThreadLocal thread_local_; 101 static ThreadLocal thread_local_;
102 }; 102 };
103 103
104 }} // namespace v8::internal 104 }} // namespace v8::internal
105 105
106 #endif /* REGEXP_STACK_H_ */ 106 #endif /* REGEXP_STACK_H_ */
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698