mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:49:47 +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 force_reload,
|
||||
bool dont_delete_reload_context) {
|
||||
// TODO(asiva): Add verification of canonical objects.
|
||||
ASSERT(!IsReloading());
|
||||
has_attempted_reload_ = true;
|
||||
reload_context_ = new IsolateReloadContext(this, js);
|
||||
reload_context_->StartReload(force_reload);
|
||||
bool success = !reload_context_->has_error();
|
||||
// TODO(asiva): Add verification of canonical objects.
|
||||
if (dont_delete_reload_context) {
|
||||
// Unit tests use the reload context later. Caller is responsible
|
||||
// for deleting the context.
|
||||
return success;
|
||||
// Unit tests use the reload context later. Caller is responsible
|
||||
// for deleting the context.
|
||||
if (!dont_delete_reload_context) {
|
||||
DeleteReloadContext();
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -15325,6 +15325,12 @@ bool Instance::CheckIsCanonical(Thread* thread) const {
|
|||
const Class& cls = Class::Handle(zone, this->clazz());
|
||||
SafepointMutexLocker ml(isolate->constant_canonicalization_mutex());
|
||||
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());
|
||||
}
|
||||
#endif // DEBUG
|
||||
|
|
Loading…
Reference in a new issue