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

Unified Diff: runtime/vm/object.cc

Issue 1672873003: Bailout if field state changed during background compilation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comment Created 4 years, 10 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/object.h ('k') | runtime/vm/source_report.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index ed737215e2b5f2c70108357d1470eab41711ddde..451dc3c0c22028766d101b96be346df65cf234fb 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -116,6 +116,7 @@ Smi* Object::smi_illegal_cid_ = NULL;
LanguageError* Object::snapshot_writer_error_ = NULL;
LanguageError* Object::branch_offset_error_ = NULL;
LanguageError* Object::speculative_inlining_error_ = NULL;
+LanguageError* Object::background_compilation_error_ = NULL;
Array* Object::vm_isolate_snapshot_object_table_ = NULL;
Type* Object::dynamic_type_ = NULL;
Type* Object::void_type_ = NULL;
@@ -492,6 +493,7 @@ void Object::InitOnce(Isolate* isolate) {
snapshot_writer_error_ = LanguageError::ReadOnlyHandle();
branch_offset_error_ = LanguageError::ReadOnlyHandle();
speculative_inlining_error_ = LanguageError::ReadOnlyHandle();
+ background_compilation_error_ = LanguageError::ReadOnlyHandle();
vm_isolate_snapshot_object_table_ = Array::ReadOnlyHandle();
dynamic_type_ = Type::ReadOnlyHandle();
void_type_ = Type::ReadOnlyHandle();
@@ -842,6 +844,10 @@ void Object::InitOnce(Isolate* isolate) {
*speculative_inlining_error_ = LanguageError::New(error_str,
Report::kBailout,
Heap::kOld);
+ error_str = String::New("Background Compilation Failed", Heap::kOld);
+ *background_compilation_error_ = LanguageError::New(error_str,
+ Report::kBailout,
+ Heap::kOld);
// Some thread fields need to be reinitialized as null constants have not been
// initialized until now.
@@ -890,6 +896,8 @@ void Object::InitOnce(Isolate* isolate) {
ASSERT(branch_offset_error_->IsLanguageError());
ASSERT(!speculative_inlining_error_->IsSmi());
ASSERT(speculative_inlining_error_->IsLanguageError());
+ ASSERT(!background_compilation_error_->IsSmi());
+ ASSERT(background_compilation_error_->IsLanguageError());
ASSERT(!vm_isolate_snapshot_object_table_->IsSmi());
ASSERT(vm_isolate_snapshot_object_table_->IsArray());
}
@@ -6737,6 +6745,7 @@ void Function::RestoreICDataMap(
Zone* zone = Thread::Current()->zone();
const Array& saved_ic_data = Array::Handle(zone, ic_data_array());
if (saved_ic_data.IsNull()) {
+ // Could happen with deferred loading.
return;
}
const intptr_t saved_length = saved_ic_data.Length();
@@ -10256,7 +10265,9 @@ class PrefixDependentArray : public WeakCodeReferences {
void LibraryPrefix::RegisterDependentCode(const Code& code) const {
ASSERT(is_deferred_load());
- ASSERT(!is_loaded());
+ // In background compilation, a library can be loaded while we are compiling.
+ // The generated code will be rejected in that case,
+ ASSERT(!is_loaded() || Compiler::IsBackgroundCompilation());
PrefixDependentArray a(*this);
a.Register(code);
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/source_report.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698