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

Unified Diff: runtime/vm/precompiler.cc

Issue 1968593003: VM: Fix precompiler running with multiple iterations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 4 years, 7 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 | « no previous file | 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 cd6eb34aa96a44578ecf8e57267c46e534d779a8..924d8a19118ef45b1bbb746b3e5d5ffb9d75f57d 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -768,21 +768,17 @@ void Precompiler::AddField(const Field& field) {
const bool is_initialized = value.raw() != Object::sentinel().raw();
if (is_initialized && !reset_fields_) return;
- if (!field.HasPrecompiledInitializer()) {
+ if (!field.HasPrecompiledInitializer() ||
+ !Function::Handle(Z, field.PrecompiledInitializer()).HasCode()) {
if (FLAG_trace_precompiler) {
THR_Print("Precompiling initializer for %s\n", field.ToCString());
}
ASSERT(Dart::snapshot_kind() != Snapshot::kAppNoJIT);
- field.SetStaticValue(Instance::Handle(field.SavedInitialStaticValue()));
const Function& initializer =
- Function::Handle(CompileStaticInitializer(field));
- if (!initializer.IsNull()) {
- field.SetPrecompiledInitializer(initializer);
- }
- ASSERT(field.HasPrecompiledInitializer());
- const Function& function =
- Function::Handle(Z, field.PrecompiledInitializer());
- AddCalleesOf(function);
+ Function::Handle(Z, CompileStaticInitializer(field));
+ ASSERT(!initializer.IsNull());
+ field.SetPrecompiledInitializer(initializer);
+ AddCalleesOf(initializer);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698