From 36a4d039b1fb3b547499dcc9f4d474c1e0767bb0 Mon Sep 17 00:00:00 2001 From: "mads.s.ager@gmail.com" Date: Mon, 1 Sep 2008 06:06:52 +0000 Subject: [PATCH] Introduce ZoneScope class to keep track of zone deletion. Remove unsafe calls to Zone::DeleteAll() from parser and use ZoneScopes instead. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@54 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler.cc | 26 ++------------------------ src/parser.cc | 7 +++++-- src/zone.cc | 1 + src/zone.h | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index 6a79605cb3..7d2e661f5c 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -48,28 +48,6 @@ DEFINE_bool(print_scopes, false, "print scopes"); #endif -// Helper class to keep track of compilation nesting and to do proper -// cleanups of generated ASTs. -class CompilationTracker BASE_EMBEDDED { - public: - CompilationTracker() { - ++nesting_; - } - - ~CompilationTracker() { - // If we're leaving the top-level compilation, we must make sure - // to get rid of all generated ASTs. - if (--nesting_ == 0) Zone::DeleteAll(); - } - - private: - static int nesting_; -}; - - -int CompilationTracker::nesting_ = 0; - - static Handle MakeCode(FunctionLiteral* literal, Handle