Chromium Code Reviews| Index: runtime/vm/parser.cc |
| diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc |
| index 86264b9b2308c14281548bc15378f97f132ccecb..7932301034d0ed95f7a187326b3a8b741b83f4bb 100644 |
| --- a/runtime/vm/parser.cc |
| +++ b/runtime/vm/parser.cc |
| @@ -4865,6 +4865,17 @@ void Parser::ParseEnumDefinition(const Class& cls) { |
| Type::Handle(Z, Type::ArrayType()), cls.token_pos()); |
| enum_members.AddField(values_field); |
| + // Add static field 'const _deleted_enum_sentinel'. |
| + Field& deleted_enum_sentinel = Field::ZoneHandle(Z); |
| + deleted_enum_sentinel = |
| + Field::New(Symbols::_DeletedEnumSentinel(), |
| + /* is_static = */ true, |
| + /* is_final = */ true, |
| + /* is_const = */ true, |
| + /* is_reflectable = */ false, cls, |
| + Type::Handle(Z, Type::ArrayType()), cls.token_pos()); |
|
siva
2016/11/14 22:18:23
Type::Handle(Z, Type::ArrayType()) could be hoiste
Cutch
2016/11/15 22:13:55
Done.
|
| + enum_members.AddField(deleted_enum_sentinel); |
| + |
| // Allocate the immutable array containing the enumeration values. |
| // The actual enum instance values will be patched in later. |
| const Array& values_array = Array::Handle(Z, Array::New(i, Heap::kOld)); |