mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:39:48 +00:00
Trun on canonical objects verification after reload (still have one workaround for immutable arrays, which is related to the enum issue).
R=johnmccutchan@google.com Review URL: https://codereview.chromium.org/2201473002 .
This commit is contained in:
parent
647d6f3603
commit
714cd8ee6b
|
@ -1098,19 +1098,25 @@ void Isolate::ReportReloadError(const Error& error) {
|
||||||
bool Isolate::ReloadSources(JSONStream* js,
|
bool Isolate::ReloadSources(JSONStream* js,
|
||||||
bool force_reload,
|
bool force_reload,
|
||||||
bool dont_delete_reload_context) {
|
bool dont_delete_reload_context) {
|
||||||
// TODO(asiva): Add verification of canonical objects.
|
|
||||||
ASSERT(!IsReloading());
|
ASSERT(!IsReloading());
|
||||||
has_attempted_reload_ = true;
|
has_attempted_reload_ = true;
|
||||||
reload_context_ = new IsolateReloadContext(this, js);
|
reload_context_ = new IsolateReloadContext(this, js);
|
||||||
reload_context_->StartReload(force_reload);
|
reload_context_->StartReload(force_reload);
|
||||||
bool success = !reload_context_->has_error();
|
bool success = !reload_context_->has_error();
|
||||||
// TODO(asiva): Add verification of canonical objects.
|
// Unit tests use the reload context later. Caller is responsible
|
||||||
if (dont_delete_reload_context) {
|
// for deleting the context.
|
||||||
// Unit tests use the reload context later. Caller is responsible
|
if (!dont_delete_reload_context) {
|
||||||
// for deleting the context.
|
DeleteReloadContext();
|
||||||
return success;
|
|
||||||
}
|
}
|
||||||
DeleteReloadContext();
|
#if defined(DEBUG)
|
||||||
|
if (success) {
|
||||||
|
Thread* thread = Thread::Current();
|
||||||
|
Isolate* isolate = thread->isolate();
|
||||||
|
isolate->heap()->CollectAllGarbage();
|
||||||
|
VerifyCanonicalVisitor check_canonical(thread);
|
||||||
|
isolate->heap()->IterateObjects(&check_canonical);
|
||||||
|
}
|
||||||
|
#endif // DEBUG
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15325,6 +15325,12 @@ bool Instance::CheckIsCanonical(Thread* thread) const {
|
||||||
const Class& cls = Class::Handle(zone, this->clazz());
|
const Class& cls = Class::Handle(zone, this->clazz());
|
||||||
SafepointMutexLocker ml(isolate->constant_canonicalization_mutex());
|
SafepointMutexLocker ml(isolate->constant_canonicalization_mutex());
|
||||||
result ^= cls.LookupCanonicalInstance(zone, *this);
|
result ^= cls.LookupCanonicalInstance(zone, *this);
|
||||||
|
// TODO(johnmccutchan) : Temporary workaround for issue (26988).
|
||||||
|
if ((result.raw() != raw()) &&
|
||||||
|
isolate->HasAttemptedReload() &&
|
||||||
|
(GetClassId() == kImmutableArrayCid)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return (result.raw() == this->raw());
|
return (result.raw() == this->raw());
|
||||||
}
|
}
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
Loading…
Reference in a new issue