From 179702df0328be179fdb65ebf391eb0dc07b86ef Mon Sep 17 00:00:00 2001 From: "vitalyr@chromium.org" Date: Mon, 23 May 2011 22:23:50 +0000 Subject: [PATCH] Inline more zone stuff. R=ager@chromium.org Review URL: http://codereview.chromium.org/7066004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8009 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/compiler.cc | 10 +++++----- src/compiler.h | 4 +++- src/heap-profiler.cc | 8 ++++---- src/jsregexp.cc | 4 ++-- src/liveedit.cc | 9 +++++---- src/parser.cc | 6 +++--- src/profile-generator.cc | 2 +- src/runtime.cc | 6 +++--- src/zone-inl.h | 7 +++---- src/zone.h | 13 ++++++------- test/cctest/test-ast.cc | 2 +- test/cctest/test-dataflow.cc | 2 +- test/cctest/test-heap-profiler.cc | 8 ++++---- test/cctest/test-liveedit.cc | 2 +- test/cctest/test-regexp.cc | 32 ++++++++++++++++---------------- test/cctest/test-strings.cc | 6 +++--- 16 files changed, 61 insertions(+), 60 deletions(-) diff --git a/src/compiler.cc b/src/compiler.cc index 51c2149..b00b3ed 100755 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -337,9 +337,8 @@ bool Compiler::MakeCodeForLiveEdit(CompilationInfo* info) { static Handle MakeFunctionInfo(CompilationInfo* info) { - CompilationZoneScope zone_scope(DELETE_ON_EXIT); - Isolate* isolate = info->isolate(); + CompilationZoneScope zone_scope(isolate, DELETE_ON_EXIT); PostponeInterruptsScope postpone(isolate); ASSERT(!isolate->global_context().is_null()); @@ -571,12 +570,13 @@ Handle Compiler::CompileEval(Handle source, bool Compiler::CompileLazy(CompilationInfo* info) { - CompilationZoneScope zone_scope(DELETE_ON_EXIT); + Isolate* isolate = info->isolate(); + + CompilationZoneScope zone_scope(isolate, DELETE_ON_EXIT); // The VM is in the COMPILER state until exiting this function. - VMState state(info->isolate(), COMPILER); + VMState state(isolate, COMPILER); - Isolate* isolate = info->isolate(); PostponeInterruptsScope postpone(isolate); Handle shared = info->shared_info(); diff --git a/src/compiler.h b/src/compiler.h index 6a2d48f..4eb33e2 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -294,7 +294,9 @@ class Compiler : public AllStatic { // clear this list of handles as well. class CompilationZoneScope : public ZoneScope { public: - explicit CompilationZoneScope(ZoneScopeMode mode) : ZoneScope(mode) { } + CompilationZoneScope(Isolate* isolate, ZoneScopeMode mode) + : ZoneScope(isolate, mode) {} + virtual ~CompilationZoneScope() { if (ShouldDeleteOnExit()) { Isolate* isolate = Isolate::Current(); diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc index 4815f82..ec078ed 100644 --- a/src/heap-profiler.cc +++ b/src/heap-profiler.cc @@ -474,7 +474,7 @@ const JSObjectsClusterTreeConfig::Value JSObjectsClusterTreeConfig::kNoValue; ConstructorHeapProfile::ConstructorHeapProfile() - : zscope_(DELETE_ON_EXIT) { + : zscope_(Isolate::Current(), DELETE_ON_EXIT) { } @@ -584,7 +584,7 @@ inline int ClustersCoarser::ClusterBackRefs::Compare( ClustersCoarser::ClustersCoarser() - : zscope_(DELETE_ON_EXIT), + : zscope_(Isolate::Current(), DELETE_ON_EXIT), sim_list_(ClustersCoarser::kInitialSimilarityListCapacity), current_pair_(NULL), current_set_(NULL), @@ -699,7 +699,7 @@ const JSObjectsRetainerTreeConfig::Value JSObjectsRetainerTreeConfig::kNoValue = RetainerHeapProfile::RetainerHeapProfile() - : zscope_(DELETE_ON_EXIT), + : zscope_(Isolate::Current(), DELETE_ON_EXIT), aggregator_(NULL) { JSObjectsCluster roots(JSObjectsCluster::ROOTS); ReferencesExtractor extractor(roots, this); @@ -1027,7 +1027,7 @@ class AggregatingRetainerTreeIterator { if (coarser_ != NULL && !coarser_->GetCoarseEquivalent(cluster).is_null()) return; JSObjectsClusterTree* tree_to_iterate = tree; - ZoneScope zs(DELETE_ON_EXIT); + ZoneScope zs(Isolate::Current(), DELETE_ON_EXIT); JSObjectsClusterTree dest_tree_; if (coarser_ != NULL) { RetainersAggregator retainers_aggregator(coarser_, &dest_tree_); diff --git a/src/jsregexp.cc b/src/jsregexp.cc index 66b6332..4d42c11 100644 --- a/src/jsregexp.cc +++ b/src/jsregexp.cc @@ -127,7 +127,7 @@ Handle RegExpImpl::Compile(Handle re, return re; } pattern = FlattenGetString(pattern); - CompilationZoneScope zone_scope(DELETE_ON_EXIT); + CompilationZoneScope zone_scope(isolate, DELETE_ON_EXIT); PostponeInterruptsScope postpone(isolate); RegExpCompileData parse_result; FlatStringReader reader(isolate, pattern); @@ -302,7 +302,7 @@ bool RegExpImpl::EnsureCompiledIrregexp(Handle re, bool is_ascii) { bool RegExpImpl::CompileIrregexp(Handle re, bool is_ascii) { // Compile the RegExp. Isolate* isolate = re->GetIsolate(); - CompilationZoneScope zone_scope(DELETE_ON_EXIT); + CompilationZoneScope zone_scope(isolate, DELETE_ON_EXIT); PostponeInterruptsScope postpone(isolate); Object* entry = re->DataAt(JSRegExp::code_index(is_ascii)); if (entry->IsJSObject()) { diff --git a/src/liveedit.cc b/src/liveedit.cc index 4bfd3aa..e89cae3 100644 --- a/src/liveedit.cc +++ b/src/liveedit.cc @@ -814,7 +814,7 @@ class FunctionInfoListener { JSArray* LiveEdit::GatherCompileInfo(Handle