diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-07-08 16:40:11 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-07-08 16:40:11 -0700 |
commit | e5564a3f29e0a818832a97c7c3b28d7c8b3b0460 (patch) | |
tree | 4b48a6577080d5e44da4d2cbebb7fe7951660de8 /deps/v8/src/regexp-stack.cc | |
parent | 0df2f74d364826053641395b01c2fcb1345057a9 (diff) | |
download | node-new-e5564a3f29e0a818832a97c7c3b28d7c8b3b0460.tar.gz |
Upgrade V8 to 3.4.10
Diffstat (limited to 'deps/v8/src/regexp-stack.cc')
-rw-r--r-- | deps/v8/src/regexp-stack.cc | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/deps/v8/src/regexp-stack.cc b/deps/v8/src/regexp-stack.cc index 7696279a1d..ff9547f3a7 100644 --- a/deps/v8/src/regexp-stack.cc +++ b/deps/v8/src/regexp-stack.cc @@ -26,21 +26,31 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "v8.h" -#include "top.h" #include "regexp-stack.h" namespace v8 { namespace internal { -RegExpStack::RegExpStack() { +RegExpStackScope::RegExpStackScope(Isolate* isolate) + : regexp_stack_(isolate->regexp_stack()) { // Initialize, if not already initialized. - RegExpStack::EnsureCapacity(0); + regexp_stack_->EnsureCapacity(0); } -RegExpStack::~RegExpStack() { +RegExpStackScope::~RegExpStackScope() { + ASSERT(Isolate::Current() == regexp_stack_->isolate_); // Reset the buffer if it has grown. - RegExpStack::Reset(); + regexp_stack_->Reset(); +} + + +RegExpStack::RegExpStack() + : isolate_(NULL) { +} + + +RegExpStack::~RegExpStack() { } @@ -70,9 +80,9 @@ void RegExpStack::Reset() { void RegExpStack::ThreadLocal::Free() { - if (thread_local_.memory_size_ > 0) { - DeleteArray(thread_local_.memory_); - thread_local_ = ThreadLocal(); + if (memory_size_ > 0) { + DeleteArray(memory_); + Clear(); } } @@ -98,6 +108,4 @@ Address RegExpStack::EnsureCapacity(size_t size) { } -RegExpStack::ThreadLocal RegExpStack::thread_local_; - }} // namespace v8::internal |