From 33af2720f26c2b25bc7f75ce7eb454ff99db6d35 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 29 Jun 2011 17:26:51 +0200 Subject: Upgrade V8 to 3.4.8 --- deps/v8/src/regexp-stack.cc | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'deps/v8/src/regexp-stack.cc') 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 -- cgit v1.2.1