diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-06-29 17:26:51 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-06-29 17:26:51 +0200 |
commit | 33af2720f26c2b25bc7f75ce7eb454ff99db6d35 (patch) | |
tree | 9a38f0c96420edf503eebd6325dd8d2d8249f653 /deps/v8/src/regexp-stack.cc | |
parent | 6afdca885adeeeed9eef8cbb01c3d97af0bc084d (diff) | |
download | node-new-33af2720f26c2b25bc7f75ce7eb454ff99db6d35.tar.gz |
Upgrade V8 to 3.4.8
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 |