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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1289643005: Rename accessors of class Field to make it more apparent as to what is being accessed - static fiel… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add-comment 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
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index fc4dfad6ede497fa9f90b1e9b2352024311f1ed9..8fb13386aa6aacbe62579232f58904e4d1a365e6 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -1361,8 +1361,8 @@ void ClassFinalizer::ResolveAndFinalizeMemberTypes(const Class& cls) {
}
}
if (field.is_static() &&
- (field.value() != Object::null()) &&
- (field.value() != Object::sentinel().raw())) {
+ (field.StaticValue() != Object::null()) &&
+ (field.StaticValue() != Object::sentinel().raw())) {
// The parser does not preset the value if the type is a type parameter or
// is parameterized unless the value is null.
Error& error = Error::Handle(Z);
@@ -1371,7 +1371,8 @@ void ClassFinalizer::ResolveAndFinalizeMemberTypes(const Class& cls) {
} else {
ASSERT(type.IsInstantiated());
}
- const Instance& const_value = Instance::Handle(Z, field.value());
+ const Instance& const_value =
+ Instance::Handle(Z, field.StaticValue());
if (!error.IsNull() ||
(!type.IsDynamicType() &&
!const_value.IsInstanceOf(type,
@@ -1413,7 +1414,7 @@ void ClassFinalizer::ResolveAndFinalizeMemberTypes(const Class& cls) {
getter.set_result_type(type);
getter.set_is_debuggable(false);
cls.AddFunction(getter);
- field.set_value(Object::sentinel());
+ field.SetStaticValue(Object::sentinel(), true);
}
}
}
@@ -2431,8 +2432,9 @@ void ClassFinalizer::AllocateEnumValues(const Class &enum_cls) {
const Field& values_field =
Field::Handle(enum_cls.LookupStaticField(Symbols::Values()));
ASSERT(!values_field.IsNull());
- ASSERT(Instance::Handle(values_field.value()).IsArray());
- Array& values_list = Array::Handle(Array::RawCast(values_field.value()));
+ ASSERT(Instance::Handle(values_field.StaticValue()).IsArray());
+ Array& values_list = Array::Handle(
+ Array::RawCast(values_field.StaticValue()));
const Array& fields = Array::Handle(enum_cls.fields());
Field& field = Field::Handle();
@@ -2442,7 +2444,7 @@ void ClassFinalizer::AllocateEnumValues(const Class &enum_cls) {
for (intptr_t i = 0; i < fields.Length(); i++) {
field = Field::RawCast(fields.At(i));
if (!field.is_static()) continue;
- ordinal_value = field.value();
+ ordinal_value = field.StaticValue();
// The static fields that need to be initialized with enum instances
// contain the smi value of the ordinal number, which was stored in
// the field by the parser. Other fields contain non-smi values.
@@ -2456,7 +2458,7 @@ void ClassFinalizer::AllocateEnumValues(const Class &enum_cls) {
UNREACHABLE();
}
ASSERT(enum_value.IsCanonical());
- field.set_value(enum_value);
+ field.SetStaticValue(enum_value, true);
field.RecordStore(enum_value);
intptr_t ord = Smi::Cast(ordinal_value).Value();
ASSERT(ord < values_list.Length());
« no previous file with comments | « runtime/vm/ast.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698