mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm] Remove left-over code from unevaluated constants.
Change-Id: Ife7e6678aabcbd7152d6d77757226c0dc3161ff6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114855 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
parent
1438a68034
commit
69b7082290
|
@ -1241,12 +1241,6 @@ void ClassFinalizer::AllocateEnumValues(const Class& enum_cls) {
|
|||
sentinel.SetStaticValue(enum_value, true);
|
||||
sentinel.RecordStore(enum_value);
|
||||
|
||||
const GrowableObjectArray& pending_unevaluated_const_fields =
|
||||
GrowableObjectArray::Handle(zone,
|
||||
thread->isolate()
|
||||
->object_store()
|
||||
->pending_unevaluated_const_fields());
|
||||
|
||||
ASSERT(enum_cls.is_declared_in_bytecode() || enum_cls.kernel_offset() > 0);
|
||||
Error& error = Error::Handle(zone);
|
||||
for (intptr_t i = 0; i < fields.Length(); i++) {
|
||||
|
@ -1255,20 +1249,13 @@ void ClassFinalizer::AllocateEnumValues(const Class& enum_cls) {
|
|||
(sentinel.raw() == field.raw())) {
|
||||
continue;
|
||||
}
|
||||
// The eager evaluation of the enum values is required for hot-reload (see
|
||||
// commit e3ecc87). However, while busy loading the constant table, we
|
||||
// need to postpone this evaluation until table is done.
|
||||
// Hot-reload expects the static const fields to be evaluated when
|
||||
// performing a reload.
|
||||
if (!FLAG_precompiled_mode) {
|
||||
if (field.IsUninitialized()) {
|
||||
if (pending_unevaluated_const_fields.IsNull()) {
|
||||
// Evaluate right away.
|
||||
error = field.Initialize();
|
||||
if (!error.IsNull()) {
|
||||
ReportError(error);
|
||||
}
|
||||
} else {
|
||||
// Postpone evaluation until we have a constant table.
|
||||
pending_unevaluated_const_fields.Add(field);
|
||||
error = field.Initialize();
|
||||
if (!error.IsNull()) {
|
||||
ReportError(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,6 @@ class ObjectPointerVisitor;
|
|||
RW(Array, libraries_map) \
|
||||
RW(GrowableObjectArray, closure_functions) \
|
||||
RW(GrowableObjectArray, pending_classes) \
|
||||
RW(GrowableObjectArray, pending_unevaluated_const_fields) \
|
||||
R_(GrowableObjectArray, pending_deferred_loads) \
|
||||
R_(GrowableObjectArray, resume_capabilities) \
|
||||
R_(GrowableObjectArray, exit_listeners) \
|
||||
|
|
Loading…
Reference in a new issue