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

Unified Diff: runtime/vm/precompiler.cc

Issue 2141263003: Fix clearing compile time constant caches during tree shaking. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: whitespace 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 4ba710b69aeb6b8892a0e4132c2c1da5466e6b07..13c4595e5535617f29b3711ded14422758982ca5 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -241,6 +241,7 @@ void Precompiler::DoCompileAll(
// Clear these before dropping classes as they may hold onto otherwise
// dead instances of classes we will remove.
+ DropCompileTimeConstantCaches();
I->object_store()->set_unique_dynamic_targets(Array::null_array());
Class& null_class = Class::Handle(Z);
I->object_store()->set_future_class(null_class);
@@ -1559,6 +1560,21 @@ void Precompiler::DropTypeArguments() {
}
+void Precompiler::DropCompileTimeConstantCaches() {
+ Library& lib = Library::Handle(Z);
+ Array& scripts = Array::Handle(Z);
+ Script& script = Script::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());
+ }
+ }
+}
+
+
void Precompiler::TraceTypesFromRetainedClasses() {
Library& lib = Library::Handle(Z);
Class& cls = Class::Handle(Z);
« 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