Reviewers: jarin,
Message:
PTAL
Description:
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.
Please review this at https://codereview.chromium.org/302783007/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+3, -3 lines):
M src/hydrogen.cc
M src/hydrogen-escape-analysis.cc
Index: src/hydrogen-escape-analysis.cc
diff --git a/src/hydrogen-escape-analysis.cc
b/src/hydrogen-escape-analysis.cc
index
4eb2a13726a4dd5dd0bd84bfdfbaedfc1ba12a6d..831dd2f316e4a2eb0307ad4c748ca04193f3ba33
100644
--- a/src/hydrogen-escape-analysis.cc
+++ b/src/hydrogen-escape-analysis.cc
@@ -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);
}
}
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
ccb34f9844f3c2a32a9f6b321b9f8426e1d97f07..4afa65e74dd087325bf323a3b1cb180b0e5ed274
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -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);
}
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.