Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1527)

Unified Diff: runtime/vm/precompiler.cc

Issue 2167683004: Clear token streams before compacting the symbol table. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/precompiler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index 1eaf79a917eb729e8daaee09eb3844eb244f92e1..dc0edb5efd6cb0c112a7d077541404e1bd27e4af 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -240,8 +240,8 @@ void Precompiler::DoCompileAll(
DropTypeArguments();
// Clear these before dropping classes as they may hold onto otherwise
- // dead instances of classes we will remove.
- DropCompileTimeConstantCaches();
+ // dead instances of classes we will remove or otherwise unused symbols.
+ DropScriptData();
I->object_store()->set_unique_dynamic_targets(Array::null_array());
Class& null_class = Class::Handle(Z);
I->object_store()->set_future_class(null_class);
@@ -1560,16 +1560,19 @@ void Precompiler::DropTypeArguments() {
}
-void Precompiler::DropCompileTimeConstantCaches() {
+void Precompiler::DropScriptData() {
Library& lib = Library::Handle(Z);
Array& scripts = Array::Handle(Z);
Script& script = Script::Handle(Z);
+ const TokenStream& null_tokens = TokenStream::Handle(Z);
for (intptr_t i = 0; i < libraries_.Length(); i++) {
lib ^= libraries_.At(i);
scripts = lib.LoadedScripts();
for (intptr_t j = 0; j < scripts.Length(); j++) {
script ^= scripts.At(j);
script.set_compile_time_constants(Array::null_array());
+ script.set_source(String::null_string());
+ script.set_tokens(null_tokens);
}
}
}
« no previous file with comments | « runtime/vm/precompiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698