| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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_STACK_H_ | 5 #ifndef V8_REGEXP_STACK_H_ |
| 6 #define V8_REGEXP_STACK_H_ | 6 #define V8_REGEXP_STACK_H_ |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 class RegExpStack { | 35 class RegExpStack { |
| 36 public: | 36 public: |
| 37 // Number of allocated locations on the stack below the limit. | 37 // Number of allocated locations on the stack below the limit. |
| 38 // No sequence of pushes must be longer that this without doing a stack-limit | 38 // No sequence of pushes must be longer that this without doing a stack-limit |
| 39 // check. | 39 // check. |
| 40 static const int kStackLimitSlack = 32; | 40 static const int kStackLimitSlack = 32; |
| 41 | 41 |
| 42 // Gives the top of the memory used as stack. | 42 // Gives the top of the memory used as stack. |
| 43 Address stack_base() { | 43 Address stack_base() { |
| 44 ASSERT(thread_local_.memory_size_ != 0); | 44 DCHECK(thread_local_.memory_size_ != 0); |
| 45 return thread_local_.memory_ + thread_local_.memory_size_; | 45 return thread_local_.memory_ + thread_local_.memory_size_; |
| 46 } | 46 } |
| 47 | 47 |
| 48 // The total size of the memory allocated for the stack. | 48 // The total size of the memory allocated for the stack. |
| 49 size_t stack_capacity() { return thread_local_.memory_size_; } | 49 size_t stack_capacity() { return thread_local_.memory_size_; } |
| 50 | 50 |
| 51 // If the stack pointer gets below the limit, we should react and | 51 // If the stack pointer gets below the limit, we should react and |
| 52 // either grow the stack or report an out-of-stack exception. | 52 // either grow the stack or report an out-of-stack exception. |
| 53 // There is only a limited number of locations below the stack limit, | 53 // There is only a limited number of locations below the stack limit, |
| 54 // so users of the stack should check the stack limit during any | 54 // so users of the stack should check the stack limit during any |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 friend class ExternalReference; | 116 friend class ExternalReference; |
| 117 friend class Isolate; | 117 friend class Isolate; |
| 118 friend class RegExpStackScope; | 118 friend class RegExpStackScope; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(RegExpStack); | 120 DISALLOW_COPY_AND_ASSIGN(RegExpStack); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 }} // namespace v8::internal | 123 }} // namespace v8::internal |
| 124 | 124 |
| 125 #endif // V8_REGEXP_STACK_H_ | 125 #endif // V8_REGEXP_STACK_H_ |
| OLD | NEW |