Commit 1102eeaf authored by bmeurer@chromium.org's avatar bmeurer@chromium.org

Reuse ZoneList memory if possible.

Clear() is rather wasteful for ZoneLists, because it discards
all previously allocated memory, making it impossible to reuse
until the whole Zone is released. Better use Rewind(0) in this
case, which just resets the length to zero.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/302783007

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21545 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5599b3a7
......@@ -299,7 +299,7 @@ void HEscapeAnalysisPhase::PerformScalarReplacement() {
int size_in_bytes = allocate->size()->GetInteger32Constant();
number_of_values_ = size_in_bytes / kPointerSize;
number_of_objects_++;
block_states_.Clear();
block_states_.Rewind(0);
// Perform actual analysis step.
AnalyzeDataFlow(allocate);
......@@ -320,7 +320,7 @@ void HEscapeAnalysisPhase::Run() {
CollectCapturedValues();
if (captured_.is_empty()) break;
PerformScalarReplacement();
captured_.Clear();
captured_.Rewind(0);
}
}
......
......@@ -10515,7 +10515,7 @@ void HOptimizedGraphBuilder::VisitDeclarations(
DeclareGlobalsNativeFlag::encode(current_info()->is_native()) |
DeclareGlobalsStrictMode::encode(current_info()->strict_mode());
Add<HDeclareGlobals>(array, flags);
globals_.Clear();
globals_.Rewind(0);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment