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

Unified Diff: runtime/vm/object.cc

Issue 1311403009: More precompiled snapshotting. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 5 years, 3 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
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 123034e7d549837a741459b4a00fa14b5b0e216f..c225b7187c4dfd5e1d999465f146b8caec725756 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -7596,11 +7596,13 @@ void Field::SetPrecompiledInitializer(const Function& initializer) const {
bool Field::HasPrecompiledInitializer() const {
- return raw_ptr()->initializer_.precompiled_->IsFunction();
+ return raw_ptr()->initializer_.precompiled_->IsHeapObject() &&
+ raw_ptr()->initializer_.precompiled_->IsFunction();
}
void Field::SetSavedInitialStaticValue(const Instance& value) const {
+ ASSERT(!HasPrecompiledInitializer());
StorePointer(&raw_ptr()->initializer_.saved_value_, value.raw());
}
@@ -7617,7 +7619,7 @@ void Field::EvaluateInitializer() const {
}
ASSERT(value.IsNull() || value.IsInstance());
SetStaticValue(value.IsNull() ? Instance::null_instance()
- : Instance::Cast(value));
+ : Instance::Cast(value));
return;
} else if (StaticValue() == Object::transition_sentinel().raw()) {
SetStaticValue(Object::null_instance());

Powered by Google App Engine
This is Rietveld 408576698